Planed class

From Solid Graphics Wiki

Jump to: navigation, search
Planed class
Namespace: SKL3D
Base type: Vectord class
Include: Skl3D.h
Lib (Release): SKL.lib
Lib (Debug): SKL_D.lib

The Planed class represents a plane. The plane is specified by the plane's normal vector and it's distance from the coordinate system origin (by the offset field). The Plane class uses double precision.


Default Planed class constructor does not initialize the plane fields to any value. This is on purpose for performance reasons. Other class costructors allow to initialize the Planed object from other plane, vector and a offset, or four double values.


Field name Type Description
x double (inherited from the Vectord class) the X coordinate of planes normal vector
y double (inherited from the Vectord class) the Y coordinate of planes normal vector
z double (inherited from the Vectord class) the Z coordinate of planes normal vector
offset double plane's distance value from the coordinate system origin (0, 0, 0). (The offset represents the distance correctly only if plane's normal vector's length is 1 )


Method name Description
Create Creates the plane from plane normal vector and a point which is part of the plane, or a three points lying in the plane.
RecalculateOffset Recalculates the offset field to include specified point.
Normalize Scales the plane values so its' normal vector's length is 1.
Scale Scales the plane values by specified factor.
Distance Returns distance of specified point to the plane.
GetUVVectors Returns two non-parallel vectors which lie inside of the plane.
ClosestPlanePoint Returns point which lies inside the plane and is closest to the specified point.
VectorProjection Returns vector which is projection of specified vector to the plane's normal vector.


* Returns a plane equal to the plane instance scaled by the operand.
= assigns a vector to the plane. The offset field is initialized to value 0.0f.
*= Scales the plane by specified operand.
/= Divides the vector by specified operand

See Also

Personal tools