MotionState.h 741 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef ANKI_PHYSICS_MOTION_STATE_H
  2. #define ANKI_PHYSICS_MOTION_STATE_H
  3. #include "anki/scene/MoveComponent.h"
  4. #include <LinearMath/btMotionState.h>
  5. namespace anki {
  6. /// A custom motion state
  7. class MotionState: public btMotionState
  8. {
  9. public:
  10. MotionState();
  11. MotionState(const Transform& initialTransform, MoveComponent* node);
  12. ~MotionState()
  13. {}
  14. MotionState& operator=(const MotionState& b);
  15. /// @name Bullet implementation of virtuals
  16. /// @{
  17. void getWorldTransform(btTransform& worldTrans) const
  18. {
  19. worldTrans = worldTransform;
  20. }
  21. void setWorldTransform(const btTransform& worldTrans);
  22. /// @}
  23. private:
  24. btTransform worldTransform;
  25. MoveComponent* node; ///< Pointer cause it may be NULL
  26. };
  27. } // end namespace anki
  28. #endif