CubeTwister 2.0alpha141 2011-10-13

idx3d
Class idx3d_Object

java.lang.Object
  extended by idx3d.idx3d_CoreObject
      extended by idx3d.idx3d_Node
          extended by idx3d.idx3d_Object

public class idx3d_Object
extends idx3d_Node

Represents a three dimensional shape.

Version:
4.1 2006-02-21 Werner Randelshofer: Avoid unecessary object creation.
4.0 2004-08-29 Werner Randelshofer: Changed superclass to idx3d_Node. Moved variables 'parent' and 'isDirty' to superclass.
3.2 2003-12-18 Werner Randelshofer: Method incorporateGeometry(idx3d_Object) added. Method removeDegeneratedTriangles iterates in reverse order to prevent index mismatches when removing triangles. Moved responsibility for texture location from class idx3d_Vertex to this class. Dependency note: This change also requires changes in idx3d_Vertex, idx3d_Triangle, idx3d_TextureProjector, idx3d_Rasterizer. Method getTriangleCount added.

Field Summary
 int id
           
 idx3d_InternalMaterial material
           
 java.lang.String name
           
 java.util.Vector triangleData
           
 int triangles
           
 java.lang.String user
           
 java.lang.Object userData
           
 java.util.Vector vertexData
           
 int vertices
           
 boolean visible
           
 
Fields inherited from class idx3d.idx3d_Node
EMPTY_ENUMERATION, parent
 
Fields inherited from class idx3d.idx3d_CoreObject
matrix, normalmatrix
 
Constructor Summary
idx3d_Object()
           
 
Method Summary
 void addTriangle(idx3d_Triangle newTriangle)
           
 void addTriangle(idx3d_Vertex a, idx3d_Vertex b, idx3d_Vertex c)
           
 void addTriangle(idx3d_Vertex a, idx3d_Vertex b, idx3d_Vertex c, float u1, float v1, float u2, float v2, float u3, float v3)
           
 void addTriangle(int vertex1, int vertex2, int vertex3)
           
 void addTriangle(int vertex1, int vertex2, int vertex3, float u1, float v1, float u2, float v2, float u3, float v3)
           
 void addVertex(float x, float y, float z)
           
 void addVertex(idx3d_Vertex newVertex)
           
 void detach()
          Centers the object in its coordinate system The offset from origin to object center will be transfered o the matrix, so your object actually does not move.
 idx3d_Vector getCenter()
          Returns the center of this object.
 idx3d_Object getClone()
           
 idx3d_Vector getDimension()
          Returns the x,y,z - Dimension of this object.
 idx3d_Matrix getNormalProjection()
          Computes the normal projection and returns it.
 idx3d_Matrix getNormalProjectionInto(idx3d_Matrix normalProjection)
           
 int getTriangleCount()
           
 idx3d_Matrix getVertexProjection()
          Computes the vertex projection matrix and returns it.
 idx3d_Matrix getVertexProjectionInto(idx3d_Matrix vertexProjection)
           
 void incorporateGeometry(idx3d_Object that)
          Incorporates the geometry of the supplied object into this object.
 void matrixMeltdown()
          Applies the transformations in the matrix to all vertices and resets the matrix to untransformed.
 idx3d_Vector max()
           
 void meshSmooth()
           
 idx3d_Vector min()
           
 void rebuild()
           
 void regenerate()
          Regenerates the vertex normals.
 void removeDegeneratedTriangles()
           
 void removeDuplicateVertices()
           
 void removeTriangle(idx3d_Triangle t)
           
 void removeTriangleAt(int pos)
           
 void removeVertex(idx3d_Vertex v)
           
 void removeVertexAt(int pos)
           
 void scaleTextureCoordinates(float fu, float fv)
           
 void setMaterial(idx3d_InternalMaterial m)
           
 void tilt(float fact)
           
 java.lang.String toString()
           
 idx3d_Triangle triangle(int id)
           
 void validate()
          Validates this node and all its children.
 idx3d_Vertex vertex(int id)
           
 
Methods inherited from class idx3d.idx3d_Node
children, getParent, invalidate, isValid
 
