7class btCollisionObject;
20 friend class ::PhysicsManager;
21 friend class ::Physics::Trigger;
31 void Serialize(Json::Value& node,
bool load)
override;
91 btRigidBody* GetBulletRigidBody();
96 btCollisionObject* GetBulletCollisionObject();
100 void NewBulletRigidBody(
float mass);
105 void SetCollisionShape(std::shared_ptr<Physics::Shape> shape);
108 glm::vec3 GetPosition()
const;
111 void SetPosition(
const glm::vec3& pos);
114 glm::quat GetOrientation()
const;
117 void SetOrientation(
const glm::quat& rotation);
123 void SetMass(
float mass);
125 void SetFriction(
float friction);
126 void SetRollingFriction(
float friction);
127 void SetSpinningFriction(
float friction);
129 void SetRestitution(
float cor);
131 void SetLinearDamping(
float damping);
132 void SetAngularDamping(
float damping);
134 void MakeKinematic();
136 void SetGhost(
bool ghost);
140 bool GetForceTransformSync()
const;
141 void SetForceTransformSync(
bool sync);
145 bool GetHaltMovement()
const;
146 void SetHaltMovement(
bool halt);
149 btRigidBody* rigidBody =
nullptr;
150 btGhostObject* ghostObject =
nullptr;
151 bool kinematic =
false;
152 bool forceTransformSync =
true;
153 bool haltMovement =
true;
154 float friction = 0.0f;
155 float rollingFriction = 0.0f;
156 float spinningFriction = 0.0f;
157 float restitution = 0.0f;
158 float linearDamping = 0.0f;
159 float angularDamping = 0.0f;
161 std::shared_ptr<Physics::Shape> shape;
Component that allows interacting with other physics components.
Definition: RigidBody.hpp:19
float GetLinearDamping() const
Get the linear damping of the rigid body.
Definition: RigidBody.cpp:76
float GetFriction() const
Definition: RigidBody.cpp:60
void Serialize(Json::Value &node, bool load) override
Save or load component values to/from JSON.
Definition: RigidBody.cpp:18
float GetSpinningFriction() const
Get the spinning friction coefficient of the rigid body.
Definition: RigidBody.cpp:68
bool IsGhost() const
Definition: RigidBody.cpp:56
~RigidBody()
Destructor.
Definition: RigidBody.cpp:14
float GetRestitution() const
Get the coefficient of restitution of the rigid body.
Definition: RigidBody.cpp:72
float GetRollingFriction() const
Get the rolling friction coefficient of the rigid body.
Definition: RigidBody.cpp:64
float GetAngularDamping() const
Get the angular damping of the rigid body.
Definition: RigidBody.cpp:80
bool IsKinematic() const
Definition: RigidBody.cpp:52
RigidBody()=default
Constructor.
Component which all components inherit.
Definition: SuperComponent.hpp:9
Updates the physics of the world.
Definition: PhysicsManager.hpp:28
Definition: BoxShapeEditor.hpp:5
Definition: IShapeEditor.hpp:7