package actor;
import render.Geometry;
import render.Material;
import render.Matrix;
public class ActorGeometry
{
private int[] animationVertexMap = null;
private Point3D[] baseShape = null;
protected Geometry geometry;
public ActorGeometry()
{
this.geometry = new Geometry();
}
public int mapAnimationVertex(int v)
{
int physicalVertexIndex;
if(animationVertexMap == null)
physicalVertexIndex = v;
else
physicalVertexIndex = animationVertexMap[v];
return physicalVertexIndex;
}
public int getVertexCount()
{
return geometry.vertices.length;
}
public int[] getAnimationVertexMap()
{
return animationVertexMap;
}
public void setAnimationVertexMap(int[] animationVertexMap)
{
this.animationVertexMap = animationVertexMap;
}
public void updateVertices(Point3D[] VertexList)
{
throw new RuntimeException("IMPLEMENT ME!");
}
public Point3D[] getBaseShape()
{
return baseShape;
}
public void setBaseShape(Point3D[] shape)
{
this.baseShape = shape;
}
public static void transform(double[] src, Matrix m, double[] dst)
{
Geometry.transform(src, m, dst);
}
public Geometry add()
{
return geometry.add();
}
public Geometry add(Geometry s)
{
return geometry.add(s);
}
public Geometry child(int n)
{
return geometry.child(n);
}
public boolean computedMeshNormals()
{
return geometry.computedMeshNormals();
}
public void computeMeshNormals()
{
geometry.computeMeshNormals();
}
public void computePolyhedronNormals()
{
geometry.computePolyhedronNormals();
}
public boolean contains(Geometry s)
{
return geometry.contains(s);
}
public void copyVertex(double[] src, double[] dst)
{
geometry.copyVertex(src, dst);
}
public double[][] copyVertices(double[][] src)
{
return geometry.copyVertices(src);
}
public double[][] copyVertices(double[][] src, double[][] dst)
{
return geometry.copyVertices(src, dst);
}
public Geometry delete(Geometry s)
{
return geometry.delete(s);
}
public Geometry delete(int n)
{
return geometry.delete(n);
}
public boolean equals(Object obj)
{
return geometry.equals(obj);
}
public Matrix getMatrix()
{
return geometry.getMatrix();
}
public double[] getOffset()
{
return geometry.getOffset();
}
public Geometry getParent()
{
return geometry.getParent();
}
public int hashCode()
{
return geometry.hashCode();
}
public boolean isDoubleSided()
{
return geometry.isDoubleSided();
}
public void recomputeMeshNormals()
{
geometry.recomputeMeshNormals();
}
public Geometry setDoubleSided(boolean tf)
{
return geometry.setDoubleSided(tf);
}
public Geometry setMaterial(Material m)
{
return geometry.setMaterial(m);
}
public void setMatrix(Matrix m)
{
geometry.setMatrix(m);
}
public void setOffset(double x, double y, double z)
{
geometry.setOffset(x, y, z);
}
public String toString()
{
return geometry.toString();
}
public void transformVertex(double[] src, Matrix m, double[] dst)
{
for (int i = 0; i < 3; i++)
dst[i] = src[0] * m.get(i, 0) + src[1] * m.get(i, 1) + src[2] * m.get(i, 2) + m.get(i, 3);
dst[3] = src[3];
dst[4] = src[4];
dst[5] = src[5];
}
public Geometry getGeometry()
{
return geometry;
}
public void setGeometry(Geometry geometry)
{
this.geometry = geometry;
}
}