org.xith3d.scenegraph
Class TexCoordGeneration

java.lang.Object
  extended by org.xith3d.scenegraph.SceneGraphObject
      extended by org.xith3d.scenegraph.NodeComponent
          extended by org.xith3d.scenegraph.TexCoordGeneration
All Implemented Interfaces:
java.lang.Comparable<TexCoordGeneration>, org.jagatoo.datatypes.Enableable, org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, StateTrackable<TexCoordGeneration>

public class TexCoordGeneration
extends NodeComponent
implements StateTrackable<TexCoordGeneration>, org.jagatoo.datatypes.Enableable

TexCoordGeneration defines attributes that apply to texture coordinates generation.


Nested Class Summary
static class TexCoordGeneration.CoordMode
           
 
Field Summary
static org.jagatoo.opengl.enums.TexCoordGenMode EYE_LINEAR
          Generates texture coordinates as a linear function in eye coordinates.
static org.jagatoo.opengl.enums.TexCoordGenMode NORMAL_MAP
           
static org.jagatoo.opengl.enums.TexCoordGenMode OBJECT_LINEAR
          Generates texture coordinates as a linear function in object coordinates.
static org.jagatoo.opengl.enums.TexCoordGenMode REFLECTION_MAP
           
static org.jagatoo.opengl.enums.TexCoordGenMode SPHERE_MAP
          Generates texture coordinates using a sphereical reflection mapping in eye coordinates.
static TexCoordGeneration.CoordMode TEXTURE_COORDINATE_1
           
static TexCoordGeneration.CoordMode TEXTURE_COORDINATE_2
           
static TexCoordGeneration.CoordMode TEXTURE_COORDINATE_3
           
static TexCoordGeneration.CoordMode TEXTURE_COORDINATE_4
           
 
Fields inherited from class org.xith3d.scenegraph.SceneGraphObject
XITH3D_USERDATAKEY_OLDUSERDATA
 
Constructor Summary
TexCoordGeneration()
          Constructs a new TexCoordGeneration object.
TexCoordGeneration(boolean enabled)
          Constructs a new TexCoordGeneration object.
TexCoordGeneration(org.jagatoo.opengl.enums.TexCoordGenMode genMode, TexCoordGeneration.CoordMode format)
          Constructs a new TexCoordGeneration object.
TexCoordGeneration(org.jagatoo.opengl.enums.TexCoordGenMode genMode, TexCoordGeneration.CoordMode format, org.openmali.vecmath2.Vector4f planeS)
          Constructs a new TexCoordGeneration object.
TexCoordGeneration(org.jagatoo.opengl.enums.TexCoordGenMode genMode, TexCoordGeneration.CoordMode format, org.openmali.vecmath2.Vector4f planeS, org.openmali.vecmath2.Vector4f planeT)
          Constructs a new TexCoordGeneration object.
TexCoordGeneration(org.jagatoo.opengl.enums.TexCoordGenMode genMode, TexCoordGeneration.CoordMode format, org.openmali.vecmath2.Vector4f planeS, org.openmali.vecmath2.Vector4f planeT, org.openmali.vecmath2.Vector4f planeR)
          Constructs a new TexCoordGeneration object.
TexCoordGeneration(org.jagatoo.opengl.enums.TexCoordGenMode genMode, TexCoordGeneration.CoordMode format, org.openmali.vecmath2.Vector4f planeS, org.openmali.vecmath2.Vector4f planeT, org.openmali.vecmath2.Vector4f planeR, org.openmali.vecmath2.Vector4f planeQ)
          Constructs a new TexCoordGeneration object.
 
Method Summary
 TexCoordGeneration cloneNodeComponent(boolean forceDuplicate)
          
 int compareTo(TexCoordGeneration o)
          
protected  void duplicateNodeComponent(NodeComponent original, boolean forceDuplicate)
          
 boolean equals(java.lang.Object o)
          
 void freeOpenGLResources(CanvasPeer canvasPeer)
          This method frees OpenGL resources (names) for all this NodeComponent and all child-components.
 TexCoordGeneration getCopy()
          
 TexCoordGeneration.CoordMode getFormat()
          Gets the texture format
 org.jagatoo.opengl.enums.TexCoordGenMode getGenMode()
          Gets the texture generation mode.
 org.openmali.vecmath2.Vector4f getPlaneQ()
          Gets the Q coordinate plane equation.
 org.openmali.vecmath2.Vector4f getPlaneR()
          Gets the R coordinate plane equation.
 org.openmali.vecmath2.Vector4f getPlaneS()
          Gets the S coordinate plane equation.
 org.openmali.vecmath2.Vector4f getPlaneT()
          Gets the T coordinate plane equation.
 long getStateId()
           
 StateNode getStateNode()
          
 boolean isEnabled()
          Is texture coordinate generation enabled or disabled
protected  void setChanged(boolean changed)
          
 void setEnabled(boolean state)
          Enables or disables texture coordinate generation
 void setFormat(TexCoordGeneration.CoordMode format)
          Sets the desired texture format (1D, 2D, 3D or 4D).
 void setGenMode(org.jagatoo.opengl.enums.TexCoordGenMode genMode)
          Sets the desired texture generation mode.
 void setPlaneQ(float planeQx, float planeQy, float planeQz, float planeQw)
          Sets the Q coordinate plane equation.
 void setPlaneQ(org.openmali.vecmath2.Vector4f planeQ)
          Sets the Q coordinate plane equation.
 void setPlaneR(float planeRx, float planeRy, float planeRz, float planeRw)
          Sets the R coordinate plane equation.
 void setPlaneR(org.openmali.vecmath2.Vector4f planeR)
          Sets the R coordinate plane equation.
 void setPlaneS(float planeSx, float planeSy, float planeSz, float planeSw)
          Sets the S coordinate plane equation.
 void setPlaneS(org.openmali.vecmath2.Vector4f planeS)
          Sets the S coordinate plane equation.
 void setPlaneT(float planeTx, float planeTy, float planeTz, float planeTw)
          Sets the T coordinate plane equation.
 void setPlaneT(org.openmali.vecmath2.Vector4f planeT)
          Sets the T coordinate plane equation.
 void setStateNode(StateNode node)
          Used by the render engine to set the state id for the node.
 java.lang.String toString()
          
 
Methods inherited from class org.xith3d.scenegraph.NodeComponent
freeOpenGLResources, getDuplicateOnCloneTree, getModListener, isChanged, isChanged2, setDuplicateOnCloneTree, setModListener
 
Methods inherited from class org.xith3d.scenegraph.SceneGraphObject
getName, getUserData, getUserData, getUserDataMap, isLive, setLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OBJECT_LINEAR

public static final org.jagatoo.opengl.enums.TexCoordGenMode OBJECT_LINEAR
Generates texture coordinates as a linear function in object coordinates.

See Also:
TexCoordGenMode.OBJECT_LINEAR

EYE_LINEAR

public static final org.jagatoo.opengl.enums.TexCoordGenMode EYE_LINEAR
Generates texture coordinates as a linear function in eye coordinates.

See Also:
TexCoordGenMode.OBJECT_LINEAR

SPHERE_MAP

public static final org.jagatoo.opengl.enums.TexCoordGenMode SPHERE_MAP
Generates texture coordinates using a sphereical reflection mapping in eye coordinates.

See Also:
TexCoordGenMode.OBJECT_LINEAR

NORMAL_MAP

public static final org.jagatoo.opengl.enums.TexCoordGenMode NORMAL_MAP
See Also:
TexCoordGenMode.OBJECT_LINEAR

REFLECTION_MAP

public static final org.jagatoo.opengl.enums.TexCoordGenMode REFLECTION_MAP
See Also:
TexCoordGenMode.OBJECT_LINEAR

