crystalspace.jbind.impl.csgeom.transfrm
Class csTransform

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csgeom.transfrm.csTransform
All Implemented Interfaces:
iPointer
Direct Known Subclasses:
csOrthoTransform, csReversibleTransform

public class csTransform
extends csNativeObject

A class which defines a transformation from one coordinate system to another.

Author:
Quentin Anciaux

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Constructor Summary
csTransform()
          Initialize with the identity transformation.
csTransform(csMatrix3 other2this, csVector3 origin_pos)
          Initialize with the given transformation.
csTransform(iPointer nPointer)
          Create a java csTransform object which points to the native csTransform nPointer.
 
Method Summary
 csMatrix3 getO2T()
          Get 'other' to 'this' transformation matrix.
 csVector3 getO2TTranslation()
          Get 'world' to 'this' translation.
 csVector3 getOrigin()
          Get origin of transformed coordinate system.
static csTransform getReflect(csPlane3 pl)
          Return a transform that represents a mirroring across a plane.
 void identity()
          Reset this transform to the identity transform.
 boolean isIdentity()
          Returns true if this transform is an identity transform.
protected  boolean isNativePointerValidSafe(long nPointer)
           
static csMatrix3 mul(csMatrix3 m, csTransform t)
          Multiply a matrix with the transformation matrix.
static csPlane3 mul(csPlane3 p, csTransform t)
          Apply a transformation to a Plane.
static csSphere mul(csSphere s, csTransform t)
          Apply a transformation to a sphere.
static csMatrix3 mul(csTransform t, csMatrix3 m)
          Multiply a matrix with the transformation matrix.
static csPlane3 mul(csTransform t, csPlane3 p)
          Apply a transformation to a Plane.
static csTransform mul(csTransform t1, csReversibleTransform t2)
          Combine two transforms, rightmost first.
static csSphere mul(csTransform t, csSphere s)
          Apply a transformation to a sphere.
static csVector3 mul(csTransform t, csVector3 v)
          Apply a transformation to a 3D vector.
static csVector3 mul(csVector3 v, csTransform t)
          Apply a transformation to a 3D vector.
static csMatrix3 mule(csMatrix3 m, csTransform t)
          Multiply a matrix with the transformation matrix.
static csPlane3 mule(csPlane3 p, csTransform t)
          Apply a transformation to a Plane.
static csSphere mule(csSphere s, csTransform t)
          Apply a transformation to a sphere.
static csVector3 mule(csVector3 v, csTransform t)
          Apply a transformation to a 3D vector.
protected  void nDelete(long pointer)
           
 csPlane3 other2This(csPlane3 p)
          Convert a plane in 'other' space to 'this' space.
 void other2This(csPlane3 p, csVector3 point, csPlane3 result)
          Convert a plane in 'other' space to 'this' space.
 csSphere other2This(csSphere s)
          Convert a sphere in 'other' space to 'this' space.
 csVector3 other2This(csVector3 v)
          Transform vector in 'other' space v to a vector in 'this' space.
 csPlane3 other2ThisRelative(csPlane3 p)
          Convert a plane in 'other' space to 'this' space.
 csVector3 other2ThisRelative(csVector3 v)
          Convert vector v in 'other' space to a vector in 'this' space.
 void setO2T(csMatrix3 m)
          Set 'other' to 'this' transformation matrix.
 void setO2TTranslation(csVector3 v)
          Set 'world' to 'this' translation.
 void setOrigin(csVector3 v)
          Set origin of transformed coordinate system.
 void translate(csVector3 v)
          Move the 'other' to 'this' translation by a specified amount.
 
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

csTransform

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

Parameters:
nPointer -

csTransform

public csTransform()
Initialize with the identity transformation.


csTransform

public csTransform(csMatrix3 other2this,
                   csVector3 origin_pos)
Initialize with the given transformation.

Parameters:
other2this -
origin_pos -
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()

identity

public final void identity()
Reset this transform to the identity transform.


isIdentity

public final boolean isIdentity()
Returns true if this transform is an identity transform.

Returns:

getO2T

