Xors3d Engine
Entity state

Functions

BBDECL int BBCALL xCountChildren (Entity *entity)
 Returns the number of children of an entity.
BBDECL float BBCALL xDeltaPitch (Entity *entity1, Entity *entity2)
 Returns the pitch angle, that first entity should be rotated by in order to face second.
BBDECL float BBCALL xDeltaYaw (Entity *entity1, Entity *entity2)
 Returns the yaw angle, that first entity should be rotated by in order to face second.
BBDECL int BBCALL xEntitiesBBIntersect (Entity *entity1, Entity *entity2)
 Returns true if the specified meshes bounding boxes are currently intersecting.
BBDECL int BBCALL xEntityBlue (Entity *entity)
 Returns blue value of entitys color.
BBDECL const char *BBCALL xEntityClass (Entity *entity)
 Returns a string containing the class of the given entity.
BBDECL float BBCALL xEntityDistance (Entity *entity1, Entity *entity2)
 Returns the distance between two entities.
BBDECL int BBCALL xEntityGreen (Entity *entity)
 Returns green value of entitys color.
BBDECL int BBCALL xEntityHidden (Entity *entity)
 Returns true if entity was hidden by the xHideEntity() function and false otherwise.
BBDECL const char *BBCALL xEntityName (Entity *entity)
 Returns the name of an entity. An entity's name may be set in a modelling program, or manually set using xNameEntity()
BBDECL Entity *BBCALL xEntityPick (Entity *entity, float range=0.0f)
 Returns the nearest entity 'ahead' of the specified entity.
BBDECL float BBCALL xEntityPitch (Entity *entity, bool isGlobal=false)
 Returns the pitch angle of an entity.
BBDECL int BBCALL xEntityRed (Entity *entity)
 Returns red value of entitys color.
BBDECL float BBCALL xEntityRoll (Entity *entity, bool isGlobal=false)
 Returns the roll angle of an entity.
BBDECL float BBCALL xEntityScaleX (Entity *entity)
 Returns x-axis scale of entity.
BBDECL float BBCALL xEntityScaleY (Entity *entity)
 Returns y-axis scale of entity.
BBDECL float BBCALL xEntityScaleZ (Entity *entity)
 Returns z-axis scale of entity.
BBDECL int BBCALL xEntityVisible (Entity *entity, Entity *destination)
 Returns true if entities can see each other.
BBDECL float BBCALL xEntityX (Entity *entity, bool isGlobal=false)
 Returns x-coordinate of the entity.
BBDECL float BBCALL xEntityY (Entity *entity, bool isGlobal=false)
 Returns y-coordinate of the entity.
BBDECL float BBCALL xEntityYaw (Entity *entity, bool isGlobal=false)
 Returns the yaw angle of an entity.
BBDECL float BBCALL xEntityZ (Entity *entity, bool isGlobal=false)
 Returns z-coordinate of the entity.
BBDECL Entity *BBCALL xFindChild (Entity *entity, const char *name)
 Returns the first child of the specified entity with matching name.
BBDECL int BBCALL xGetAlphaFunc (Entity *entity)
 Returns an entity's alpha testing function.
BBDECL int BBCALL xGetAlphaRef (Entity *entity)
 Returns an entity's alpha testing reference.
BBDECL Entity *BBCALL xGetChild (Entity *entity, int index)
 Returns a child of an entity.
BBDECL float BBCALL xGetEntityAlpha (Entity *entity)
 Returns an entity's alpha value.
BBDECL int BBCALL xGetEntityBlend (Entity *entity)
 Returns entitys blend mode.
BBDECL Brush *BBCALL xGetEntityBrush (Entity *entity)
 Returns an entity's brush.
BBDECL int BBCALL xGetEntityFX (Entity *entity)
 Returns entitys FX flags.
BBDECL D3DXMATRIX *BBCALL xGetEntityMatrix (Entity *entity)
 Returns a pointer entity's world matrix.
BBDECL float BBCALL xGetEntityShininess (Entity *entity)
 Returns entitys shininess value.
BBDECL int BBCALL xGetEntityType (Entity *entity)
 Returns entity collision type.
BBDECL float BBCALL xGetMatElement (Entity *entity, int row, int col)
 Returns the value of an element from within an entity's world matrix.
BBDECL Entity *BBCALL xGetParent (Entity *entity)
 Returns a parent of an entity.
BBDECL Entity *BBCALL xLinePick (float x, float y, float z, float dx, float dy, float dz, float distance=0.0f)
 Returns the first entity between x, y, z to dx, dy, dz.

Function Documentation

BBDECL int BBCALL xGetEntityType ( Entity *  entity)

Returns entity collision type.

Parameters:
entityEntity handle
BBDECL Entity* BBCALL xGetParent ( Entity *  entity)

Returns a parent of an entity.

Parameters:
entityEntity handle
BBDECL float BBCALL xEntityDistance ( Entity *  entity1,
Entity *  entity2 
)

Returns the distance between two entities.

Parameters:
entity1First entity handle
entity2Second entity handle
BBDECL float BBCALL xGetMatElement ( Entity *  entity,
int  row,
int  col 
)

Returns the value of an element from within an entity's world matrix.

Parameters:
entityEntity handle
rowMatrix row index
colMatrix cell index
BBDECL const char* BBCALL xEntityClass ( Entity *  entity)

Returns a string containing the class of the given entity.

Parameters:
entityEntity handle
BBDECL Brush* BBCALL xGetEntityBrush ( Entity *  entity)

Returns an entity's brush.

Remember, xGetSurfaceBrush() actually creates a new brush so don't forget to free it afterwards using xFreeBrush() to prevent memory leaks. Once you have got the brush handle from a surface, you can use xGetBrushTexture() and xTextureName() to get the details of what texture(s) are applied to the brush.

Parameters:
entityEntity handle
BBDECL float BBCALL xEntityX ( Entity *  entity,
bool  isGlobal = false 
)

Returns x-coordinate of the entity.

If the 'isGlobal' flag is set to ffalse then the parent's local coordinate system is used. NOTE: If the entity has no parent then local and global coordinates are the same. In this case you can think of the 3d world as the parent. Global coordinates refer to the 3d world. Xors3D uses a left-handed system:

X+ is to the right

Y+ is up

Z+ is forward (into the screen)

Every entity also has its own ;ocal coordinate system. The global system never changes. But the local system is carried along as an entity moves and turns.

Parameters:
entityEntity handle
isGlobalTrue for global coordinates, false for local
BBDECL float BBCALL xEntityY ( Entity *  entity,
bool  isGlobal = false 
)

Returns y-coordinate of the entity.

If the 'isGlobal' flag is set to ffalse then the parent's local coordinate system is used. NOTE: If the entity has no parent then local and global coordinates are the same. In this case you can think of the 3d world as the parent. Global coordinates refer to the 3d world. Xors3D uses a left-handed system:

X+ is to the right

Y+ is up

Z+ is forward (into the screen)

Every entity also has its own ;ocal coordinate system. The global system never changes. But the local system is carried along as an entity moves and turns.

Parameters:
entityEntity handle
isGlobalTrue for global coordinates, false for local
BBDECL float BBCALL xEntityZ ( Entity *  entity,
bool  isGlobal = false 
)

Returns z-coordinate of the entity.

If the 'isGlobal' flag is set to ffalse then the parent's local coordinate system is used. NOTE: If the entity has no parent then local and global coordinates are the same. In this case you can think of the 3d world as the parent. Global coordinates refer to the 3d world. Xors3D uses a left-handed system:

X+ is to the right

Y+ is up

Z+ is forward (into the screen)

Every entity also has its own ;ocal coordinate system. The global system never changes. But the local system is carried along as an entity moves and turns.

Parameters:
entityEntity handle
isGlobalTrue for global coordinates, false for local
BBDECL int BBCALL xEntityVisible ( Entity *  entity,
Entity *  destination 
)

Returns true if entities can see each other.

Parameters:
entitySource entity handle
destinationDestination entity handle
BBDECL float BBCALL xEntityScaleX ( Entity *  entity)

Returns x-axis scale of entity.

Parameters:
entityEntity to be checked
See also:
xScaleEntity()
BBDECL float BBCALL xEntityScaleY ( Entity *  entity)

Returns y-axis scale of entity.

Parameters:
entityEntity to be checked
See also:
xScaleEntity()
BBDECL float BBCALL xEntityScaleZ ( Entity *  entity)

Returns z-axis scale of entity.

Parameters:
entityEntity to be checked
See also:
xScaleEntity()
BBDECL float BBCALL xEntityRoll ( Entity *  entity,
bool  isGlobal = false 
)

Returns the roll angle of an entity.

Parameters:
entityEntity handle
isGlobalTrue if the roll angle returned should be relative to 0 rather than a parent entity's roll angle
BBDECL float BBCALL xEntityYaw ( Entity *  entity,
bool  isGlobal = false 
)

