Class Plane
Hierarchy
- Plane
Index
Constructors
constructor
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
Returns Plane
Properties
dSearch playground for d
d component of the plane
normalSearch playground for normal
Normal of the plane (a,b,c)
Methods
as ArraySearch playground for asArray
Returns number[]
the plane coordinates as a new array of 4 elements [a, b, c, d].
cloneSearch playground for clone
Returns Plane
a new plane copied from the current Plane.
copy From PointsSearch playground for copyFromPoints
Updates the current Plane from the plane defined by the three given points.
Parameters
point1: DeepImmutableObject<Vector3>
one of the points used to construct the plane
point2: DeepImmutableObject<Vector3>
one of the points used to construct the plane
point3: DeepImmutableObject<Vector3>
one of the points used to construct the plane
Returns Plane
the updated Plane.
dot CoordinateSearch playground for dotCoordinate
Compute the dot product between the point and the plane normal
Parameters
point: DeepImmutableObject<Vector3>
point to calculate the dot product with
Returns number
the dot product (float) of the point coordinates and the plane normal.
get Class NameSearch playground for getClassName
Returns string
the string "Plane".
get Hash CodeSearch playground for getHashCode
Returns number
the Plane hash code.
is Front Facing ToSearch playground for isFrontFacingTo
Checks if the plane is facing a given direction (meaning if the plane's normal is pointing in the opposite direction of the given vector). Note that for this function to work as expected you should make sure that:
- direction and the plane normal are normalized
- epsilon is a number just bigger than -1, something like -0.99 for eg
Parameters
direction: DeepImmutableObject<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 if the plane is facing the given direction
normalizeSearch playground for normalize
Normalize the current Plane in place.
Returns Plane
the updated Plane.
signed Distance ToSearch playground for signedDistanceTo
Calculates the distance to a point
Parameters
point: DeepImmutableObject<Vector3>
point to calculate distance to
Returns number
the signed distance (float) from the given point to the Plane.
transformSearch playground for transform
Applies a transformation the plane and returns the result
Parameters
transformation: DeepImmutableObject<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 From ArraySearch playground for FromArray
Creates a plane from an array
Parameters
array: DeepImmutableObject<ArrayLike<number>>
the array to create a plane from
Returns Plane
a new Plane from the given array.
Static From PointsSearch playground for FromPoints
Creates a plane from three points
Parameters
point1: DeepImmutableObject<Vector3>
point used to create the plane
point2: DeepImmutableObject<Vector3>
point used to create the plane
point3: DeepImmutableObject<Vector3>
point used to create the plane
Returns Plane
a new Plane defined by the three given points.
Static From Position And NormalSearch playground for FromPositionAndNormal
Creates a plane from an origin point and a normal
Parameters
origin: DeepImmutableObject<Vector3>
origin of the plane to be constructed
normal: 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 Signed Distance To Plane From Position And NormalSearch playground for SignedDistanceToPlaneFromPositionAndNormal
Calculates the distance from a plane and a point
Parameters
origin: DeepImmutableObject<Vector3>
origin of the plane to be constructed
normal: DeepImmutableObject<Vector3>
normal of the plane to be constructed
point: DeepImmutableObject<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.
Represents a plane by the equation ax + by + cz + d = 0