AnyCAD Rapid API 2024
Help you to create a better world!
载入中...
搜索中...
未找到
Ray类 参考

Public 成员函数

 Ray (Vector3d origin, Vector3d direction)
 
void setOrigin (Vector3d origin)
 
Vector3d getOrigin ()
 
void setDirection (Vector3d dir)
 
Vector3d getDirection ()
 
Vector3d getPoint (double t)
 
RayIntersect intersects (Plane p)
 
RayIntersect intersects (BoundedVolumeD p)
 
RayIntersect intersects (Sphere s)
 
RayIntersect intersects (AABox box)
 
boolean IsVertexOn (Vector3d vertex)
 
void applyMatrix (Matrix4d trf)
 
double projectPoint (Vector3d pt)
 

详细描述

<>
Representation of a ray in space,
i.e. a line with an origin and direction.

成员函数说明

◆ getDirection()

Vector3d Ray.getDirection ( )

Gets the direction of the ray.

◆ getOrigin()

Vector3d Ray.getOrigin ( )

Gets the origin of the ray.

◆ getPoint()

Vector3d Ray.getPoint ( double t)

Gets the position of a point t units along the ray.

◆ intersects() [1/4]

RayIntersect Ray.intersects ( AABox box)

Tests whether this ray intersects the given box.

返回
A pair structure where the first element indicates whether
an intersection occurs, and if true, the second element will
indicate the distance along the ray at which it intersects.
This can be converted to a point in space by calling getPoint().

◆ intersects() [2/4]

RayIntersect Ray.intersects ( BoundedVolumeD p)

Tests whether this ray intersects the given plane bounded volume.

返回
A pair structure where the first element indicates whether
an intersection occurs, and if true, the second element will
indicate the distance along the ray at which it intersects.
This can be converted to a point in space by calling getPoint().

◆ intersects() [3/4]

RayIntersect Ray.intersects ( Plane p)

Tests whether this ray intersects the given plane.

返回
A pair structure where the first element indicates whether
an intersection occurs, and if true, the second element will
indicate the distance along the ray at which it intersects.
This can be converted to a point in space by calling getPoint().

◆ intersects() [4/4]

RayIntersect Ray.intersects ( Sphere s)

Tests whether this ray intersects the given sphere.

返回
A pair structure where the first element indicates whether
an intersection occurs, and if true, the second element will
indicate the distance along the ray at which it intersects.
This can be converted to a point in space by calling getPoint().

◆ IsVertexOn()

boolean Ray.IsVertexOn ( Vector3d vertex)

return true if the vertex is on the ray

◆ setDirection()

void Ray.setDirection ( Vector3d dir)

Sets the direction of the ray.

◆ setOrigin()

void Ray.setOrigin ( Vector3d origin)

Sets the origin of the ray.