Returns the yaw angle of an entity.

Parameters:
entityEntity handle
isGlobalTrue if the yaw angle returned should be relative to 0 rather than a parent entity's yaw angle
BBDECL float BBCALL xEntityPitch ( Entity *  entity,
bool  isGlobal = false 
)

Returns the pitch angle of an entity.

Parameters:
entityEntity handle
isGlobalTrue if the pitch angle returned should be relative to 0 rather than a parent entity's pitch angle
BBDECL const char* BBCALL xEntityName ( Entity *  entity)

Returns the name of an entity. An entity's name may be set in a modelling program, or manually set using xNameEntity()

Parameters:
entityEntity handle
BBDECL int BBCALL xCountChildren ( Entity *  entity)

Returns the number of children of an entity.

Parameters:
entityEntity handle
BBDECL Entity* BBCALL xGetChild ( Entity *  entity,
int  index 
)

Returns a child of an entity.

Parameters:
entityEntity handle
indexIndex of child entity. Should be in the range [0; xCountChildren(entity) - 1]
BBDECL Entity* BBCALL xFindChild ( Entity *  entity,
const char *  name 
)

Returns the first child of the specified entity with matching name.

Parameters:
entityEntity handle
nameChild name to find within entity
BBDECL D3DXMATRIX* BBCALL xGetEntityMatrix ( Entity *  entity)

Returns a pointer entity's world matrix.

Parameters:
entityEntity handle
BBDECL float BBCALL xGetEntityAlpha ( Entity *  entity)

Returns an entity's alpha value.

Parameters:
entityEntity handle
BBDECL int BBCALL xGetAlphaRef ( Entity *  entity)

Returns an entity's alpha testing reference.

Parameters:
entityEntity handle
BBDECL int BBCALL xGetAlphaFunc ( Entity *  entity)

Returns an entity's alpha testing function.

Parameters:
entityEntity handle
BBDECL int BBCALL xEntityRed ( Entity *  entity)

Returns red value of entitys color.

Parameters:
entityEntity handle
BBDECL int BBCALL xEntityGreen ( Entity *  entity)

Returns green value of entitys color.

Parameters:
entityEntity handle
BBDECL int BBCALL xEntityBlue ( Entity *  entity)

Returns blue value of entitys color.

Parameters:
entityEntity handle
BBDECL float BBCALL xGetEntityShininess ( Entity *  entity)

Returns entitys shininess value.

Parameters:
entityEntity handle
BBDECL int BBCALL xGetEntityBlend ( Entity *  entity)

Returns entitys blend mode.

Parameters:
entityEntity handle
BBDECL int BBCALL xGetEntityFX ( Entity *  entity)

Returns entitys FX flags.

Parameters:
entityEntity handle
BBDECL int BBCALL xEntityHidden ( Entity *  entity)

Returns true if entity was hidden by the xHideEntity() function and false otherwise.

Parameters:
entityEntity handle
BBDECL int BBCALL xEntitiesBBIntersect ( Entity *  entity1,
Entity *  entity2 
)

Returns true if the specified meshes bounding boxes are currently intersecting.

Parameters:
entity1First entity handle
entity2Second entity handle
BBDECL Entity* BBCALL xLinePick ( float  x,
float  y,
float  z,
float  dx,
float  dy,
float  dz,
float  distance = 0.0f 
)

Returns the first entity between x, y, z to dx, dy, dz.

Parameters:
xx coordinate of start of line pick
yy coordinate of start of line pick
zz coordinate of start of line pick
dxx coordinate of end of line pick
dyy coordinate of end of line pick
dzz coordinate of end of line pick
distanceRadius of line pick
BBDECL Entity* BBCALL xEntityPick ( Entity *  entity,
float  range = 0.0f 
)

Returns the nearest entity 'ahead' of the specified entity.

An entity must have a non-zero xEntityPickMode() to be pickable.

Parameters:
entityEntity handle
rangeRange of pick area around entity
BBDECL float BBCALL xDeltaPitch ( Entity *  entity1,
Entity *  entity2 
)

Returns the pitch angle, that first entity should be rotated by in order to face second.

This command can be used to be point one entity at another, rotating on the x axis only

Parameters:
entity1First entity handle
entity2Second entity handle
BBDECL float BBCALL xDeltaYaw ( Entity *  entity1,
Entity *  entity2 
)

Returns the yaw angle, that first entity should be rotated by in order to face second.

This command can be used to be point one entity at another, rotating on the y axis only

Parameters:
entity1First entity handle
entity2Second entity handle