NDK class that represents a physics point, without any collision.
More...
Inherits Ndk::Component< ComponentType >.
|
static ComponentIndex | componentIndex |
|
|
class | CollisionComponent2D |
|
class | PhysicsSystem2D |
|
NDK class that represents a physics point, without any collision.
◆ PhysicsComponent2D()
◆ AddForce() [1/2]
void Ndk::PhysicsComponent2D::AddForce |
( |
const Nz::Vector2f & |
force, |
|
|
Nz::CoordSys |
coordSys = Nz::CoordSys_Global |
|
) |
| |
|
inline |
Applies a physics force to the entity.
- Parameters
-
force | Force to apply on the entity |
coordSys | System coordinates to consider |
◆ AddForce() [2/2]
void Ndk::PhysicsComponent2D::AddForce |
( |
const Nz::Vector2f & |
force, |
|
|
const Nz::Vector2f & |
point, |
|
|
Nz::CoordSys |
coordSys = Nz::CoordSys_Global |
|
) |
| |
|
inline |
Applies a physics force to the entity.
- Parameters
-
force | Force to apply on the entity |
point | Point where to apply the force |
coordSys | System coordinates to consider |
◆ AddTorque()
void Ndk::PhysicsComponent2D::AddTorque |
( |
float |
torque | ) |
|
|
inline |
Applies a torque to the entity.
- Parameters
-
torque | Torque to apply on the entity |
◆ GetAABB()
Nz::Rectf Ndk::PhysicsComponent2D::GetAABB |
( |
| ) |
const |
|
inline |
Gets the AABB of the physics object.
- Returns
- AABB of the object
◆ GetAngularVelocity()
float Ndk::PhysicsComponent2D::GetAngularVelocity |
( |
| ) |
const |
|
inline |
Gets the angular velocity of the physics object.
- Returns
- Angular velocity of the object
◆ GetCenterOfGravity()
Nz::Vector2f Ndk::PhysicsComponent2D::GetCenterOfGravity |
( |
Nz::CoordSys |
coordSys = Nz::CoordSys_Local | ) |
const |
|
inline |
Gets the gravity center of the physics object.
- Returns
- Gravity center of the object
- Parameters
-
coordSys | System coordinates to consider |
◆ GetMass()
float Ndk::PhysicsComponent2D::GetMass |
( |
| ) |
const |
|
inline |
Gets the mass of the physics object.
- Returns
- Mass of the object
◆ GetPosition()
Gets the position of the physics object.
- Returns
- Position of the object
◆ GetRotation()
float Ndk::PhysicsComponent2D::GetRotation |
( |
| ) |
const |
|
inline |
Gets the rotation of the physics object.
- Returns
- Rotation of the object
◆ GetVelocity()
Gets the velocity of the physics object.
- Returns
- Velocity of the object
◆ IsSleeping()
bool Ndk::PhysicsComponent2D::IsSleeping |
( |
| ) |
const |
|
inline |
Checks whether the entity is currently sleeping.
- Returns
- true If it is the case
◆ SetAngularVelocity()
void Ndk::PhysicsComponent2D::SetAngularVelocity |
( |
float |
angularVelocity | ) |
|
|
inline |
Sets the angular velocity of the physics object.
- Parameters
-
angularVelocity | Angular velocity of the object |
◆ SetMass()
void Ndk::PhysicsComponent2D::SetMass |
( |
float |
mass | ) |
|
|
inline |
Sets the mass of the physics object.
- Parameters
-
◆ SetMassCenter()
void Ndk::PhysicsComponent2D::SetMassCenter |
( |
const Nz::Vector2f & |
center | ) |
|
|
inline |
Sets the gravity center of the physics object.
- Parameters
-
center | Gravity center of the object |
◆ SetPosition()
void Ndk::PhysicsComponent2D::SetPosition |
( |
const Nz::Vector2f & |
position | ) |
|
|
inline |
Sets the position of the physics object.
- Parameters
-
position | Position of the object |
◆ SetRotation()
void Ndk::PhysicsComponent2D::SetRotation |
( |
float |
rotation | ) |
|
|
inline |
Sets the rotation of the physics object.
- Parameters
-
rotation | Rotation of the object |
◆ SetVelocity()
void Ndk::PhysicsComponent2D::SetVelocity |
( |
const Nz::Vector2f & |
velocity | ) |
|
|
inline |
Sets the velocity of the physics object.
- Parameters
-
velocity | Velocity of the object |
The documentation for this class was generated from the following files:
- SDK/include/NDK/Components/PhysicsComponent2D.hpp
- SDK/include/NDK/Components/PhysicsComponent2D.inl
- SDK/src/NDK/Components/PhysicsComponent2D.cpp