|
Jazz3D API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sygem.jazz3d3.Object3d
Contains all vertex and face information relating to a single object.
Constructor Summary | |
Object3d(double xx,
double yy,
double zz)
Default constructor. |
Method Summary | |
int |
addChild(Object3d child,
double xp,
double yp,
double zp)
Add a child object to this object. |
void |
addQuad(Quad t)
Add a quad to this object. |
void |
addTriangle(Triangle t)
Add a triangle to this object. |
void |
addVertex(int num,
float xx,
float yy,
float zz)
Add a vertex to the object. |
void |
applyFaceChanges()
Forces Jazz3D to recalculate the vertex colours of an object. |
void |
cleanUp()
Shrinks the vertex and face containers to their minimum size. |
Vertex |
getCenter()
Returns a vertex representing the center point of this object. |
Object3d[] |
getChildObjects()
Gets an array full of all the child objects this object currently has. |
boolean |
getCollidable()
Find out if the object is collidable. |
boolean |
getCulling()
Returns the status of the backface culling. |
Shape |
getFace(int faceid)
Get a particular face from this object. |
int |
getFaceColour(int faceid)
Returns the colour of the specified face. |
int |
getID()
Get the numerical identifier of this object. |
java.lang.String |
getName()
Get the name identifier of this object. |
int |
getNumberOfFaces()
Get the number of faces in the object. |
int |
getNumberOfSubFaces()
Get the number of faces in the object (including sub-objects). |
int |
getNumberOfSubVertices()
Get the number of vertices in the object (including sub-objects). |
int |
getNumberOfVertices()
Get the number of vertices in the object. |
Render |
getRenderer()
Gets the current renderer being used with this object. |
Shape[] |
getShapeArray()
Gets an array full of all the faces this object currently has. |
boolean |
getUseVertexUVCoords()
Returns true if vertex UV coordinates are being used, false if not. |
Vertex |
getVertex(int vertid)
Get a particular vertex from this object. |
Vertex[] |
getVertexArray()
Gets an array full of all the vertices this object currently has. |
boolean |
getVisible()
Returns the visibility of the object. |
Vertex |
getWorldVertex(int vertid)
Get a particular vertex from this object, the coordinates of which will be in world-space. |
boolean |
pick(Vertex start,
Vertex end)
Casts a ray between 2 points in space, and tests to see if any of the faces in this object collide with it. |
boolean |
pickClosest(Vertex start,
Vertex end)
Casts a ray between 2 points in space, and tests to see if any of the faces in this object collide with it. |
boolean |
pickFace(Vertex start,
Vertex end,
int faceID)
Casts a ray between 2 points in space, and tests to see if a particular face in this object collide with it. |
void |
prepForDisplay(boolean bbon)
Finalizes any object creation activities (like bounding-box creation). |
void |
recreateVertexNormals()
Force the recreation of all vertex normals. |
void |
rotateLocal(double xx,
double yy,
double zz)
Rotates the object a given amount around the object's own axis. |
void |
rotateLocal(double xx,
double yy,
double zz,
double px,
double py,
double pz)
Rotates the object a given amount around a specified point, around the object's own axis. |
void |
rotateWorld(double xx,
double yy,
double zz)
Rotates the object a given amount around the static world axis. |
void |
rotateWorld(double xx,
double yy,
double zz,
double px,
double py,
double pz)
Rotates the object a given amount around a specified point, around the static world axis. |
void |
scaleObject(double xs,
double ys,
double zs)
Scales the object, relative to its current size. |
void |
setAllTextures(int texid)
Sets the texture for all object faces. |
void |
setAmbientColour(int r,
int g,
int b)
Sets the ambient colour of an object. |
void |
setCollidable(boolean collide)
Toggles whether or not this object can be collided with. |
void |
setColour(int r,
int g,
int b)
Sets the colour of the whole object. |
void |
setCulling(boolean cull)
Toggles the use of backface culling for this object. |
void |
setFaceColour(int faceid,
int r,
int g,
int b)
Set the colour of an individual face. |
void |
setFaceColourQuick(int faceid,
int r,
int g,
int b)
Set the colour of an individual face. |
void |
setName(java.lang.String newName)
Sets the name identifier of this object. |
void |
setPosition(double xx,
double yy,
double zz)
Allows you to set the position of the object directly. |
void |
setRenderer(Render newRenderer)
Sets the renderer to be used with this object. |
void |
setShapeArray(Shape[] s)
Sets all of the faces for this object. |
void |
setTexture(int texid)
Sets the texture for this object. |
void |
setTexture(int faceid,
int texid)
Sets the texture for a given face. |
void |
setUseVertexUVCoords(boolean uv)
Instruct the texture mappers to use UV coordinates from vertices, not faces. |
void |
setVertexArray(Vertex[] v)
Sets all of the vertices for this object. |
void |
setVertexTexture(int vertexid,
int texid)
Sets the image to be rendered at a given vertex. |
void |
setVisible(boolean visible)
Toggles object visibility. |
void |
translateLocal(double xx,
double yy,
double zz)
Translate the object relative to its own axis. |
void |
translateWorld(double xx,
double yy,
double zz)
Translate the object relative to the static world axis. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Object3d(double xx, double yy, double zz)
xx
- The x position of the center of the object.yy
- The y position of the center of the object.zz
- The z position of the center of the object.Method Detail |
public final void setName(java.lang.String newName)
newName
- The name of this objectWorld.getObject(String)
,
getName()
public final java.lang.String getName()
World.getObject(String)
,
setName(String)
public final int getID()
World.getObject(String)
public final void recreateVertexNormals()
public final int addChild(Object3d child, double xp, double yp, double zp)
NOTE: The pivot point is a point in space relative to the center of the object.
child
- Any valid object - primitive or model.xp
- The x position of the pivot point, used when rotating the childyp
- The y position of the pivot point, used when rotating the childzp
- The z position of the pivot point, used when rotating the childpublic final void addTriangle(Triangle t)
t
- A TriangleaddVertex(int, float, float, float)
,
Triangle
public final void addQuad(Quad t)
t
- A QuadaddVertex(int, float, float, float)
,
Quad
public final void cleanUp()
public final void setTexture(int texid)
texid
- An integer as returned by the setTexture() method of the renderer.RenderTextured.setTexture(com.sygem.jazz3d3.Texture)
public final void setTexture(int faceid, int texid)
faceid
- The face (polygon) of the object. Numbered from zero.texid
- An integer as returned by the setTexture() method of the renderer.RenderTextured.setTexture(com.sygem.jazz3d3.Texture)
public final void setAllTextures(int texid)
texid
- An integer as returned by the setTexture() method of the renderer.RenderTextured.setTexture(com.sygem.jazz3d3.Texture)
public final Shape getFace(int faceid)
faceid
- The id of the face you want - starts from zero.public final int getNumberOfFaces()
public final int getNumberOfSubFaces()
public final Vertex getVertex(int vertid)
vertid
- The id of the vertex you want - starts from zero.public Vertex getWorldVertex(int vertid)
vertid
- The id of the vertex you want - starts from zero.public final int getNumberOfVertices()
public final int getNumberOfSubVertices()
public final Object3d[] getChildObjects()
addChild(com.sygem.jazz3d3.Object3d, double, double, double)
public final Vertex[] getVertexArray()
public final void setVertexArray(Vertex[] v)
v
- An array of VertexesgetVertexArray()
public final Shape[] getShapeArray()
public final void setShapeArray(Shape[] s)
s
- An array of ShapesgetShapeArray()
public final void addVertex(int num, float xx, float yy, float zz)
cleanUp()
public final Vertex getCenter()
Vertex
public final void setRenderer(Render newRenderer)
newRenderer
- The renderer to be used.public final Render getRenderer()
public final void setUseVertexUVCoords(boolean uv)
public final boolean getUseVertexUVCoords()
public final void translateWorld(double xx, double yy, double zz)
xx
- The distance along the x-axis to translate.yy
- The distance along the x-axis to translate.zz
- The distance along the x-axis to translate.public final void translateLocal(double xx, double yy, double zz)
xx
- The distance along the x-axis to translate.yy
- The distance along the x-axis to translate.zz
- The distance along the x-axis to translate.public final void setPosition(double xx, double yy, double zz)
xx
- The new x position of the center of the objectyy
- The new y position of the center of the objectzz
- The new z position of the center of the objectpublic final void rotateWorld(double xx, double yy, double zz)
xx
- The number of degrees to rotate the object around the x-axis.yy
- The number of degrees to rotate the object around the y-axis.zz
- The number of degrees to rotate the object around the z-axis.rotateWorld(double, double, double, double, double, double)
public final void rotateWorld(double xx, double yy, double zz, double px, double py, double pz)
xx
- The number of degrees to rotate the object around the x-axis.yy
- The number of degrees to rotate the object around the y-axis.zz
- The number of degrees to rotate the object around the z-axis.px
- The x position of the point to rotate around.py
- The y position of the point to rotate around.pz
- The z position of the point to rotate around.rotateWorld(double, double, double)
public final void rotateLocal(double xx, double yy, double zz)
xx
- The number of degrees to rotate the object around the x-axis.yy
- The number of degrees to rotate the object around the y-axis.zz
- The number of degrees to rotate the object around the z-axis.rotateLocal(double, double, double, double, double, double)
public final void rotateLocal(double xx, double yy, double zz, double px, double py, double pz)
xx
- The number of degrees to rotate the object around the x-axis.yy
- The number of degrees to rotate the object around the y-axis.zz
- The number of degrees to rotate the object around the z-axis.px
- The x position of the point to rotate around.py
- The y position of the point to rotate around.pz
- The z position of the point to rotate around.rotateLocal(double, double, double)
public final void scaleObject(double xs, double ys, double zs)
xs
- The amount to scale along the x-axisys
- The amount to scale along the y-axiszs
- The amount to scale along the z-axispublic final void setFaceColour(int faceid, int r, int g, int b)
setFaceColourQuick()
.faceid
- The face to change the colour of.r
- The red component of the new face colour.g
- The green component of the new face colour.b
- The blue component of the new face colour.setFaceColourQuick(int, int, int, int)
public final void setFaceColourQuick(int faceid, int r, int g, int b)
applyFaceChanges()
once you have completed the face colour changes.faceid
- The face to change the colour of.r
- The red component of the new face colour.g
- The green component of the new face colour.b
- The blue component of the new face colour.applyFaceChanges()
,
setFaceColour(int, int, int, int)
public final void applyFaceChanges()
setFaceColourFast()
.setFaceColourQuick(int, int, int, int)
public final void setColour(int r, int g, int b)
r
- The red component of the new object colour.g
- The green component of the new object colour.b
- The blue component of the new object colour.public final int getFaceColour(int faceid)
int faceColour = myObject.getFaceColour(2);
int red = (faceColour & 0xFF0000) >> 16;
int green = (faceColour & 0x00FF00) >> 8;
int blue = (faceColour & 0x0000FF);
faceid
- The face you want to find the colour of.public final void setAmbientColour(int r, int g, int b)
r
- The red component of the new ambient colour.g
- The green component of the new ambient colour.b
- The blue component of the new ambient colour.public final void setCulling(boolean cull)
cull
- True if backface culling is to be used, and false if not.getCulling()
public final boolean getCulling()
setCulling(boolean)
public final void setVisible(boolean visible)
visible
- True if the object should be visible, and false if not.public final boolean getVisible()
setVisible(boolean)
public final void prepForDisplay(boolean bbon)
bbon
- Set this to true if you want the object's bounding box to be createdpublic final void setVertexTexture(int vertexid, int texid)
RenderOutline
renderer.vertexid
- An integer referencing a vertex in the object.texid
- An integer as returned by the setVertexImage() method of the renderer.RenderOutline.setVertexImage(com.sygem.jazz3d3.Texture)
public final void setCollidable(boolean collide)
By default, all objects are collidable.
collide
- True if this object should be collidable, false if notpublic final boolean getCollidable()
public final boolean pick(Vertex start, Vertex end)
HitPoint
class. Only one collision is recorded per object - as soon as a collision
is detected, no more faces are tested.start
- The start point of the rayend
- The end point of the rayVertex
,
HitPoint
public final boolean pickClosest(Vertex start, Vertex end)
HitPoint
class. Only information about the closest collision is recorded.start
- The start point of the rayend
- The end point of the rayVertex
,
HitPoint
public final boolean pickFace(Vertex start, Vertex end, int faceID)
HitPoint
class.start
- The start point of the rayend
- The end point of the rayfaceID
- The face to testVertex
,
HitPoint
|
©2001 SyGem Software |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |