4#ifndef TRAM_SDK_COMPONENTS_PHYSICSCOMPONENT_H
5#define TRAM_SDK_COMPONENTS_PHYSICSCOMPONENT_H
56 Physics::rigidbody_t rigidbody = {
nullptr};
58 float rigidbody_mass = 1.0f;
60 bool rigidbody_should_sleep =
true;
61 bool rigidbody_should_awake =
false;
62 bool update_parent_transform =
true;
63 bool rigidbody_kinematic =
false;
64 bool rigidbody_debug_draw =
true;
66 vec3 rigidbody_position = {0.0f, 0.0f, 0.0f};
67 quat rigidbody_rotation = {1.0f, 0.0f, 0.0f, 0.0f};
69 vec3 rigidbody_offset = {0.0f, 0.0f, 0.0f};
70 vec3 rigidbody_angular_factor = {1.0f, 1.0f, 1.0f};
71 vec3 rigidbody_linear_factor = {1.0f, 1.0f, 1.0f};
73 uint32_t rigidbody_collision_mask = -1;
74 uint32_t rigidbody_collision_group = -1;
Definition: entitycomponent.h:18
void SetRotation(quat rotation)
Sets the rotation of the physics object.
Definition: physics.cpp:254
void SetCollisionMask(uint32_t flags)
Sets the collision mask of the physics object.
Definition: physics.cpp:102
void Push(vec3 direction)
Pushes the physics object.
Definition: physics.cpp:148
void SetShape(Physics::CollisionShape shape)
Sets the collision shape of the physics object.
Definition: physics.cpp:128
void SetUpdateParentTransform(bool update)
Sets whether the movement of the rigibody should update parent Entity's transform.
Definition: physics.cpp:237
void Spin(vec3 direction)
Definition: physics.cpp:165
~PhysicsComponent()
Definition: physics.cpp:64
void SetAngularFactor(vec3 factor)
Sets the angular factor of the physics object.
Definition: physics.cpp:268
void EventHandler(Event &event)
Definition: physics.h:17
void SetLocation(vec3 location)
Sets the position of the physics object.
Definition: physics.cpp:242
vec3 GetVelocity()
Returns the velocity of the physics object.
Definition: physics.cpp:318
void SetCollisionGroup(uint32_t flags)
Sets the collision group of the physics object.
Definition: physics.cpp:117
uint32_t GetCollisionMask()
Returns the collision mask.
Definition: physics.cpp:87
void Start()
Definition: physics.cpp:15
void SetKinematic(bool kinematic)
Sets the physics object to kinematic.
Definition: physics.cpp:217
void SetVelocity(const vec3 &velocity)
Sets the velocity of the physics object.
Definition: physics.cpp:302
void Sleep()
Puts the object to sleep.
Definition: physics.cpp:185
void Awaken()
Awakens the object.
Definition: physics.cpp:175
uint32_t GetCollisionGroup()
Returns the collision group.
Definition: physics.cpp:93
void SetDebugDrawing(bool drawing)
Sets the debug drawing of a physics object.
Definition: physics.cpp:197
void SetLinearFactor(vec3 factor)
Sets the angular factor of the physics object.
Definition: physics.cpp:280
void DisableDeactivation()
Disables deactivation of the object.
Definition: physics.cpp:291
void SetModel(name_t model)
Sets the collision model.
Definition: physics.cpp:81
void SetMass(float mass)
Sets the mass of the physics object.
Definition: physics.cpp:136
PhysicsComponent()
Definition: physics.h:15
name_t GetModel()
Returns the name of the collision model.
Definition: physics.cpp:76
Definition: resource.h:47
glm::vec3 vec3
Definition: math.h:12
glm::quat quat
Definition: math.h:13
Definition: collisionshape.h:25