Ray

非推奨を表示

The Ray data type represents a half-line, finite in one direction but infinite in the other. It can be defined by a 3D point, where the line originates from, and a direction vector, which is the direction it goes in.

概要

コンストラクタ

プロパティ

方法

コンストラクタ

new

パラメータ

Origin: Vector3
Direction: Vector3

プロパティ

Unit

The Ray with a normalized direction (the direction has a magnitude of 1).

Origin

The position of the origin.

Direction

The direction vector of the Ray.

方法

ClosestPoint

Returns a Vector3 projected onto the ray so that it is within the Ray line of sight.

Note: the Ray must be a unit ray for this method to behave as expected!

パラメータ

point: Vector3

戻り値

Distance

Returns the distance between the given point and the point on the ray nearest to the given point (Ray.ClosestPoint(point)).

パラメータ

point: Vector3

戻り値