7 #ifndef NDK_COMPONENTS_PHYSICSCOMPONENT2D_HPP 8 #define NDK_COMPONENTS_PHYSICSCOMPONENT2D_HPP 10 #include <Nazara/Physics2D/RigidBody2D.hpp> 11 #include <NDK/Component.hpp> 26 void AddForce(
const Nz::Vector2f& force, Nz::CoordSys coordSys = Nz::CoordSys_Global);
28 void AddTorque(
float torque);
31 float GetAngularVelocity()
const;
32 Nz::Vector2f GetCenterOfGravity(Nz::CoordSys coordSys = Nz::CoordSys_Local)
const;
33 float GetMass()
const;
35 float GetRotation()
const;
38 bool IsSleeping()
const;
40 void SetAngularVelocity(
float angularVelocity);
41 void SetMass(
float mass);
44 void SetRotation(
float rotation);
47 static ComponentIndex componentIndex;
50 Nz::RigidBody2D& GetRigidBody();
52 void OnAttached()
override;
55 void OnDetached()
override;
56 void OnEntityDestruction()
override;
58 std::unique_ptr<Nz::RigidBody2D> m_object;
62 #include <NDK/Components/PhysicsComponent2D.inl> 64 #endif // NDK_COMPONENTS_PHYSICSCOMPONENT2D_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 a two-dimensional collision geometry.
Definition: CollisionComponent2D.hpp:17
NDK class that represents a physics point, without any collision.
Definition: PhysicsComponent2D.hpp:16
NDK class that represents a two-dimensional physics system.
Definition: PhysicsSystem2D.hpp:17
NDK class that represents the common base of all components.
Definition: BaseComponent.hpp:17