Xors3d Engine
Entity state

Functions

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

int xGetEntityType ( Entity *  entity)

Returns entity collision type.

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

Returns a parent of an entity.

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

Returns the distance between two entities.

Parameters:
entity1First entity handle
entity2Second entity handle
float 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
const char* xEntityClass ( Entity *  entity)

Returns a string containing the class of the given entity.

Parameters:
entityEntity handle
Brush* 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
float 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
float 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
float 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
int xEntityVisible ( Entity *  entity,
Entity *  destination 
)

Returns true if entities can see each other.

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

Returns x-axis scale of entity.

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

Returns y-axis scale of entity.

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

Returns z-axis scale of entity.

Parameters:
entityEntity to be checked
See also:
xScaleEntity()
float 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
float 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
float 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
const char* 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
int xCountChildren ( Entity *  entity)

Returns the number of children of an entity.

Parameters:
entityEntity handle
Entity* 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]
Entity* 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
D3DXMATRIX* xGetEntityMatrix ( Entity *  entity)

Returns a pointer entity's world matrix.

Parameters:
entityEntity handle
float xGetEntityAlpha ( Entity *  entity)

Returns an entity's alpha value.

Parameters:
entityEntity handle
int xGetAlphaRef ( Entity *  entity)

Returns an entity's alpha testing reference.

Parameters:
entityEntity handle
int xGetAlphaFunc ( Entity *  entity)

Returns an entity's alpha testing function.

Parameters:
entityEntity handle
int xEntityRed ( Entity *  entity)

Returns red value of entitys color.

Parameters:
entityEntity handle
int xEntityGreen ( Entity *  entity)

Returns green value of entitys color.

Parameters:
entityEntity handle
int xEntityBlue ( Entity *  entity)

Returns blue value of entitys color.

Parameters:
entityEntity handle
float xGetEntityShininess ( Entity *  entity)

Returns entitys shininess value.

Parameters:
entityEntity handle
int xGetEntityBlend ( Entity *  entity)

Returns entitys blend mode.

Parameters:
entityEntity handle
int xGetEntityFX ( Entity *  entity)

Returns entitys FX flags.

Parameters:
entityEntity handle
int xEntityHidden ( Entity *  entity)

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

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

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

Parameters:
entity1First entity handle
entity2Second entity handle
Entity* 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
Entity* 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
float 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
float 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