Class Plane3f
- java.lang.Object
-
- WildMagic.LibFoundation.Mathematics.Plane3f
-
- All Implemented Interfaces:
java.io.Serializable
public class Plane3f extends java.lang.Object implements java.io.Serializable
The plane is represented as Dot(N,X) = c where N is a unit-length normal vector, c is the plane constant, and X is any point on the plane. The user must ensure that the normal vector satisfies this condition.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description float
Constant
Plane constant:Vector3f
Normal
Plane normal:private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description Plane3f()
Default constructor, uninitialized.Plane3f(Plane3f rkPlane)
Copy constructor.Plane3f(Vector3f rkNormal, float fConstant)
specify N and c directlyPlane3f(Vector3f rkNormal, Vector3f rkP)
N is specified, c = Dot(N,P) where P is on the planePlane3f(Vector3f rkP0, Vector3f rkP1, Vector3f rkP2)
N = Cross(P1-P0,P2-P0)/Length(Cross(P1-P0,P2-P0)), c = Dot(N,P0) where P0, P1, P2 are points on the plane.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
delete memoryfloat
DistanceTo(Vector3f rkP)
Compute d = Dot(N,Q)-c where N is the plane normal and c is the plane constant.int
WhichSide(Vector3f rkQ)
The "positive side" of the plane is the half space to which the plane normal points.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
Normal
public Vector3f Normal
Plane normal:
-
Constant
public float Constant
Plane constant:
-
-
Constructor Detail
-
Plane3f
public Plane3f()
Default constructor, uninitialized.
-
Plane3f
public Plane3f(Plane3f rkPlane)
Copy constructor.- Parameters:
rkPlane
- plane to copy.
-
Plane3f
public Plane3f(Vector3f rkNormal, float fConstant)
specify N and c directly- Parameters:
rkNormal
- normal vectorfConstant
- plane constant
-
Plane3f
public Plane3f(Vector3f rkNormal, Vector3f rkP)
N is specified, c = Dot(N,P) where P is on the plane- Parameters:
rkNormal
- normal vectorrkP
- point on the plane
-
-
Method Detail
-
dispose
public void dispose()
delete memory
-
DistanceTo
public float DistanceTo(Vector3f rkP)
Compute d = Dot(N,Q)-c where N is the plane normal and c is the plane constant. This is a signed distance. The sign of the return value is positive if the point is on the positive side of the plane, negative if the point is on the negative side, and zero if the point is on the plane.- Parameters:
rkP
- point- Returns:
- distance.
-
WhichSide
public int WhichSide(Vector3f rkQ)
The "positive side" of the plane is the half space to which the plane normal points. The "negative side" is the other half space. The function returns +1 for the positive side, -1 for the negative side, and 0 for the point being on the plane.- Parameters:
rkQ
- point- Returns:
- +1 for the positive side, -1 for the negative side, and 0 for the point being on the plane.
-
-