![]() |
Xors3d Engine
|
Functions | |
float | xEntityGetAngularDamping (Entity *entity) |
Returns the coefficient of the angular damping of the entity's body. | |
float | xEntityGetAngularFactorX (Entity *entity) |
Returns the angular factor of the entity's body around the X axis. | |
float | xEntityGetAngularFactorY (Entity *entity) |
Returns the angular factor of the entity's body around the Y axis. | |
float | xEntityGetAngularFactorZ (Entity *entity) |
Returns the angular factor of the entity's body around the Z axis. | |
float | xEntityGetAnisotropicFrictionX (Entity *entity) |
Returns an anisotropic friction coefficient of the entity's body for X axis. | |
float | xEntityGetAnisotropicFrictionY (Entity *entity) |
Returns an anisotropic friction coefficient of the entity's body for Y axis. | |
float | xEntityGetAnisotropicFrictionZ (Entity *entity) |
Returns an anisotropic friction coefficient of the entity's body for Z axis. | |
float | xEntityGetFriction (Entity *entity) |
Returns a friction coefficient of the entity's body. | |
float | xEntityGetLinearDamping (Entity *entity) |
Returns the coefficient of the linear damping of the entity's body. | |
float | xEntityGetLinearFactorX (Entity *entity) |
Returns the linear factor of the entity's body along the X axis. | |
float | xEntityGetLinearFactorY (Entity *entity) |
Returns the linear factor of the entity's body along the Y axis. | |
float | xEntityGetLinearFactorZ (Entity *entity) |
Returns the linear factor of the entity's body along the Z axis. | |
float | xEntityGetMass (Entity *entity) |
Returns a mass of the entity's body. | |
float | xEntityGetRestitution (Entity *entity) |
Returns the restitution of the entity's body. | |
void | xEntitySetAngularFactor (Entity *entity, float x, float y, float z) |
Sets the angular factor of the entity's body. | |
void | xEntitySetAnisotropicFriction (Entity *entity, float fx, float fy, float fz) |
Sets an anisotropic friction coefficient of the entity's body. | |
void | xEntitySetDamping (Entity *entity, float linear, float angular) |
Sets the linear and angular damping of the entity's body. | |
void | xEntitySetFriction (Entity *entity, float friction) |
Sets a friction coefficient of the entity's body. | |
void | xEntitySetLinearFactor (Entity *entity, float x, float y, float z) |
Sets the linear factor of the entity's body. | |
void | xEntitySetMass (Entity *entity, float mass) |
Sets a new mass of the entity's body. | |
void | xEntitySetRestitution (Entity *entity, float restitution) |
Sets the restitution of the entity's body. |
void xEntitySetDamping | ( | Entity * | entity, |
float | linear, | ||
float | angular | ||
) |
Sets the linear and angular damping of the entity's body.
The values of linear and angular damping are clamped to [0.0; 1.0].
Default values of the linear and angular damping are 0.
entity | Entity handle |
linear | The coefficient of the linear damping |
angular | The coefficient of the angular damping |
float xEntityGetLinearDamping | ( | Entity * | entity | ) |
Returns the coefficient of the linear damping of the entity's body.
entity | Entity handle |
float xEntityGetAngularDamping | ( | Entity * | entity | ) |
Returns the coefficient of the angular damping of the entity's body.
entity | Entity handle |
void xEntitySetFriction | ( | Entity * | entity, |
float | friction | ||
) |
Sets a friction coefficient of the entity's body.
Default value of the friction is 0.5.
entity | Entity handle |
friction | The coefficient of the friction |
float xEntityGetFriction | ( | Entity * | entity | ) |
Returns a friction coefficient of the entity's body.
entity | Entity handle |
void xEntitySetAnisotropicFriction | ( | Entity * | entity, |
float | fx, | ||
float | fy, | ||
float | fz | ||
) |
Sets an anisotropic friction coefficient of the entity's body.
Anisotropic frisction has different values for different directions. Default value of the friction is (0.5; 0.5; 0.5).
entity | Entity handle |
fx | The coefficient of the friction for the X axis |
fy | The coefficient of the friction for the Y axis |
fz | The coefficient of the friction for the Z axis |
float xEntityGetAnisotropicFrictionX | ( | Entity * | entity | ) |
Returns an anisotropic friction coefficient of the entity's body for X axis.
entity | Entity handle |
float xEntityGetAnisotropicFrictionY | ( | Entity * | entity | ) |
Returns an anisotropic friction coefficient of the entity's body for Y axis.
entity | Entity handle |
float xEntityGetAnisotropicFrictionZ | ( | Entity * | entity | ) |
Returns an anisotropic friction coefficient of the entity's body for Z axis.
entity | Entity handle |
void xEntitySetLinearFactor | ( | Entity * | entity, |
float | x, | ||
float | y, | ||
float | z | ||
) |
Sets the linear factor of the entity's body.
This could be useful for locking the motion along one or more world axis. For instance. If you're making a 2d game it would be useful to lock the motion in the XY plane and allow rotation around the Z axis. It could be done in a such way: xEntityLinearFactor(ent, 1.0, 1.0, 0.0); xEntityAngularFactor(ent, 0.0, 0.0, 1.0);
Default value is (1.0, 1.0, 1.0).
entity | Entity handle |
x | The linear factor along the X axis |
y | The linear factor along the Y axis |
z | The linear factor along the Z axis |
float xEntityGetLinearFactorX | ( | Entity * | entity | ) |
Returns the linear factor of the entity's body along the X axis.
entity | Entity handle |
float xEntityGetLinearFactorY | ( | Entity * | entity | ) |
Returns the linear factor of the entity's body along the Y axis.
entity | Entity handle |
float xEntityGetLinearFactorZ | ( | Entity * | entity | ) |
Returns the linear factor of the entity's body along the Z axis.
entity | Entity handle |
void xEntitySetAngularFactor | ( | Entity * | entity, |
float | x, | ||
float | y, | ||
float | z | ||
) |
Sets the angular factor of the entity's body.
This could be useful for locking the rotation around one or more world axis. For instance. If you're making a 2d game it would be useful to lock the motion in the XY plane and allow rotation around the Z axis. It could be done in a such way: xEntityLinearFactor(ent, 1.0, 1.0, 0.0); xEntityAngularFactor(ent, 0.0, 0.0, 1.0);
Default value is (1.0, 1.0, 1.0).
entity | Entity handle |
x | The angular factor around the X axis |
y | The angular factor around the Y axis |
z | The angular factor around the Z axis |
float xEntityGetAngularFactorX | ( | Entity * | entity | ) |
Returns the angular factor of the entity's body around the X axis.
entity | Entity handle |
float xEntityGetAngularFactorY | ( | Entity * | entity | ) |
Returns the angular factor of the entity's body around the Y axis.
entity | Entity handle |
float xEntityGetAngularFactorZ | ( | Entity * | entity | ) |
Returns the angular factor of the entity's body around the Z axis.
entity | Entity handle |
void xEntitySetRestitution | ( | Entity * | entity, |
float | restitution | ||
) |
Sets the restitution of the entity's body.
. The default value of restitution is 0.0.
If a restitution of the first object is 1.0 and a restitution of the second one is 0.0 then their resulting restitution is 0.0 (product).
Normally restitution changes from 0.0 to 1.0. However you may experiment with unnatural values.
0.0 means inelastic collision (no bounce). 1.0 means elastic collision (no enegry lost).
entity | Entity handle |
restitution | The coefficient of the restitution. |
float xEntityGetRestitution | ( | Entity * | entity | ) |
Returns the restitution of the entity's body.
entity | Entity handle |
void xEntitySetMass | ( | Entity * | entity, |
float | mass | ||
) |
Sets a new mass of the entity's body.
entity | Entity handle |
mass | Mass |
float xEntityGetMass | ( | Entity * | entity | ) |
Returns a mass of the entity's body.
entity | Entity handle |