new intersections()

Methods

public static
obbPlane(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 obb have the following properties:

Name Type Optional Description

halfDimensions

 

 

Half dimensions of the box.

orientation

 

 

Orientation of the edges of the box.

center

 

 

Center of the box.

toOBBSpace

 

 

Transform to go from plane space to box space.

toOBBSpaceInvert

 

 

Transform to go from box space to plane space.

plane

Object

 

Plane representation

Values in plane have the following properties:

Name Type Optional Description

position

 

 

position of normal which describes the plane.

direction

 

 

Direction of normal which describes the plane.

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 static
rayPlane(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 ray have the following properties:

Name Type Optional Description

position

 

 

position of normal which describes the ray.

direction

 

 

Direction of normal which describes the ray.

plane

Object

 

Plane representation

Values in plane have the following properties:

Name Type Optional Description

position

 

 

position of normal which describes the plane.

direction

 

 

Direction of normal which describes the plane.

Returns

(THREE.Vector3 or null) Intersection between ray and plane or null.