Ray.kl¶
Types¶
Ray (struct)¶
The Ray type represents linear 3D ray. This is expressed by a start and direction Vec3
/*
** Example: Ray
*/
Ray ray(Vec3(0.0, 0.0, 0.0), Vec3(0.1, -1.0, 0.4));
Methods¶
Ray ( in Ray other ) | |
Ray ( in Vec3 start, in Vec3 direction ) | |
Ray () | |
Ray | clone ? () |
Scalar | distanceToPoint ? ( in Vec3 point, out Scalar rayParam ) |
UInt32 | hash ? () |
Boolean | intersectBoundingBox ? ( in Box3 box3 ) |
Vec2 | intersectLine ? ( in Vec3 lineP0, in Vec3 lineP1 ) |
Boolean | intersectLineSegment ? ( in Vec3 lineP0, in Vec3 lineP1, out Scalar dist, out Scalar rayParam, out Scalar segmentParam ) |
Scalar | intersectPlane ? ( in Vec3 planePoint, in Vec3 planeNormal ) |
Vec3 | intersectPlaneVec3 ? ( in Vec3 planePoint, in Vec3 planeNormal ) |
Boolean | intersectTriangle ? ( in Boolean cull, in Boolean bidirectional, in Vec3 v0, in Vec3 v1, in Vec3 v2, out Vec3 point, out Scalar dist, out Scalar u, out Scalar v ) |
Vec3 | pointFromFactor ? ( in Scalar factor ) |
set ! ( in Vec3 start, in Vec3 direction ) |
Functions¶
twoPlaneIntersection¶
twoPlaneIntersection ( in Vec3 plane1Point, in Vec3 plane1Normal, in Vec3 plane2Point, in Vec3 plane2Normal, io Vec3 linePoint, io Vec3 lineVector )
Computes the intersection point of two planes. The planes are each defined as a point and a normal. Returns the intersection point. linePoint will be set to plane1Point.
注釈
If lineVector is :ref:`Vec3 <vec3>`() it means that the planes are either intersecting nowhere or everywhere. In this case
plane1Point | The first plane’s position |
plane1Normal | The first plane’s normal (must be a unit in length) |
plane2Point | The second plane’s position |
plane2Normal | The second plane’s normal (must be a unit in length) |
linePoint | The intersection point of the 2 planes. |
lineVector | The intersection vector of the 2 planes. |