Skip to content

KBE3D / KBCore / Cesium / Ray

类: Ray

Represents a ray that extends infinitely from the provided origin in the provided direction.

参数

The origin of the ray.

参数

The direction of the ray.

属性

origin

origin: Cartesian3

The origin of the ray.


direction

direction: Cartesian3

The direction of the ray.

方法

clone()

static clone(ray: Ray, result?: Ray): Ray

Duplicates a Ray instance.

参数

ray

Ray

The ray to duplicate.

result?

Ray

The object onto which to store the result.

返回

Ray

The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined)


getPoint()

static getPoint(ray: Ray, t: number, result?: Cartesian3): Cartesian3

Computes the point along the ray given by r(t) = o + t*d, where o is the origin of the ray and d is the direction.

参数

ray

Ray

The ray.

t

number

A scalar value.

result?

Cartesian3

The object in which the result will be stored.

返回

Cartesian3

The modified result parameter, or a new instance if none was provided.

示例

ts
//Get the first intersection point of a ray and an ellipsoid.
const intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
const point = Cesium.Ray.getPoint(ray, intersection.start);

构造函数

构造函数

new Ray(origin?: Cartesian3, direction?: Cartesian3): Ray

参数

origin?

Cartesian3

direction?

Cartesian3

返回

Ray

KBE3D @3.0.0 Copyright © 2024-present KBE3D