Plane

class cee.Plane()

An immutable plane.

The class describes a plane by the equation: Ax + By + Cz + D = 0 The plane’s normal is defined by the coefficients [A, B, C]

Constructors

cee.Plane.constructor()
Plane(A: number, B: number, C: number, D: number): Plane

Constructor

Parameters

A: number

B: number

C: number

D: number

Returns: Plane

Accessors

cee.Plane.A()
get A(): number

The A coefficient of the plane equation

Returns: number

cee.Plane.B()
get B(): number

The B coefficient of the plane equation

Returns: number

cee.Plane.C()
get C(): number

The C coefficient of the plane equation

Returns: number

cee.Plane.D()
get D(): number

The D coefficient of the plane equation

Returns: number

Methods

cee.Plane.equals()
equals(other: PlaneLike): boolean

Returns true if the planes are equal.

Parameters

other: PlaneLike

Returns: boolean

cee.Plane.getDistance()
getDistance(point: Vec3Like): number

Returns the distance between the give point and this plane

Parameters

point: Vec3Like

Returns: number

cee.Plane.getDistanceSquared()
getDistanceSquared(point: Vec3Like): number

Returns the square of the distance from the point to the plane

The square of the distance is relatively fast to compute (no ‘sqrt’) and is useful for determine which side the point is on. To obtain the actual distance, divide by sqrt(A^2 + B^2 + C^2) or use the distance() function directly.

Parameters

point: Vec3Like

Returns: number

cee.Plane.getNormal()
getNormal(): Vec3Like

Returns the distance between the give point and this plane

Returns: Vec3Like

cee.Plane.getPointInPlane()
getPointInPlane(): Vec3Like

Returns a point guaranteed to be on this plane

Returns: Vec3Like

cee.Plane.projectPoint()
projectPoint(point: Vec3Like): Vec3Like

Project the given point onto the plane

Parameters

point: Vec3Like

Returns: Vec3Like

cee.Plane.projectVector()
projectVector(vector: Vec3Like): Vec3Like

Project the given vector onto the plane

Returns the projected vector or undefined if the vector is parallel with the plane’s normal

Parameters

vector: Vec3Like

Returns: Vec3Like

static cee.Plane.from()

static

from(plane: PlaneLike): Plane

Creates a plane instance from any object with A,B,C,D properties

Parameters

plane: PlaneLike

Returns: Plane

static cee.Plane.fromPointAndNormal()

static

fromPointAndNormal(point: Vec3Like, normal: Vec3Like): Plane

Returns a plane created from a point and a normal

Parameters

point: Vec3Like

normal: Vec3Like

Returns: Plane

static cee.Plane.fromPoints()

static

fromPoints(p1: Vec3Like, p2: Vec3Like, p3: Vec3Like): Plane

Returns a plane created from three points

The three points cannot be on a line as they need to define a plane. So (p2 - p1)*(p3 - p1) != 0

Parameters

Returns: Plane