2
0

PhysicsObject.h 635 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef ANKI_PHYSICS_PSYSICS_OBJECT_H
  2. #define ANKI_PHYSICS_PSYSICS_OBJECT_H
  3. #include "anki/util/Assert.h"
  4. #include "anki/scene/Common.h"
  5. namespace anki {
  6. class PhysicsWorld;
  7. // The base of all physics objects
  8. class PhysicsObject
  9. {
  10. public:
  11. PhysicsObject(PhysicsWorld* world_)
  12. : world(world_)
  13. {
  14. ANKI_ASSERT(world);
  15. }
  16. virtual ~PhysicsObject()
  17. {}
  18. /// @name Accessors
  19. /// @{
  20. PhysicsWorld& getPhysicsWorld()
  21. {
  22. return *world;
  23. }
  24. const PhysicsWorld& getPhysicsWorld() const
  25. {
  26. return *world;
  27. }
  28. SceneAllocator<U8> getSceneAllocator() const;
  29. /// @}
  30. private:
  31. PhysicsWorld* world;
  32. };
  33. } // end namespace anki
  34. #endif