Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Ndk::PhysicsComponent3D Class Reference

NDK class that represents the component for physics (meant for dynamic objects) More...

Inherits Ndk::Component< ComponentType >.

Public Member Functions

 PhysicsComponent3D (const PhysicsComponent3D &physics)
 Constructs a PhysicsComponent3D object by copy semantic. More...
 
void AddForce (const Nz::Vector3f &force, Nz::CoordSys coordSys=Nz::CoordSys_Global)
 Applies a force to the entity. More...
 
void AddForce (const Nz::Vector3f &force, const Nz::Vector3f &point, Nz::CoordSys coordSys=Nz::CoordSys_Global)
 Applies a force to the entity. More...
 
void AddTorque (const Nz::Vector3f &torque, Nz::CoordSys coordSys=Nz::CoordSys_Global)
 Applies a torque to the entity. More...
 
void EnableAutoSleep (bool autoSleep)
 Enables auto sleep of physics object. More...
 
Nz::Boxf GetAABB () const
 Gets the AABB of the physics object. More...
 
Nz::Vector3f GetAngularVelocity () const
 Gets the angular velocity of the physics object. More...
 
float GetGravityFactor () const
 Gets the gravity factor of the physics object. More...
 
float GetMass () const
 Gets the mass of the physics object. More...
 
Nz::Vector3f GetMassCenter (Nz::CoordSys coordSys=Nz::CoordSys_Local) const
 Gets the gravity center of the physics object. More...
 
const Nz::Matrix4fGetMatrix () const
 Gets the matrix of the physics object. More...
 
Nz::Vector3f GetPosition () const
 Gets the position of the physics object. More...
 
Nz::Quaternionf GetRotation () const
 Gets the rotation of the physics object. More...
 
Nz::Vector3f GetVelocity () const
 Gets the velocity of the physics object. More...
 
bool IsAutoSleepEnabled () const
 Checks whether the auto sleep is enabled. More...
 
bool IsMoveable () const
 
bool IsSleeping () const
 Checks whether the entity is currently sleeping. More...
 
void SetAngularVelocity (const Nz::Vector3f &angularVelocity)
 Sets the angular velocity of the physics object. More...
 
void SetGravityFactor (float gravityFactor)
 Sets the gravity factor of the physics object. More...
 
void SetMass (float mass)
 Sets the mass of the physics object. More...
 
void SetMassCenter (const Nz::Vector3f &center)
 Sets the gravity center of the physics object. More...
 
void SetPosition (const Nz::Vector3f &position)
 Sets the position of the physics object. More...
 
void SetRotation (const Nz::Quaternionf &rotation)
 Sets the rotation of the physics object. More...
 
void SetVelocity (const Nz::Vector3f &velocity)
 Sets the velocity of the physics object. More...
 

Static Public Attributes

static ComponentIndex componentIndex
 

Friends

class CollisionComponent3D
 
class PhysicsSystem3D
 

Detailed Description

NDK class that represents the component for physics (meant for dynamic objects)

Constructor & Destructor Documentation

◆ PhysicsComponent3D()

Ndk::PhysicsComponent3D::PhysicsComponent3D ( const PhysicsComponent3D physics)
inline

Constructs a PhysicsComponent3D object by copy semantic.

Parameters
physicsPhysicsComponent3D to copy

Member Function Documentation

◆ AddForce() [1/2]

void Ndk::PhysicsComponent3D::AddForce ( const Nz::Vector3f force,
Nz::CoordSys  coordSys = Nz::CoordSys_Global 
)
inline

Applies a force to the entity.

Parameters
forceForce to apply on the entity
coordSysSystem coordinates to consider
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ AddForce() [2/2]

void Ndk::PhysicsComponent3D::AddForce ( const Nz::Vector3f force,
const Nz::Vector3f point,
Nz::CoordSys  coordSys = Nz::CoordSys_Global 
)
inline

Applies a force to the entity.

Parameters
forceForce to apply on the entity
pointPoint where to apply the force
coordSysSystem coordinates to consider
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ AddTorque()

void Ndk::PhysicsComponent3D::AddTorque ( const Nz::Vector3f torque,
Nz::CoordSys  coordSys = Nz::CoordSys_Global 
)
inline

Applies a torque to the entity.

