|
Kanzi Graphics Engine
|
Ray utility. More...
#include <core/util/math/kzc_vector3.h>#include <system/kzs_types.h>#include <system/kzs_header.h>Data Structures | |
| struct | KzcRay |
| Structure for ray. More... | |
Functions | |
| KZ_INLINE void | kzcRaySet (const struct KzcVector3 origin, const struct KzcVector3 direction, struct KzcRay *out_ray) |
| Constructs a ray from point and direction vector. More... | |
| kzBool | kzcRaySphereIntersection (const struct KzcRay *ray, const struct KzcVector3 *spherePosition, const kzFloat sphereRadius, kzFloat *out_distance) |
| Test intersection between ray and sphere and return distance. More... | |
| kzBool | kzcRayBoundingBoxIntersection (const struct KzcRay *ray, const struct KzcVector3 *boundingBoxMinimum, const struct KzcVector3 *boundingBoxMaximum, const struct KzcMatrix4x4 *boxOrientation, kzFloat *out_distance) |
| Test intersection between ray and bounding box. More... | |
| kzBool | kzcRayBoundingBoxBackfaceIntersection (const struct KzcRay *ray, const struct KzcVector3 *boundingBoxMinimum, const struct KzcVector3 *boundingBoxMaximum, const struct KzcMatrix4x4 *boxOrientation, kzFloat *out_distance) |
| Test intersection between ray and bounding box back faces. More... | |
| kzBool | kzcRayCylinderIntersection (const struct KzcRay *ray, kzFloat cylinderRadius, kzFloat cylinderHeight, const struct KzcVector3 *cylinderAxis, const struct KzcMatrix4x4 *cylinderTransform, kzFloat *out_distance) |
| Tests intersection between ray and cylinder aligned in the given unit-axis, ranging [-height/2, height/2]. More... | |
| void | kzcRayTransform (struct KzcRay *ray, const struct KzcMatrix4x4 *transform) |
| Transform a ray by a 4x4 matrix. More... | |
Ray utility.
Copyright 2008-2019 by Rightware. All rights reserved.
| KZ_INLINE void kzcRaySet | ( | const struct KzcVector3 | origin, |
| const struct KzcVector3 | direction, | ||
| struct KzcRay * | out_ray | ||
| ) |
Constructs a ray from point and direction vector.
Normalizes the direction vector
| kzBool kzcRaySphereIntersection | ( | const struct KzcRay * | ray, |
| const struct KzcVector3 * | spherePosition, | ||
| const kzFloat | sphereRadius, | ||
| kzFloat * | out_distance | ||
| ) |
Test intersection between ray and sphere and return distance.
| kzBool kzcRayBoundingBoxIntersection | ( | const struct KzcRay * | ray, |
| const struct KzcVector3 * | boundingBoxMinimum, | ||
| const struct KzcVector3 * | boundingBoxMaximum, | ||
| const struct KzcMatrix4x4 * | boxOrientation, | ||
| kzFloat * | out_distance | ||
| ) |
Test intersection between ray and bounding box.
| kzBool kzcRayBoundingBoxBackfaceIntersection | ( | const struct KzcRay * | ray, |
| const struct KzcVector3 * | boundingBoxMinimum, | ||
| const struct KzcVector3 * | boundingBoxMaximum, | ||
| const struct KzcMatrix4x4 * | boxOrientation, | ||
| kzFloat * | out_distance | ||
| ) |
Test intersection between ray and bounding box back faces.
| kzBool kzcRayCylinderIntersection | ( | const struct KzcRay * | ray, |
| kzFloat | cylinderRadius, | ||
| kzFloat | cylinderHeight, | ||
| const struct KzcVector3 * | cylinderAxis, | ||
| const struct KzcMatrix4x4 * | cylinderTransform, | ||
| kzFloat * | out_distance | ||
| ) |
Tests intersection between ray and cylinder aligned in the given unit-axis, ranging [-height/2, height/2].
The cylinder is first transformed with the given transformation matrix.
| void kzcRayTransform | ( | struct KzcRay * | ray, |
| const struct KzcMatrix4x4 * | transform | ||
| ) |
Transform a ray by a 4x4 matrix.