#include <types.hpp>
|
| | RigidBodyComponent ()=default |
| | default RigidBodyComponent constructor
|
| |
| | RigidBodyComponent (phys2d::BodyType bt) |
| | RigidBodyComponent c-tor that uses only BodyType parameter, other fields are set by default.
|
| |
| | RigidBodyComponent (BodyType bt, const glm::vec2 &linearVelocity, const glm::vec2 &force, float gravityScale, float angularVelocity, float torque, float mass, float inertia, float linearDamping, float angularDamping, float restitution, float friction) |
| | RigidBody c-tor, requires all fields to be customly set.
|
| |
|
| BodyType | bodyType = BodyType::Dynamic |
| | bodyType: Static, Kinematic or Dynamic
|
| |
| glm::vec2 | linearVelocity {0.0f, 0.0f} |
| | velocity along some axis
|
| |
| glm::vec2 | force {0.0f, 0.0f} |
| | force: two-dimensional vector
|
| |
| float | gravityScale = rb_defaultGravityScale |
| | gravity scale, 1 by default
|
| |
| float | angularVelocity = 0.0f |
| | angular velocity, in radians clockwise
|
| |
| float | torque = 0.0f |
| | torque, in radians clockwise
|
| |
| float | invMass |
| | inverted mass coefficient, used for calculating linear acceleration
|
| |
| float | invInertia = rb_defaultInvInertia |
| |
| float | linearDamping = rb_defaultDamping |
| | linear damping of the object, from 0 to 1
|
| |
| float | angularDamping = rb_defaultDamping |
| | angular damping of the object, from 0 to 1
|
| |
| float | restitution = rb_defaultRestitution |
| | restitution of the object, 0.5 by default
|
| |
| float | friction = rb_defaultFriction |
| | friction of the object, 0.2 by default
|
| |
◆ RigidBodyComponent() [1/3]
| phys2d::RigidBodyComponent::RigidBodyComponent |
( |
| ) |
|
|
default |
◆ RigidBodyComponent() [2/3]
RigidBodyComponent c-tor that uses only BodyType parameter, other fields are set by default.
- Parameters
-
| bt | BodyType value, Static, Kinematic or Dynamic |
◆ RigidBodyComponent() [3/3]
| phys2d::RigidBodyComponent::RigidBodyComponent |
( |
BodyType |
bt, |
|
|
const glm::vec2 & |
linearVelocity, |
|
|
const glm::vec2 & |
force, |
|
|
float |
gravityScale, |
|
|
float |
angularVelocity, |
|
|
float |
torque, |
|
|
float |
mass, |
|
|
float |
inertia, |
|
|
float |
linearDamping, |
|
|
float |
angularDamping, |
|
|
float |
restitution, |
|
|
float |
friction |
|
) |
| |
RigidBody c-tor, requires all fields to be customly set.
- Parameters
-
| bt | BodyType of the object: Static/Kinematic/Dynamic |
| linearVelocity | velocity along some axis |
| force | force: two-dimensional vector |
| gravityScale | gravity scale, 1 by default |
| angularVelocity | angular velocity, in radians clockwise |
| torque | torque, in radians, clockwise |
| mass | mass of the object |
| inertia | inertia of the object, in radians, clockwise |
| linearDamping | damping, coefficient from 0 to 1 |
| angularDamping | angularDamping, coefficient from 0 to 1 |
| restitiution | physical restitution, 0.5 by default |
| friction | physical friction, 0.2 by default |
◆ angularDamping
angular damping of the object, from 0 to 1
◆ angularVelocity
| float phys2d::RigidBodyComponent::angularVelocity = 0.0f |
angular velocity, in radians clockwise
◆ bodyType
bodyType: Static, Kinematic or Dynamic
◆ force
| glm::vec2 phys2d::RigidBodyComponent::force {0.0f, 0.0f} |
force: two-dimensional vector
◆ friction
friction of the object, 0.2 by default
◆ gravityScale
gravity scale, 1 by default
◆ invInertia
inverted inertia, used for calculating angular acceleration, in radians clockwise
◆ invMass
| float phys2d::RigidBodyComponent::invMass |
Initial value:=
constexpr float rb_defaultInvMass
Definition types.hpp:21
inverted mass coefficient, used for calculating linear acceleration
◆ linearDamping
linear damping of the object, from 0 to 1
◆ linearVelocity
| glm::vec2 phys2d::RigidBodyComponent::linearVelocity {0.0f, 0.0f} |
◆ restitution
restitution of the object, 0.5 by default
◆ torque
| float phys2d::RigidBodyComponent::torque = 0.0f |
torque, in radians clockwise
The documentation for this struct was generated from the following file:
- /home/runner/work/Cheese-Engine/Cheese-Engine/inc/types.hpp