Plane

Represens a plane by the equation ax + by + cz + d = 0

• Plane

Constructors

constructor

Find examples in Playground
• new Plane(a: number, b: number, c: number, d: number): Plane
• Creates a Plane object according to the given floats a, b, c, d and the plane equation : ax + by + cz + d = 0

Parameters

• a: number

a component of the plane

• b: number

b component of the plane

• c: number

c component of the plane

• d: number

d component of the plane

Properties

d

Find examples in Playground
d: number

d component of the plane

normal

Find examples in Playground
normal: Vector3

Normal of the plane (a,b,c)

Methods

asArray

Find examples in Playground
• asArray(): number[]
• Returns number[]

the plane coordinates as a new array of 4 elements [a, b, c, d].

clone

Find examples in Playground
• Returns Plane

a new plane copied from the current Plane.

copyFromPoints

Find examples in Playground
• Updates the current Plane from the plane defined by the three given points.

Parameters

• point1: DeepImmutable<Vector3>

one of the points used to contruct the plane

• point2: DeepImmutable<Vector3>

one of the points used to contruct the plane

• point3: DeepImmutable<Vector3>

one of the points used to contruct the plane

Returns Plane

the updated Plane.

dotCoordinate

Find examples in Playground
• Calcualtte the dot product between the point and the plane normal

Parameters

• point: DeepImmutable<Vector3>

point to calculate the dot product with

Returns number

the dot product (float) of the point coordinates and the plane normal.

getClassName

Find examples in Playground
• getClassName(): string
• Returns string

the string "Plane".

getHashCode

Find examples in Playground
• getHashCode(): number
• Returns number

the Plane hash code.

isFrontFacingTo

Find examples in Playground
• Checks if the plane is facing a given direction

Parameters

• direction: DeepImmutable<Vector3>

the direction to check if the plane is facing

• epsilon: number

value the dot product is compared against (returns true if dot <= epsilon)

Returns boolean

True is the vector "direction" is the same side than the plane normal.

normalize

Find examples in Playground
• Normalize the current Plane in place.

Returns Plane

the updated Plane.

signedDistanceTo

Find examples in Playground
• Calculates the distance to a point

Parameters

• point: DeepImmutable<Vector3>

point to calculate distance to

Returns number

the signed distance (float) from the given point to the Plane.

transform

Find examples in Playground
• Applies a transformation the plane and returns the result

Parameters

• transformation: DeepImmutable<Matrix>

the transformation matrix to be applied to the plane

Returns Plane

a new Plane as the result of the transformation of the current Plane by the given matrix.

Static FromArray

Find examples in Playground
• Creates a plane from an array

Parameters

• array: DeepImmutable<ArrayLike<number>>

the array to create a plane from

Returns Plane

a new Plane from the given array.

Static FromPoints

Find examples in Playground
• Creates a plane from three points

Parameters

• point1: DeepImmutable<Vector3>

point used to create the plane

• point2: DeepImmutable<Vector3>

point used to create the plane

• point3: DeepImmutable<Vector3>

point used to create the plane

Returns Plane

a new Plane defined by the three given points.

Static FromPositionAndNormal

Find examples in Playground
• Creates a plane from an origin point and a normal

Parameters

• origin: DeepImmutable<Vector3>

origin of the plane to be constructed

• normal: DeepImmutable<Vector3>

normal of the plane to be constructed

Returns Plane

a new Plane the normal vector to this plane at the given origin point. Note : the vector "normal" is updated because normalized.

Static SignedDistanceToPlaneFromPositionAndNormal

Find examples in Playground
• Calculates the distance from a plane and a point

Parameters

• origin: DeepImmutable<Vector3>

origin of the plane to be constructed

• normal: DeepImmutable<Vector3>

normal of the plane to be constructed

• point: DeepImmutable<Vector3>

point to calculate distance to

Returns number

the signed distance between the plane defined by the normal vector at the "origin"" point and the given other point.

Generated using TypeDoc