TEXTURE_COORDINATE_1

public static final TexCoordGeneration.CoordMode TEXTURE_COORDINATE_1
See Also:
TexCoordGeneration.CoordMode.TEXTURE_COORDINATES_1

TEXTURE_COORDINATE_2

public static final TexCoordGeneration.CoordMode TEXTURE_COORDINATE_2
See Also:
TexCoordGeneration.CoordMode.TEXTURE_COORDINATES_2

TEXTURE_COORDINATE_3

public static final TexCoordGeneration.CoordMode TEXTURE_COORDINATE_3
See Also:
TexCoordGeneration.CoordMode.TEXTURE_COORDINATES_3

TEXTURE_COORDINATE_4

public static final TexCoordGeneration.CoordMode TEXTURE_COORDINATE_4
See Also:
TexCoordGeneration.CoordMode.TEXTURE_COORDINATES_4
Constructor Detail

TexCoordGeneration

public TexCoordGeneration()
Constructs a new TexCoordGeneration object.


TexCoordGeneration

public TexCoordGeneration(boolean enabled)
Constructs a new TexCoordGeneration object.

Parameters:
enabled -

TexCoordGeneration

public TexCoordGeneration(org.jagatoo.opengl.enums.TexCoordGenMode genMode,
                          TexCoordGeneration.CoordMode format)
Constructs a new TexCoordGeneration object.

Parameters:
genMode -
format -

TexCoordGeneration

public TexCoordGeneration(org.jagatoo.opengl.enums.TexCoordGenMode genMode,
                          TexCoordGeneration.CoordMode format,
                          org.openmali.vecmath2.Vector4f planeS)
Constructs a new TexCoordGeneration object.

Parameters:
genMode -
format -
planeS -

TexCoordGeneration

public TexCoordGeneration(org.jagatoo.opengl.enums.TexCoordGenMode genMode,
                          TexCoordGeneration.CoordMode format,
                          org.openmali.vecmath2.Vector4f planeS,
                          org.openmali.vecmath2.Vector4f planeT)
Constructs a new TexCoordGeneration object.

Parameters:
genMode -
format -
planeS -
planeT -

TexCoordGeneration

public TexCoordGeneration(org.jagatoo.opengl.enums.TexCoordGenMode genMode,
                          TexCoordGeneration.CoordMode format,
                          org.openmali.vecmath2.Vector4f planeS,
                          org.openmali.vecmath2.Vector4f planeT,
                          org.openmali.vecmath2.Vector4f planeR)
Constructs a new TexCoordGeneration object.

Parameters:
genMode -
format -
planeS -
planeT -
planeR -

TexCoordGeneration

public TexCoordGeneration(org.jagatoo.opengl.enums.TexCoordGenMode genMode,
                          TexCoordGeneration.CoordMode format,
                          org.openmali.vecmath2.Vector4f planeS,
                          org.openmali.vecmath2.Vector4f planeT,
                          org.openmali.vecmath2.Vector4f planeR,
                          org.openmali.vecmath2.Vector4f planeQ)
Constructs a new TexCoordGeneration object.

Parameters:
genMode -
format -
planeS -
planeT -
planeR -
planeQ -
Method Detail

setEnabled

public void setEnabled(boolean state)
Enables or disables texture coordinate generation

Specified by:
setEnabled in interface org.jagatoo.datatypes.Enableable

isEnabled

public final boolean isEnabled()
Is texture coordinate generation enabled or disabled

Specified by:
isEnabled in interface org.jagatoo.datatypes.Enableable

setChanged

protected void setChanged(boolean changed)

Overrides:
setChanged in class NodeComponent

setFormat

public final void setFormat(TexCoordGeneration.CoordMode format)
Sets the desired texture format (1D, 2D, 3D or 4D). TEXTURE_COORDINATE_1, TEXTURE_COORDINATE_2, TEXTURE_COORDINATE_3 or TEXTURE_COORDINATE_4


getFormat

public final TexCoordGeneration.CoordMode getFormat()
Gets the texture format


setGenMode

public final void setGenMode(org.jagatoo.opengl.enums.TexCoordGenMode genMode)
Sets the desired texture generation mode.


getGenMode

public final org.jagatoo.opengl.enums.TexCoordGenMode getGenMode()
Gets the texture generation mode.


setPlaneS

public final void setPlaneS(float planeSx,
                            float planeSy,
                            float planeSz,
                            float planeSw)
Sets the S coordinate plane equation.

Parameters:
planeSx -
planeSy -
planeSz -
planeSw -

setPlaneS

public final void setPlaneS(org.openmali.vecmath2.Vector4f planeS)
Sets the S coordinate plane equation.

Parameters:
planeS -

getPlaneS

public final org.openmali.vecmath2.Vector4f getPlaneS()
Gets the S coordinate plane equation.


setPlaneT

public final void setPlaneT(float planeTx,
                            float planeTy,
                            float planeTz,
                            float planeTw)
Sets the T coordinate plane equation.

Parameters:
planeTx -
planeTy -
planeTz -
planeTw -

setPlaneT

public final void setPlaneT(org.openmali.vecmath2.Vector4f planeT)
Sets the T coordinate plane equation.

Parameters:
planeT -

getPlaneT

public final org.openmali.vecmath2.Vector4f getPlaneT()
Gets the T coordinate plane equation.


setPlaneR

public final void setPlaneR(float planeRx,
                            float planeRy,
                            float planeRz,
                            float planeRw)
Sets the R coordinate plane equation.

Parameters:
planeRx -
planeRy -
planeRz -
planeRw -

setPlaneR

public final void setPlaneR(org.openmali.vecmath2.Vector4f planeR)
Sets the R coordinate plane equation.

Parameters:
planeR -

getPlaneR

public final org.openmali.vecmath2.Vector4f getPlaneR()
Gets the R coordinate plane equation.


setPlaneQ

public final void setPlaneQ(float planeQx,
                            float planeQy,
                            float planeQz,
                            float planeQw)
Sets the Q coordinate plane equation.

Parameters:
planeQx -
planeQy -
planeQz -
planeQw -

setPlaneQ

public final void setPlaneQ(org.openmali.vecmath2.Vector4f planeQ)
Sets the Q coordinate plane equation.

Parameters:
planeQ -

getPlaneQ

public final org.openmali.vecmath2.Vector4f getPlaneQ()
Gets the Q coordinate plane equation.


toString

public java.lang.String toString()

Overrides:
toString in class SceneGraphObject

duplicateNodeComponent

protected void duplicateNodeComponent(NodeComponent original,
                                      boolean forceDuplicate)

Overrides:
duplicateNodeComponent in class NodeComponent

cloneNodeComponent

public TexCoordGeneration cloneNodeComponent(boolean forceDuplicate)

Specified by:
cloneNodeComponent in class NodeComponent

freeOpenGLResources

public void freeOpenGLResources(CanvasPeer canvasPeer)
This method frees OpenGL resources (names) for all this NodeComponent and all child-components.

Specified by:
freeOpenGLResources in class NodeComponent

setStateNode

public final void setStateNode(StateNode node)
Used by the render engine to set the state id for the node.

Specified by:
setStateNode in interface StateTrackable<TexCoordGeneration>

getStateNode

public final StateNode getStateNode()

Specified by:
getStateNode in interface StateTrackable<TexCoordGeneration>
Returns:
the id of the object. This should return -1 if there is no assigned id.

getStateId

public final long getStateId()

getCopy

public TexCoordGeneration getCopy()

Specified by:
getCopy in interface StateTrackable<TexCoordGeneration>
Returns:
a copy of the state of the referenced trackable object.

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(TexCoordGeneration o)

Specified by:
compareTo in interface java.lang.Comparable<TexCoordGeneration>