public final csMatrix3 getO2T()
Get 'other' to 'this' transformation matrix.

Returns:

getO2TTranslation

public final csVector3 getO2TTranslation()
Get 'world' to 'this' translation.

Returns:

getOrigin

public final csVector3 getOrigin()
Get origin of transformed coordinate system.

Returns:

setOrigin

public final void setOrigin(csVector3 v)
Set origin of transformed coordinate system.

Parameters:
v -

setO2T

public final void setO2T(csMatrix3 m)
Set 'other' to 'this' transformation matrix.

Parameters:
m -

setO2TTranslation

public final void setO2TTranslation(csVector3 v)
Set 'world' to 'this' translation.

Parameters:
v -

translate

public final void translate(csVector3 v)
Move the 'other' to 'this' translation by a specified amount.

Parameters:
v -

other2This

public final csVector3 other2This(csVector3 v)
Transform vector in 'other' space v to a vector in 'this' space.

Parameters:
v -
Returns:

other2ThisRelative

public final csVector3 other2ThisRelative(csVector3 v)
Convert vector v in 'other' space to a vector in 'this' space.

Parameters:
v -
Returns:

other2This

public final csPlane3 other2This(csPlane3 p)
Convert a plane in 'other' space to 'this' space.

Parameters:
p -
Returns:

other2ThisRelative

public final csPlane3 other2ThisRelative(csPlane3 p)
Convert a plane in 'other' space to 'this' space.

Parameters:
p -
Returns:

other2This

public final void other2This(csPlane3 p,
                             csVector3 point,
                             csPlane3 result)
Convert a plane in 'other' space to 'this' space.

Parameters:
p -
point -
result -

other2This

public final csSphere other2This(csSphere s)
Convert a sphere in 'other' space to 'this' space.

Parameters:
s -
Returns:

getReflect

public static final csTransform getReflect(csPlane3 pl)
Return a transform that represents a mirroring across a plane.

Parameters:
pl -
Returns:

mul

public static final csVector3 mul(csVector3 v,
                                  csTransform t)
Apply a transformation to a 3D vector.

Parameters:
v -
t -
Returns:

mul

public static final csVector3 mul(csTransform t,
                                  csVector3 v)
Apply a transformation to a 3D vector.

Parameters:
t -
v -
Returns:

mule

public static final csVector3 mule(csVector3 v,
                                   csTransform t)
Apply a transformation to a 3D vector.

Parameters:
v -
t -
Returns:

mul

public static final csPlane3 mul(csPlane3 p,
                                 csTransform t)
Apply a transformation to a Plane.

Parameters:
p -
t -
Returns:

mul

public static final csPlane3 mul(csTransform t,
                                 csPlane3 p)
Apply a transformation to a Plane.

Parameters:
t -
p -
Returns:

mule

public static final csPlane3 mule(csPlane3 p,
                                  csTransform t)
Apply a transformation to a Plane.

Parameters:
p -
t -
Returns:

mul

public static final csSphere mul(csSphere s,
                                 csTransform t)
Apply a transformation to a sphere.

Parameters:
s -
t -
Returns:

mul

public static final csSphere mul(csTransform t,
                                 csSphere s)
Apply a transformation to a sphere.

Parameters:
t -
s -
Returns:

mule

public static final csSphere mule(csSphere s,
                                  csTransform t)
Apply a transformation to a sphere.

Parameters:
s -
t -
Returns:

mul

public static final csMatrix3 mul(csMatrix3 m,
                                  csTransform t)
Multiply a matrix with the transformation matrix.

Parameters:
m -
t -
Returns:

mul

public static final csMatrix3 mul(csTransform t,
                                  csMatrix3 m)
Multiply a matrix with the transformation matrix.

Parameters:
t -
m -
Returns:

mule

public static final csMatrix3 mule(csMatrix3 m,
                                   csTransform t)
Multiply a matrix with the transformation matrix.

Parameters:
m -
t -
Returns:

mul

public static final csTransform mul(csTransform t1,
                                    csReversibleTransform t2)
Combine two transforms, rightmost first.

Parameters:
t1 -
t2 -
Returns: