crystalspace.jbind.impl.csgeom.plane3
Class csPlane3

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csgeom.plane3.csPlane3
All Implemented Interfaces:
iPointer

public class csPlane3
extends csNativeObject

A plane in 3D space.

Author:
Quentin Anciaux

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Constructor Summary
csPlane3()
          Initialize to the xy plane (0,0,1,0).
csPlane3(csVector3 plane_norm)
          Initialize the plane with the given norm and D component = 0.
csPlane3(csVector3 v2, csVector3 v3)
          Initialize the plane through 0 and the two given points.
csPlane3(csVector3 v1, csVector3 v2, csVector3 v3)
          Initialize the plane through the three given points.
csPlane3(csVector3 plane_norm, float d)
          Initialize the plane with the given norm and D component.
csPlane3(float a, float b, float c)
          Initialize the plane to the given components.
csPlane3(float a, float b, float c, float d)
          Initialize the plane to the given components.
csPlane3(iPointer nPointer)
          Create a java csPlane3 object which points to the native csPlane3 nPointer.
 
Method Summary
 float a()
          Return the A component of this plane.
 float b()
          Return the B component of this plane.
 float c()
          Return the C component of this plane.
 float classify(csVector3 pt)
          Classify the given vector with regards to this plane.
static float classify(float A, float B, float C, float D, csVector3 pt)
          This static function classifies a vector with regards to four given plane components.
 boolean clipPolygon(csVector3 pverts, int num_verts)
          Clip the polygon in pverts (having num_verts vertices) to this plane.
 boolean clipPolygon(csVector3 pverts, int num_verts, boolean reversed)
          Clip the polygon in pverts (having num_verts vertices) to this plane
 float d()
          Return the D component of this plane.
 float dd()
          The D component of the plane.
 void dd(float DD)
          The D component of the plane.
 float distance(csVector3 pt)
          Compute the distance from the given vector to this plane.
 void invert()
          Reverses the direction of the plane while maintianing the plane itself.
protected  boolean isNativePointerValidSafe(long nPointer)
           
protected  void nDelete(long pointer)
           
 csVector3 norm()
          The normal vector (or the (A,B,C) components).
 csVector3 normal()
          Return the normal vector of this plane.
 void normalize()
          Normalizes the plane equation so that 'norm' is a unit vector.
 void set(csVector3 v2, csVector3 v3)
          Initialize the plane through 0 and the two given points.
 void set(csVector3 v1, csVector3 v2, csVector3 v3)
          Initialize the plane through the three given points.
 void set(csVector3 normal, float d)
          Set the value of the plane using a normal and D component.
 void set(float a, float b, float c, float d)
          Set the value of the four plane components.
 void setNorm(csVector3 norm)
          The normal vector (or the (A,B,C) components).
 
Methods inherited from class crystalspace.jbind.impl.csNativeObject
changePointer, equals, finalize, getPointer, getPointer, getPointerArray, hashCode, isMemoryOwner, isNativePointerValid, newNativeObject, setMemoryOwner, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

csPlane3

public csPlane3(iPointer nPointer)
Create a java csPlane3 object which points to the native csPlane3 nPointer.

Parameters:
nPointer -

csPlane3

public csPlane3()
Initialize to the xy plane (0,0,1,0).


csPlane3

public csPlane3(csVector3 plane_norm)
Initialize the plane with the given norm and D component = 0.

Parameters:
plane_norm -

csPlane3

public csPlane3(csVector3 plane_norm,
                float d)
Initialize the plane with the given norm and D component.

Parameters:
plane_norm -
d -

csPlane3

public csPlane3(float a,
                float b,
                float c)
Initialize the plane to the given components.

Parameters:
a -
b -
c -

csPlane3

public csPlane3(float a,
                float b,
                float c,
                float d)
Initialize the plane to the given components.

Parameters:
a -
b -
c -
d -

csPlane3

public csPlane3(csVector3 v1,
                csVector3 v2,
                csVector3 v3)
Initialize the plane through the three given points.

Parameters:
v1 -
v2 -
v3 -

csPlane3

public csPlane3(csVector3 v2,
                csVector3 v3)
Initialize the plane through 0 and the two given points.

Parameters:
v2 -
v3 -
Method Detail

nDelete

protected void nDelete(long pointer)
Specified by:
nDelete in class csNativeObject
See Also:
csNativeObject.nDelete(long)

isNativePointerValidSafe

protected boolean isNativePointerValidSafe(long nPointer)
Specified by:
isNativePointerValidSafe in class csNativeObject
See Also:
crystalspace.jbind.impl.csNativeObject#isNativePointerValidSafe()

normal

public final csVector3 normal()
Return the normal vector of this plane.

Returns:

a

public final float a()
Return the A component of this plane.

Returns:

b

public final float b()
Return the B component of this plane.

Returns:

c

public final float c()
Return the C component of this plane.

Returns:

d

public final float d()
Return the D component of this plane.

Returns:

set

public final void set(float a,
                      float b,
                      float c,
                      float d)
Set the value of the four plane components.

Parameters:
a -
b -
c -
d -

set

public final void set(csVector3 normal,
                      float d)
Set the value of the plane using a normal and D component.

Parameters:
normal -
d -

set

public final void set(csVector3 v1,
                      csVector3 v2,
                      csVector3 v3)
Initialize the plane through the three given points.

Parameters:
v1 -
v2 -
v3 -

set

public final void set(csVector3 v2,
                      csVector3 v3)
Initialize the plane through 0 and the two given points.

Parameters:
v2 -
v3 -

classify

public final float classify(csVector3 pt)
Classify the given vector with regards to this plane.

Parameters:
pt -
Returns:

distance

public final float distance(csVector3 pt)
Compute the distance from the given vector to this plane.

Parameters:
pt -
Returns:

invert

public final void invert()
Reverses the direction of the plane while maintianing the plane itself.


normalize

public final void normalize()
Normalizes the plane equation so that 'norm' is a unit vector.


clipPolygon

public final boolean clipPolygon(csVector3 pverts,
                                 int num_verts)
Clip the polygon in pverts (having num_verts vertices) to this plane.

Parameters:
pverts -
num_verts -
Returns:

clipPolygon

public final boolean clipPolygon(csVector3 pverts,
                                 int num_verts,
                                 boolean reversed)
Clip the polygon in pverts (having num_verts vertices) to this plane

Parameters:
pverts -
num_verts -
reversed -
Returns:

classify

public static final float classify(float A,
                                   float B,
                                   float C,
                                   float D,
                                   csVector3 pt)
This static function classifies a vector with regards to four given plane components.

Parameters:
A -
B -
C -
D -
pt -
Returns:

norm

public final csVector3 norm()
The normal vector (or the (A,B,C) components).

Returns:

setNorm

public final void setNorm(csVector3 norm)
The normal vector (or the (A,B,C) components).

Parameters:
norm -

dd

public final float dd()
The D component of the plane.

Returns:

dd

public final void dd(float DD)
The D component of the plane.

Parameters:
DD -