7 #ifndef NDK_COMPONENTS_PHYSICSCOMPONENT3D_HPP 8 #define NDK_COMPONENTS_PHYSICSCOMPONENT3D_HPP 10 #include <Nazara/Physics3D/RigidBody3D.hpp> 11 #include <NDK/Component.hpp> 19 friend class PhysicsSystem3D;
26 void AddForce(
const Nz::Vector3f& force, Nz::CoordSys coordSys = Nz::CoordSys_Global);
28 void AddTorque(
const Nz::Vector3f& torque, Nz::CoordSys coordSys = Nz::CoordSys_Global);
30 void EnableAutoSleep(
bool autoSleep);
34 float GetGravityFactor()
const;
35 float GetMass()
const;
36 Nz::Vector3f GetMassCenter(Nz::CoordSys coordSys = Nz::CoordSys_Local)
const;
42 bool IsAutoSleepEnabled()
const;
43 bool IsMoveable()
const;
44 bool IsSleeping()
const;
46 void SetAngularVelocity(
const Nz::Vector3f& angularVelocity);
47 void SetGravityFactor(
float gravityFactor);
48 void SetMass(
float mass);
54 static ComponentIndex componentIndex;
57 Nz::RigidBody3D& GetRigidBody();
59 void OnAttached()
override;
62 void OnDetached()
override;
63 void OnEntityDestruction()
override;
65 std::unique_ptr<Nz::RigidBody3D> m_object;
69 #include <NDK/Components/PhysicsComponent3D.inl> 71 #endif // NDK_COMPONENTS_PHYSICSCOMPONENT3D_HPP TODO: For now is unable to display different color in the history, it needs a RichTextDrawer to do so...
Definition: Algorithm.hpp:12
NDK class that represents the component for collision (meant for static objects)
Definition: CollisionComponent3D.hpp:17
NDK class that represents the component for physics (meant for dynamic objects)
Definition: PhysicsComponent3D.hpp:16
NDK class that represents the common base of all components.
Definition: BaseComponent.hpp:17