![]() |
Xors3d Engine
|
Functions | |
BBDECL int BBCALL | xPhysicsCountHits () |
Returns the number of hits of the last raycast. | |
BBDECL float BBCALL | xPhysicsGetHitDistance (int index=0) |
Returns the distance to the hit point from the ray's start. | |
BBDECL Entity *BBCALL | xPhysicsGetHitEntity (int index=0) |
Returns a handle of an entity which was hit by the last raycast. | |
BBDECL float BBCALL | xPhysicsGetHitNormalX (int index=0) |
Returns the X component of the hit normal of the last raycast. | |
BBDECL float BBCALL | xPhysicsGetHitNormalY (int index=0) |
Returns the Y component of the hit normal of the last raycast. | |
BBDECL float BBCALL | xPhysicsGetHitNormalZ (int index=0) |
Returns the Z component of the hit normal of the last raycast. | |
BBDECL float BBCALL | xPhysicsGetHitPointX (int index=0) |
Returns global X coordinate of the hit point of the last raycast. | |
BBDECL float BBCALL | xPhysicsGetHitPointY (int index=0) |
Returns global Y coordinate of the hit point of the last raycast. | |
BBDECL float BBCALL | xPhysicsGetHitPointZ (int index=0) |
Returns global Z coordinate of the hit point of the last raycast. | |
BBDECL void BBCALL | xPhysicsRayCast (float fromX, float fromY, float fromZ, float toX, float toY, float toZ, int rcType=0, int rayGroup=0) |
Cast a ray trough the scene and gathers the detailed information on what was hit. |
BBDECL void BBCALL xPhysicsRayCast | ( | float | fromX, |
float | fromY, | ||
float | fromZ, | ||
float | toX, | ||
float | toY, | ||
float | toZ, | ||
int | rcType = 0 , |
||
int | rayGroup = 0 |
||
) |
Cast a ray trough the scene and gathers the detailed information on what was hit.
There are two types of raycasting: single and multiple. The first one reports about the closest hit. The second one reports about all hits. See Physics raycasting modes.
You can ignore hitting of some groups of bodies. See xPhysicsSetRaycastFilter() for more details.
fromX | Global X coordinate of the ray's start |
fromY | Global Y coordinate of the ray's start |
fromZ | Global Z coordinate of the ray's start |
toX | Global X coordinate of the ray's end. |
toY | Global Y coordinate of the ray's end. |
toZ | Global Z coordinate of the ray's end. |
rcType | Single or multiple raycast type. See Physics raycasting modes. |
rayGroup | Group of the ray for the filtering. |
BBDECL Entity* BBCALL xPhysicsGetHitEntity | ( | int | index = 0 | ) |
Returns a handle of an entity which was hit by the last raycast.
index | Hit index. Should be in the range [0; xPhysicsCountHits() - 1]. Default value is 0. |
BBDECL float BBCALL xPhysicsGetHitPointX | ( | int | index = 0 | ) |
Returns global X coordinate of the hit point of the last raycast.
index | Hit index. Should be in the range [0; xPhysicsCountHits() - 1]. Default value is 0. |
BBDECL float BBCALL xPhysicsGetHitPointY | ( | int | index = 0 | ) |
Returns global Y coordinate of the hit point of the last raycast.
index | Hit index. Should be in the range [0; xPhysicsCountHits() - 1]. Default value is 0. |
BBDECL float BBCALL xPhysicsGetHitPointZ | ( | int | index = 0 | ) |
Returns global Z coordinate of the hit point of the last raycast.
index | Hit index. Should be in the range [0; xPhysicsCountHits() - 1]. Default value is 0. |
BBDECL float BBCALL xPhysicsGetHitNormalX | ( | int | index = 0 | ) |
Returns the X component of the hit normal of the last raycast.
index | Hit index. Should be in the range [0; xPhysicsCountHits() - 1]. Default value is 0. |
BBDECL float BBCALL xPhysicsGetHitNormalY | ( | int | index = 0 | ) |
Returns the Y component of the hit normal of the last raycast.
index | Hit index. Should be in the range [0; xPhysicsCountHits() - 1]. Default value is 0. |
BBDECL float BBCALL xPhysicsGetHitNormalZ | ( | int | index = 0 | ) |
Returns the Z component of the hit normal of the last raycast.
index | Hit index. Should be in the range [0; xPhysicsCountHits() - 1]. Default value is 0. |
BBDECL float BBCALL xPhysicsGetHitDistance | ( | int | index = 0 | ) |
Returns the distance to the hit point from the ray's start.
index | Hit index. Should be in the range [0; xPhysicsCountHits() - 1]. Default value is 0. |
BBDECL int BBCALL xPhysicsCountHits | ( | ) |
Returns the number of hits of the last raycast.
The returned value is 0 if there were no hits. If there were some hits the returned value is always 1 for the PXRC_SINGLE.