Methods inherited from class idx3d.idx3d_CoreObject
getPos, resetTransform, rotate, rotate, rotateSelf, rotateSelf, scale, scale, scaleSelf, scaleSelf, setPos, setPos, setTransform, shift, shift, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

userData

public java.lang.Object userData

user

public java.lang.String user

vertexData

public java.util.Vector vertexData

triangleData

public java.util.Vector triangleData

id

public int id

name

public java.lang.String name

visible

public boolean visible

vertices

public int vertices

triangles

public int triangles

material

public idx3d_InternalMaterial material
Constructor Detail

idx3d_Object

public idx3d_Object()
Method Detail

vertex

public idx3d_Vertex vertex(int id)

triangle

public idx3d_Triangle triangle(int id)

getTriangleCount

public int getTriangleCount()

addVertex

public void addVertex(idx3d_Vertex newVertex)

addTriangle

public void addTriangle(idx3d_Triangle newTriangle)

incorporateGeometry

public void incorporateGeometry(idx3d_Object that)
Incorporates the geometry of the supplied object into this object. This removes all vertices and triangles from the supplied object.


addTriangle

public void addTriangle(int vertex1,
                        int vertex2,
                        int vertex3)

addTriangle

public void addTriangle(int vertex1,
                        int vertex2,
                        int vertex3,
                        float u1,
                        float v1,
                        float u2,
                        float v2,
                        float u3,
                        float v3)

removeVertex

public void removeVertex(idx3d_Vertex v)

removeTriangle

public void removeTriangle(idx3d_Triangle t)

removeVertexAt

public void removeVertexAt(int pos)

removeTriangleAt

public void removeTriangleAt(int pos)

setMaterial

public void setMaterial(idx3d_InternalMaterial m)

rebuild

public void rebuild()

validate

public void validate()
Description copied from class: idx3d_Node
Validates this node and all its children.

Overrides:
validate in class idx3d_Node

addVertex

public void addVertex(float x,
                      float y,
                      float z)

addTriangle

public void addTriangle(idx3d_Vertex a,
                        idx3d_Vertex b,
                        idx3d_Vertex c)

addTriangle

public void addTriangle(idx3d_Vertex a,
                        idx3d_Vertex b,
                        idx3d_Vertex c,
                        float u1,
                        float v1,
                        float u2,
                        float v2,
                        float u3,
                        float v3)

regenerate

public void regenerate()
Regenerates the vertex normals.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

scaleTextureCoordinates

public void scaleTextureCoordinates(float fu,
                                    float fv)

tilt

public void tilt(float fact)

min

public idx3d_Vector min()

max

public idx3d_Vector max()

detach

public void detach()
Centers the object in its coordinate system The offset from origin to object center will be transfered o the matrix, so your object actually does not move. Usefull if you want prepare objects for self rotation.


getCenter

public idx3d_Vector getCenter()
Returns the center of this object.


getDimension

public idx3d_Vector getDimension()
Returns the x,y,z - Dimension of this object.


matrixMeltdown

public void matrixMeltdown()
Applies the transformations in the matrix to all vertices and resets the matrix to untransformed.


getClone

public idx3d_Object getClone()

removeDuplicateVertices

public void removeDuplicateVertices()

removeDegeneratedTriangles

public void removeDegeneratedTriangles()

meshSmooth

public void meshSmooth()

getVertexProjection

public idx3d_Matrix getVertexProjection()
Computes the vertex projection matrix and returns it. The matrix is the concatenation of the matrix of this idx3d_Object and of all its parent idx3d_Group objects.


getVertexProjectionInto

public idx3d_Matrix getVertexProjectionInto(idx3d_Matrix vertexProjection)

getNormalProjection

public idx3d_Matrix getNormalProjection()
Computes the normal projection and returns it. The matrix is the concatenation of the normalmatrix of this idx3d_Object and of all its parent idx3d_Group objects.


getNormalProjectionInto

public idx3d_Matrix getNormalProjectionInto(idx3d_Matrix normalProjection)

(c) Werner Randelshofer.
All rights reserved.