org.jagatoo.loaders.models.ac3d
Class AC3DSurface

java.lang.Object
  extended by org.jagatoo.loaders.models.ac3d.AC3DSurface

public class AC3DSurface
extends java.lang.Object

Contains all the information for a surface The vertex references and texture coordinates are returned in arrays, these arrays are ordered the same, so index i in the vertex reference array referes to the same vertex as as index i in the texture coordinate array.


Field Summary
static int CLOSED_LINE
          closed line type
static int LINE
          open line type
static int POLYGON
          polygon type
 
Constructor Summary
AC3DSurface(int type, boolean twoSided, boolean shaded, int material, int[] surfVerts, float[] textCoords)
          Creates new AC3DSurface
 
Method Summary
 int getMaterialIndex()
          Gets the material id of this surface
 float[] getTextureCoordinates()
           
 int getType()
           
 java.lang.Object getUserObject()
           
 int getVertexReferenceCount()
          Gets the vertex count, used to verify that this surface is valid e.g. that asa poly it must have more than 3 vertecies
 int[] getVertexReferences()
          Gets vertecies as reference to vertecies in the parent AC3DObject
 boolean hasTextureCoordinates()
           
 boolean isLine()
          Is this surface a line?
 boolean isShaded()
           
 boolean isTwoSided()
          Is this surface two sided?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POLYGON

public static final int POLYGON
polygon type

See Also:
Constant Field Values

CLOSED_LINE

public static final int CLOSED_LINE
closed line type

See Also:
Constant Field Values

LINE

public static final int LINE
open line type

See Also:
Constant Field Values
Constructor Detail

AC3DSurface

public AC3DSurface(int type,
                   boolean twoSided,
                   boolean shaded,
                   int material,
                   int[] surfVerts,
                   float[] textCoords)
Creates new AC3DSurface

Parameters:
type - The type of this object
twoSided - Indication of twosided/singlesided
shaded - Indication of shadinging on/off
material - The index to the material to use
surfVerts - The index of the vertex
textCoords - The texture coordinates (unmodified)
Method Detail

getType

public int getType()
Returns:
The type of this surface

getVertexReferenceCount

public int getVertexReferenceCount()
Gets the vertex count, used to verify that this surface is valid e.g. that asa poly it must have more than 3 vertecies

Returns:
The number of vertecies on this surface

getVertexReferences

public int[] getVertexReferences()
Gets vertecies as reference to vertecies in the parent AC3DObject

Returns:
The vertex references

hasTextureCoordinates

public boolean hasTextureCoordinates()

getTextureCoordinates

public float[] getTextureCoordinates()
Returns:
The texture coordinates

isLine

public boolean isLine()
Is this surface a line?

Returns:
True if this surface is a line

isTwoSided

public boolean isTwoSided()
Is this surface two sided?

Returns:
True if this surface is two sided

isShaded

public boolean isShaded()
Returns:
True if this surface is a line

getMaterialIndex

public int getMaterialIndex()
Gets the material id of this surface

Returns:
The material ID

getUserObject

public java.lang.Object getUserObject()