![]() |
Xors3d Engine
|
Functions | |
int | xPhysicsCountHits () |
Returns the number of hits of the last raycast. | |
float | xPhysicsGetHitDistance (int index=0) |
Returns the distance to the hit point from the ray's start. | |
Entity * | xPhysicsGetHitEntity (int index=0) |
Returns a handle of an entity which was hit by the last raycast. | |
float | xPhysicsGetHitNormalX (int index=0) |
Returns the X component of the hit normal of the last raycast. | |
float | xPhysicsGetHitNormalY (int index=0) |
Returns the Y component of the hit normal of the last raycast. | |
float | xPhysicsGetHitNormalZ (int index=0) |
Returns the Z component of the hit normal of the last raycast. | |
float | xPhysicsGetHitPointX (int index=0) |
Returns global X coordinate of the hit point of the last raycast. | |
float | xPhysicsGetHitPointY (int index=0) |
Returns global Y coordinate of the hit point of the last raycast. | |
float | xPhysicsGetHitPointZ (int index=0) |
Returns global Z coordinate of the hit point of the last raycast. | |
void | 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. |
void 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. |
Entity* 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. |
float 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. |
float 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. |
float 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. |
float 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. |
float 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. |
float 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. |
float 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. |
int 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.