Xors3d Engine
Parameters

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.

Function Documentation

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.

Parameters:
entityEntity handle
linearThe coefficient of the linear damping
angularThe coefficient of the angular damping
float xEntityGetLinearDamping ( Entity *  entity)

Returns the coefficient of the linear damping of the entity's body.

Parameters:
entityEntity handle
float xEntityGetAngularDamping ( Entity *  entity)

Returns the coefficient of the angular damping of the entity's body.

Parameters:
entityEntity handle
void xEntitySetFriction ( Entity *  entity,
float  friction 
)

Sets a friction coefficient of the entity's body.

Default value of the friction is 0.5.

Parameters:
entityEntity handle
frictionThe coefficient of the friction
float xEntityGetFriction ( Entity *  entity)

Returns a friction coefficient of the entity's body.

Parameters:
entityEntity 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).

Parameters:
entityEntity handle
fxThe coefficient of the friction for the X axis
fyThe coefficient of the friction for the Y axis
fzThe 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.

Parameters:
entityEntity handle
float xEntityGetAnisotropicFrictionY ( Entity *  entity)

Returns an anisotropic friction coefficient of the entity's body for Y axis.

Parameters:
entityEntity handle
float xEntityGetAnisotropicFrictionZ ( Entity *  entity)

Returns an anisotropic friction coefficient of the entity's body for Z axis.

Parameters:
entityEntity 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).

Parameters:
entityEntity handle
xThe linear factor along the X axis
yThe linear factor along the Y axis
zThe linear factor along the Z axis
float xEntityGetLinearFactorX ( Entity *  entity)

Returns the linear factor of the entity's body along the X axis.

Parameters:
entityEntity handle
float xEntityGetLinearFactorY ( Entity *  entity)

Returns the linear factor of the entity's body along the Y axis.

Parameters:
entityEntity handle
float xEntityGetLinearFactorZ ( Entity *  entity)

Returns the linear factor of the entity's body along the Z axis.

Parameters:
entityEntity 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).

Parameters:
entityEntity handle
xThe angular factor around the X axis
yThe angular factor around the Y axis
zThe angular factor around the Z axis
float xEntityGetAngularFactorX ( Entity *  entity)

Returns the angular factor of the entity's body around the X axis.

Parameters:
entityEntity handle
float xEntityGetAngularFactorY ( Entity *  entity)

Returns the angular factor of the entity's body around the Y axis.

Parameters:
entityEntity handle
float xEntityGetAngularFactorZ ( Entity *  entity)

Returns the angular factor of the entity's body around the Z axis.

Parameters:
entityEntity 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).

Parameters:
entityEntity handle
restitutionThe coefficient of the restitution.
float xEntityGetRestitution ( Entity *  entity)

Returns the restitution of the entity's body.

Parameters:
entityEntity handle
void xEntitySetMass ( Entity *  entity,
float  mass 
)

Sets a new mass of the entity's body.

Parameters:
entityEntity handle
massMass
float xEntityGetMass ( Entity *  entity)

Returns a mass of the entity's body.

Parameters:
entityEntity handle