|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.threed.jpct.PolygonManager
A PolygonManager is part of each Object3D and can be obtained from that
object. It allows to access an object's polygonal data that's normally hidden
inside of jPCT.
The polygon ID that most methods require can be obtained by "wild guessing",
by picking a specific polygon or from a CollisionEvent.
When using a PolygonManager on a compiled object, it may be required to
synchronize your changes to the FrameBuffer by using the FrameBuffer's lock
object.
Object3D.getPolygonManager()
,
CollisionEvent
,
FrameBuffer.getLock()
Method Summary | |
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. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public int getPolygonTexture(int polyID)
polyID
- int the ID of the polygon
TextureManager.getTextureByID(int)
public int[] getPolygonTextures(int polyID)
polyID
- int the ID of the polygon
TextureManager.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 returned
public SimpleVector getTransformedNormal(int polyID)
polyID
- int the ID of the polygon
public 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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |