class public staticVJS.core. intersections
Source: core/
new intersections()
Methods
public staticobbPlane(obb, plane) → Array of THREE.Vector3
Compute intersection between oriented bounding box and a plane. Returns intersection in plane's space (toOBBSpaceInvert applied). Should return at least 3 intersections. If not, the plane and the box do not intersect.
Parameters
Name | Type | Optional | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
obb |
Object |
|
Oriented Bounding Box representation. Values in
|
||||||||||||||||||||||||
plane |
Object |
|
Plane representation Values in
|
- To do
- toOBBSpace and toOBBSpaceInvert might be redundent.
- find best way to deal with different spaces.
- Returns
-
Array of THREE.Vector3
List of all intersections, in plane's space.
public staticrayPlane(ray, plane) → (THREE.Vector3 or null)
Compute intersection between a ray and a plane.
Parameters
Name | Type | Optional | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ray |
Object |
|
Ray representation. Values in
|
||||||||||||
plane |
Object |
|
Plane representation Values in
|
- Returns
-
(THREE.Vector3 or null)
Intersection between ray and plane or null.