|
Rings Version 0.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectthreeD.raytracer.engine.AbstractSurface
threeD.raytracer.engine.SurfaceGroup
threeD.raytracer.primitives.Mesh
A Mesh object stores a set of points (Vector objects) and allows triangles to be specified using those points.
| Nested Class Summary | |
protected static class |
Mesh.Vertex
|
| Constructor Summary | |
Mesh()
Constructs a new Mesh object. |
|
Mesh(Vector[] points,
int[][] triangles)
Constructs a new Mesh object. |
|
| Method Summary | |
void |
addSurface(Surface s)
Adds the specified Surface object to the list of triangles stored by this Mesh object. |
int |
addTriangle(int p1,
int p2,
int p3)
Adds the triangle described by the specified points to the mesh represented by this Mesh object. |
int |
addVector(Vector p)
Adds the point defined by the specified Vector object to the mesh represented by this Mesh object. |
Vector |
getNormalAt(Vector point)
Returns null. |
Surface |
getSurface(int index)
Returns the Surface object stored by this SurfaceGroup object at the specified index. |
Surface[] |
getSurfaces()
Returns the Surface objects stored by this SurfaceGroup object as a Surface array. |
Triangle[] |
getTriangles()
|
Mesh.Vertex[] |
getVectors()
|
boolean |
intersect(Ray ray)
Returns true if the ray represented by the specified Ray object intersects any of the surfaces represented by this SurfaceGroup object. |
Intersection |
intersectAt(Ray ray)
Returns an Intersection object that represents the ray-surface intersections for the AbstractSurface object which is intersected closest to the origin of the ray (>= 0). |
void |
removeSurface(int index)
Removes the Triangle object stored by this Mesh object at the specified index. |
void |
setSmooth(boolean smooth)
Sets the smooth flag for each Triangle object stored by this Mesh object. |
void |
setSurfaces(Surface[] surfaces)
Does nothing. |
| Methods inherited from class threeD.raytracer.engine.SurfaceGroup |
shade |
| Methods inherited from class threeD.raytracer.engine.AbstractSurface |
addShader, addTexture, addTransform, calculateTransform, getColor, getColorAt, getLocation, getParent, getRotationCoefficients, getScaleCoefficients, getShadeBack, getShadeFront, getShaderSet, getSize, getTexture, getTextures, getTextureSet, getTransform, getTransform, getTransforms, removeTexture, removeTransform, setColor, setLocation, setParent, setRotationCoefficients, setScaleCoefficients, setShadeBack, setShadeFront, setShaders, setSize, setTexture, setTextures, setTransform, setTransforms |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Mesh()
public Mesh(Vector[] points,
int[][] triangles)
points - Array of points to use.triangles - {{x0, y0, z0}, {x1, y1, z1},...} Where the int values
are indices in the points array.| Method Detail |
public int addVector(Vector p)
p - Vector object to add.
public int addTriangle(int p1,
int p2,
int p3)
p1 - Index of first point.p2 - Index of second point.p3 - Index of third point.
java.lang.IllegalArgumentException - if any of the indicies specified are not valid.public Mesh.Vertex[] getVectors()
public Triangle[] getTriangles()
public Vector getNormalAt(Vector point)
SurfaceGroup
getNormalAt in interface SurfacegetNormalAt in class SurfaceGrouppublic void setSmooth(boolean smooth)
smooth - Boolean flag to use.public boolean intersect(Ray ray)
SurfaceGroup
intersect in interface Surfaceintersect in class SurfaceGroupSurface.intersect(threeD.raytracer.engine.Ray)public Intersection intersectAt(Ray ray)
SurfaceGroup
intersectAt in interface SurfaceintersectAt in class SurfaceGroupSurface.intersectAt(threeD.raytracer.engine.Ray)public void setSurfaces(Surface[] surfaces)
setSurfaces in class SurfaceGrouppublic void addSurface(Surface s)
addSurface in class SurfaceGroupjava.lang.IllegalArgumentException - If the specified Surface object is not a Triangle object.public void removeSurface(int index)
removeSurface in class SurfaceGrouppublic Surface[] getSurfaces()
SurfaceGroup
getSurfaces in class SurfaceGrouppublic Surface getSurface(int index)
SurfaceGroup
getSurface in class SurfaceGroup
|
Rings Version 0.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||