public class PolygonManager
extends java.lang.Object
Object3D.getPolygonManager()
,
CollisionEvent
Modifier and Type | Method and Description |
---|---|
void |
addTexture(int polyID,
int tid,
int mode)
Adds a texture to next free stage, if another free stage is available.
|
int |
getMaxPolygonID()
Returns the maximum polygon ID for the object.
|
int |
getPolygonTexture(int polyID)
Returns the texture ID of a polygon or -1 in case of an error.
|
int[] |
getPolygonTextures(int polyID)
Returns the texture IDs of a polygon or null in case of an error.
|
SimpleVector |
getTextureUV(int polyID,
int vertexNumber)
Returns the normalized texture coordinates mapped to a SimpleVector's x
and y component.
|
SimpleVector |
getTextureUV(int polyID,
int vertexNumber,
SimpleVector toFill)
Returns the normalized texture coordinates mapped to a SimpleVector's x
and y component.
|
SimpleVector |
getTransformedNormal(int polyID)
Returns a polygon's face normal transformed into world space.
|
SimpleVector |
getTransformedNormal(int polyID,
Matrix worldTransformationMatrix,
SimpleVector toFill)
Returns a polygon's face normal transformed into world space.
|
SimpleVector |
getTransformedVertex(int polyID,
int vertexNumber)
Returns a polygon's vertex transformed into world space.
|
SimpleVector |
getTransformedVertex(int polyID,
int vertexNumber,
Matrix worldTransformationMatrix,
SimpleVector toFill)
Returns a polygon's vertex transformed into world space.
|
void |
setPolygonTexture(int polyID,
int textureID)
Sets the texture for a polygon.
|
void |
setPolygonTexture(int polyID,
TextureInfo tInf)
Sets the textures and its coordinates for a polygon.
|
void |
setVertexAlpha(int polyID,
int vertexNumber,
float alpha)
Sets the alpha value for an objects vertex.
|
public int getPolygonTexture(int polyID)
polyID
- int the ID of the polygonTextureManager.getTextureByID(int)
public int[] getPolygonTextures(int polyID)
polyID
- int the ID of the polygonTextureManager.getTextureByID(int)
public void setPolygonTexture(int polyID, int textureID)
polyID
- the ID of the polygontextureID
- the ID of the texturepublic void addTexture(int polyID, int tid, int mode)
polyID
- the polygon idtid
- the texture's idmode
- the blending mode (as defined in TextureInfo)TextureInfo
public void setPolygonTexture(int polyID, TextureInfo tInf)
polyID
- int the ID of the polygontInf
- TextureInfo the TextureInfo containing the new texturing
informationpublic void setVertexAlpha(int polyID, int vertexNumber, float alpha)
polyID
- int the ID of the polygonvertexNumber
- int the number if the vertex (0..2)alpha
- the new alpha value in a range of (0..1)public SimpleVector getTransformedVertex(int polyID, int vertexNumber)
polyID
- int the ID of the polygonvertexNumber
- int the number if the vertex (0..2)public SimpleVector getTransformedVertex(int polyID, int vertexNumber, Matrix worldTransformationMatrix, SimpleVector toFill)
polyID
- int the ID of the polygonvertexNumber
- int the number if the vertex (0..2)worldTransformationMatrix
- Matrix the object's world transformation. May be null, but
that will decrease performance of multiple calls.toFill
- SimpleVector the SimpleVector to be filled with the result.public SimpleVector getTextureUV(int polyID, int vertexNumber)
polyID
- int the ID of the polygonvertexNumber
- int the number if the vertex (0..2)public SimpleVector getTextureUV(int polyID, int vertexNumber, SimpleVector toFill)
polyID
- int the ID of the polygonvertexNumber
- int the number if the vertex (0..2)toFill
- SimpleVector the SimpleVector that will be filled with the
result and then returnedpublic SimpleVector getTransformedNormal(int polyID)
polyID
- int the ID of the polygonpublic SimpleVector getTransformedNormal(int polyID, Matrix worldTransformationMatrix, SimpleVector toFill)
polyID
- int the ID of the polygonworldTransformationMatrix
- Matrix the object's world transformation. May be null, but
that will decrease performance of multiple calls.toFill
- SimpleVector the SimpleVector to be filled with the result.public int getMaxPolygonID()