@JsType(isNative=true, namespace="Cesium", name="Ray") public class Ray extends Object
Modifier and Type | Field and Description |
---|---|
Cartesian3 |
direction
The direction of the ray.
|
Cartesian3 |
origin
The origin of the ray.
|
Constructor and Description |
---|
Ray()
Represents a ray that extends infinitely from the provided origin in the provided direction.
|
Ray(Cartesian3 origin,
Cartesian3 direction)
Represents a ray that extends infinitely from the provided origin in the provided direction.
|
Modifier and Type | Method and Description |
---|---|
static Ray |
clone(Ray ray)
Duplicates a Ray instance.
|
static Ray |
clone(Ray ray,
Ray result)
Duplicates a Ray instance.
|
static Cartesian3 |
getPoint(Ray ray,
double t)
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.
|
static Cartesian3 |
getPoint(Ray ray,
double t,
Cartesian3 result)
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.
|
@JsProperty public Cartesian3 direction
public Cartesian3 origin
Cartesian3.ZERO()
@JsConstructor public Ray()
@JsConstructor public Ray(Cartesian3 origin, Cartesian3 direction)
origin
- The origin of the ray. Default: Cartesian3.ZERO()
direction
- The direction of the ray. Default: Cartesian3.ZERO()
@JsMethod public static Ray clone(Ray ray)
ray
- The ray to duplicate.@JsMethod public static Ray clone(Ray ray, Ray result)
ray
- The ray to duplicate.result
- The object onto which to store the result.@JsMethod public static Cartesian3 getPoint(Ray ray, double t)
Example:
//Get the first intersection point of a ray and an ellipsoid.
var intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
Cartesian3 point = Ray.getPoint(ray, intersection.start);
ray
- The ray.t
- A scalar value.@JsMethod public static Cartesian3 getPoint(Ray ray, double t, Cartesian3 result)
Example:
//Get the first intersection point of a ray and an ellipsoid.
var intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
Cartesian3 point = Ray.getPoint(ray, intersection.start);
ray
- The ray.t
- A scalar value.result
- The object in which the result will be stored.Copyright © 2019. All rights reserved.