physics_object.h 983 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. *** :: Physics Object ::
  3. ***
  4. *** -- WIP --
  5. ***
  6. *** An object which also contains
  7. *** physics and movement data such
  8. *** as velocity and acceleration
  9. ***
  10. *** Some WIP functions to collide such
  11. *** objects with static objects.
  12. ***
  13. **/
  14. #ifndef physics_object_h
  15. #define physics_object_h
  16. #include "cengine.h"
  17. #include "entities/static_object.h"
  18. typedef struct {
  19. vec3 position;
  20. vec3 scale;
  21. quat rotation;
  22. vec3 velocity;
  23. quat angular_velocity;
  24. vec3 acceleration;
  25. quat angular_acceleration;
  26. vec3 previous_position;
  27. float elasticity;
  28. float friction;
  29. bool active;
  30. bool recieve_shadows;
  31. bool cast_shadows;
  32. asset_hndl renderable;
  33. asset_hndl collision_body;
  34. } physics_object;
  35. physics_object* physics_object_new();
  36. void physics_object_delete(physics_object* po);
  37. void physics_object_collide_static(physics_object* po, static_object* so, float timestep);
  38. void physics_object_update(physics_object* po, float timestep);
  39. #endif