Parameters
torqueTorque to apply on the entity
coordSysSystem coordinates to consider
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ EnableAutoSleep()

void Ndk::PhysicsComponent3D::EnableAutoSleep ( bool  autoSleep)
inline

Enables auto sleep of physics object.

Parameters
autoSleepShould the physics of the object be disabled when too far from others
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ GetAABB()

Nz::Boxf Ndk::PhysicsComponent3D::GetAABB ( ) const
inline

Gets the AABB of the physics object.

Returns
AABB of the object
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ GetAngularVelocity()

Nz::Vector3f Ndk::PhysicsComponent3D::GetAngularVelocity ( ) const
inline

Gets the angular velocity of the physics object.

Returns
Angular velocity of the object
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ GetGravityFactor()

float Ndk::PhysicsComponent3D::GetGravityFactor ( ) const
inline

Gets the gravity factor of the physics object.

Returns
Gravity factor of the object
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ GetMass()

float Ndk::PhysicsComponent3D::GetMass ( ) const
inline

Gets the mass of the physics object.

Returns
Mass of the object
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ GetMassCenter()

Nz::Vector3f Ndk::PhysicsComponent3D::GetMassCenter ( Nz::CoordSys  coordSys = Nz::CoordSys_Local) const
inline

Gets the gravity center of the physics object.

Returns
Gravity center of the object
Parameters
coordSysSystem coordinates to consider
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ GetMatrix()

const Nz::Matrix4f & Ndk::PhysicsComponent3D::GetMatrix ( ) const
inline

Gets the matrix of the physics object.

Returns
Matrix of the object
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ GetPosition()

Nz::Vector3f Ndk::PhysicsComponent3D::GetPosition ( ) const
inline

Gets the position of the physics object.

Returns
Position of the object
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ GetRotation()

Nz::Quaternionf Ndk::PhysicsComponent3D::GetRotation ( ) const
inline

Gets the rotation of the physics object.

Returns
Rotation of the object
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ GetVelocity()

Nz::Vector3f Ndk::PhysicsComponent3D::GetVelocity ( ) const
inline

Gets the velocity of the physics object.

Returns
Velocity of the object
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ IsAutoSleepEnabled()

bool Ndk::PhysicsComponent3D::IsAutoSleepEnabled ( ) const
inline

Checks whether the auto sleep is enabled.

Returns
true If it is the case
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ IsSleeping()

bool Ndk::PhysicsComponent3D::IsSleeping ( ) const
inline

Checks whether the entity is currently sleeping.

Returns
true If it is the case
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ SetAngularVelocity()

void Ndk::PhysicsComponent3D::SetAngularVelocity ( const Nz::Vector3f angularVelocity)
inline

Sets the angular velocity of the physics object.

Parameters
angularVelocityAngular velocity of the object
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ SetGravityFactor()

void Ndk::PhysicsComponent3D::SetGravityFactor ( float  gravityFactor)
inline

Sets the gravity factor of the physics object.

Parameters
gravityFactorGravity factor of the object
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ SetMass()

void Ndk::PhysicsComponent3D::SetMass ( float  mass)
inline

Sets the mass of the physics object.

Parameters
massMass of the object
Remarks
Produces a NazaraAssert if the physics object is invalid
Produces a NazaraAssert if the mass is negative

◆ SetMassCenter()

void Ndk::PhysicsComponent3D::SetMassCenter ( const Nz::Vector3f center)
inline

Sets the gravity center of the physics object.

Parameters
centerGravity center of the object
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ SetPosition()

void Ndk::PhysicsComponent3D::SetPosition ( const Nz::Vector3f position)
inline

Sets the position of the physics object.

Parameters
positionPosition of the object
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ SetRotation()

void Ndk::PhysicsComponent3D::SetRotation ( const Nz::Quaternionf rotation)
inline

Sets the rotation of the physics object.

Parameters
rotationRotation of the object
Remarks
Produces a NazaraAssert if the physics object is invalid

◆ SetVelocity()

void Ndk::PhysicsComponent3D::SetVelocity ( const Nz::Vector3f velocity)
inline

Sets the velocity of the physics object.

Parameters
velocityVelocity of the object
Remarks
Produces a NazaraAssert if the physics object is invalid

The documentation for this class was generated from the following files: