|
@@ -9,142 +9,177 @@
|
|
|
<body>
|
|
|
<h1>[name]</h1>
|
|
|
|
|
|
- <div class="desc">todo</div>
|
|
|
+ <div class="desc">A ray that emits from an origin in a certain direction.</div>
|
|
|
|
|
|
|
|
|
<h2>Constructor</h2>
|
|
|
|
|
|
|
|
|
- <h3>[name]([page:todo origin], [page:todo direction])</h3>
|
|
|
+ <h3>[name]([page:Vector3 origin], [page:Vector3 direction])</h3>
|
|
|
<div>
|
|
|
- origin -- todo <br />
|
|
|
- direction -- todo
|
|
|
+ origin -- [page:Vector3] The origin of the [page:Ray].<br />
|
|
|
+ direction -- [page:Vector3] The direction of the [page:Ray]. This must be normalized (with [page:Vector3].normalize) for the methods to operate properly.
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Initialises the origin and direction properties to the provided values.
|
|
|
</div>
|
|
|
|
|
|
<h2>Properties</h2>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
<h3>.[page:Vector3 origin]</h3>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ The origin of the [page:Ray].
|
|
|
</div>
|
|
|
|
|
|
<h3>.[page:Vector3 direction]</h3>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ The direction of the [page:Ray]. This must be normalized (with [page:Vector3].normalize) for the methods to operate properly.
|
|
|
</div>
|
|
|
|
|
|
<h2>Methods</h2>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- <h3>.intersectPlane([page:todo plane], [page:todo optionalTarget]) [page:todo]</h3>
|
|
|
+ <h3>.applyMatrix4([page:Matrix4 matrix4]) [page:Ray]</h3>
|
|
|
<div>
|
|
|
- plane -- todo <br />
|
|
|
- optionalTarget -- todo
|
|
|
+ matrix4 -- [page:Matrix4] The [page:Matrix4] to transform this [page:Ray] by.
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Transform this [page:Ray] by the [page:Matrix4].
|
|
|
</div>
|
|
|
|
|
|
- <h3>.set([page:todo origin], [page:todo direction]) [page:todo]</h3>
|
|
|
+ <h3>.at([page:Float t], [page:Vector3 optionalTarget] = null) [page:Vector3]</h3>
|
|
|
<div>
|
|
|
- origin -- todo <br />
|
|
|
- direction -- todo
|
|
|
+ t -- [page:Float] The distance along the [page:Ray] to retrieve a position for.<br />
|
|
|
+ optionalTarget -- [page:Vector3] Receives the position along the [page:Ray] if passed; otherwise a new [page:Vector3] is created.
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Get a [page:Vector3] that is a given distance along this [page:Ray].
|
|
|
</div>
|
|
|
|
|
|
- <h3>.isIntersectionSphere([page:todo sphere]) [page:todo]</h3>
|
|
|
+ <h3>.clone() [page:Ray]</h3>
|
|
|
<div>
|
|
|
- sphere -- todo
|
|
|
+ Create a clone of this [page:Ray].
|
|
|
</div>
|
|
|
+
|
|
|
+ <h3>.closestPointToPoint([page:Vector3 point], [page:Vector3 optionalTarget]) [page:Vector3]</h3>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ point -- [page:Vector3] The point to get the closest approach to. <br />
|
|
|
+ optionalTarget -- [page:Vector3] Receives the return value if passed; otherwise a new [page:Vector3] is created.
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ Get the point along this [page:Ray] that is closest to the [page:Vector3] provided.
|
|
|
</div>
|
|
|
|
|
|
- <h3>.applyMatrix4([page:todo matrix4]) [page:todo]</h3>
|
|
|
+ <h3>.copy([page:Ray ray]) [page:Ray]</h3>
|
|
|
<div>
|
|
|
- matrix4 -- todo
|
|
|
+ ray -- [page:Ray] The [page:Ray] to copy values from.
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Copy the properties of the provided [page:Ray], then return this [page:Ray].
|
|
|
</div>
|
|
|
-
|
|
|
- <h3>.distanceToPlane([page:todo plane]) [page:todo]</h3>
|
|
|
+
|
|
|
+ <h3>.distanceSqToSegment([page:Vector3 v0], [page:Vector3 v1], [page:Vector3 optionalPointOnRay] = null, [page:Vector3 optionalPointOnSegment] = null) [page:Float]</h3>
|
|
|
<div>
|
|
|
- plane -- todo
|
|
|
+ v0 -- [page:Vector3] The start of the line segment.
|
|
|
+ v1 -- [page:Vector3] The end of the line segment.
|
|
|
+ optionalPointOnRay -- [page:Vector3] If this is provided, it receives the point on this [page:Ray] that is closest to the segment.
|
|
|
+ optionalPointOnSegment -- [page:Vector3] If this is provided, it receives the point on the line segment that is closest to this [page:Ray].
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Get the squared distance between this [page:Ray] and a line segment.
|
|
|
</div>
|
|
|
|
|
|
- <h3>.recast([page:todo t]) [page:todo]</h3>
|
|
|
+ <h3>.distanceToPlane([page:Plane plane]) [page:Float]</h3>
|
|
|
<div>
|
|
|
- t -- todo
|
|
|
+ plane -- [page:Plane] The [page:Plane] to get the distance to.
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Get the distance from the origin to the [page:Plane], or *null* if the [page:Ray] doesn't intersect the [page:Plane].
|
|
|
</div>
|
|
|
|
|
|
- <h3>.clone() [page:todo]</h3>
|
|
|
+ <h3>.distanceToPoint([page:Vector3 point]) [page:Float]</h3>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ point -- [page:Vector3] The [page:Vector3] to compute a distance to.
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ Get the distance of the closest approach between the [page:Ray] and the [page:Vector3].
|
|
|
</div>
|
|
|
|
|
|
- <h3>.isIntersectionPlane([page:todo plane]) [page:todo]</h3>
|
|
|
+ <h3>.equals([page:Ray ray]) [page:Boolean]</h3>
|
|
|
<div>
|
|
|
- plane -- todo
|
|
|
+ ray -- [page:Ray] The [page:Ray] to compare to.
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Return whether this and the other [page:Ray] have equal offsets and directions.
|
|
|
</div>
|
|
|
|
|
|
- <h3>.equals([page:todo ray]) [page:todo]</h3>
|
|
|
+ <h3>.intersectBox([page:Box3 box], [page:Vector3 optionalTarget] = null) [page:Vector3]?</h3>
|
|
|
+ <div>
|
|
|
+ box -- [page:Box3] The [page:Box3] to intersect with.<br />
|
|
|
+ optionalTarget -- [page:Vector3] The [page:Vector3] to store the result in, or *null* to create a new [page:Vector3].
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ Intersect this [page:Ray] with a [page:Box3], returning the intersection point or *null* if there is no intersection.
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <h3>.intersectPlane([page:Plane plane], [page:Vector3 optionalTarget] = null) [page:Vector3]?</h3>
|
|
|
+ <div>
|
|
|
+ plane -- [page:Plane] The [page:Plane] to intersect with.<br />
|
|
|
+ optionalTarget -- [page:Vector3] The [page:Vector3] to store the result in, or *null* to create a new [page:Vector3].
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ Intersect this [page:Ray] with a [page:Plane], returning the intersection point or *null* if there is no intersection.
|
|
|
+ </div>
|
|
|
+ function ( a, b, c, backfaceCulling, optionalTarget )
|
|
|
+
|
|
|
+ <h3>.intersectTriangle([page:Vector3 a], [page:Vector3 b], [page:Vector3 c], [page:Boolean backfaceCulling], [page:Vector3 optionalTarget] = null) [page:Vector3]?</h3>
|
|
|
+ <div>
|
|
|
+ a, b, c -- [page:Vector3] The [page:Vector3] points on the triangle.<br />
|
|
|
+ backfaceCulling -- [page:Boolean] Whether to use backface culling.<br />
|
|
|
+ optionalTarget -- [page:Vector3] The [page:Vector3] to store the result in, or *null* to create a new [page:Vector3].
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ Intersect this [page:Ray] with a triangle, returning the intersection point or *null* if there is no intersection.
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <h3>.isIntersectionBox([page:Box3 box]) [page:Boolean]</h3>
|
|
|
<div>
|
|
|
- ray -- todo
|
|
|
+ box -- [page:Box3] The [page:Box3] to intersect with.
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Return whether or not this [page:Ray] intersects with the [page:Box3].
|
|
|
</div>
|
|
|
|
|
|
- <h3>.at([page:todo t], [page:todo optionalTarget]) [page:todo]</h3>
|
|
|
+ <h3>.isIntersectionPlane([page:Plane plane]) [page:Boolean]</h3>
|
|
|
<div>
|
|
|
- t -- todo <br />
|
|
|
- optionalTarget -- todo
|
|
|
+ plane -- [page:Plane] The [page:Plane] to intersect with.
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Return whether or not this [page:Ray] intersects with the [page:Plane].
|
|
|
</div>
|
|
|
|
|
|
- <h3>.distanceToPoint([page:todo point]) [page:todo]</h3>
|
|
|
+ <h3>.isIntersectionSphere([page:Sphere sphere]) [page:Boolean]</h3>
|
|
|
<div>
|
|
|
- point -- todo
|
|
|
+ sphere -- [page:Sphere] The [page:Sphere] to intersect with.
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Return whether or not this [page:Ray] intersects with the [page:Sphere].
|
|
|
</div>
|
|
|
|
|
|
- <h3>.closestPointToPoint([page:todo point], [page:todo optionalTarget]) [page:todo]</h3>
|
|
|
+ <h3>.recast([page:Float t])</h3>
|
|
|
<div>
|
|
|
- point -- todo <br />
|
|
|
- optionalTarget -- todo
|
|
|
+ t -- The distance along the [page:Ray] to interpolate.
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Shift the origin of this [page:Ray] along its direction by the distance given.
|
|
|
</div>
|
|
|
|
|
|
- <h3>.copy([page:todo ray]) [page:todo]</h3>
|
|
|
+ <h3>.set([page:Vector3 origin], [page:Vector3 direction]) [page:Ray]</h3>
|
|
|
<div>
|
|
|
- ray -- todo
|
|
|
+ origin -- [page:Vector3] The origin of the [page:Ray].<br />
|
|
|
+ direction -- [page:Vector3] The direction of the [page:Ray]. This must be normalized (with [page:Vector3].normalize) for the methods to operate properly.
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Copy the parameters to the origin and direction properties.
|
|
|
</div>
|
|
|
|
|
|
<h2>Source</h2>
|