motris.model
Class Convex3DPolygon

java.lang.Object
  extended bymotris.data.Description
      extended bymotris.model.Convex3DPolygon
Direct Known Subclasses:
ConvexHull, ShadowHull

public class Convex3DPolygon
extends Description

Represents a 3-dimensional, planar, convex Polygon.

Author:
preuter, dahlkamp

Field Summary
 Double4Vector normalVector
           
 VolumeRepresentation parent
           
 SceneVertex[] vertices
          Vertices with (cw or ccw ordered) border points of this Polygon.
 
Fields inherited from class motris.data.Description
 
Constructor Summary
(package private) Convex3DPolygon()
           
  Convex3DPolygon(int numberOfVertices, java.lang.String _name, VolumeRepresentation _parent)
           
  Convex3DPolygon(int numberOfVertices, VolumeRepresentation _parent)
           
 
Method Summary
 Double4Vector collideWithLine(DoubleVector pointOnLine, DoubleVector direction)
           
 void computeNormal()
           
 java.awt.Rectangle getBoundingBox(Camera cam)
           
 double getDistanceFromCameraOrigin(Camera cam, DoubleVector tmp, DoubleVector tmp2)
          calculate distance of Polygon from Origin (of the polygon coordinate system)
 java.util.Vector getEdges()
           
 void project(Camera cam, Convex2DPolygon target, DoubleVector tmp)
           
 java.lang.String toString()
           
 void transform(JSci.maths.DoubleSquareMatrix a)
           
 
Methods inherited from class motris.data.Description
getDescription, getIdentifier, getName, setDescription, setIdentifier, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

vertices

public SceneVertex[] vertices
Vertices with (cw or ccw ordered) border points of this Polygon. Note that the polygon does NOT own these points and may not make modifications to them. Instead, they are shared among different polygons


normalVector

public Double4Vector normalVector

parent

public VolumeRepresentation parent
Constructor Detail

Convex3DPolygon

Convex3DPolygon()

Convex3DPolygon

public Convex3DPolygon(int numberOfVertices,
                       VolumeRepresentation _parent)

Convex3DPolygon

public Convex3DPolygon(int numberOfVertices,
                       java.lang.String _name,
                       VolumeRepresentation _parent)
Method Detail

project

public void project(Camera cam,
                    Convex2DPolygon target,
                    DoubleVector tmp)

transform

public void transform(JSci.maths.DoubleSquareMatrix a)
               throws JSci.maths.DimensionException
Throws:
JSci.maths.DimensionException

getDistanceFromCameraOrigin

public double getDistanceFromCameraOrigin(Camera cam,
                                          DoubleVector tmp,
                                          DoubleVector tmp2)
calculate distance of Polygon from Origin (of the polygon coordinate system)

Parameters:
cam - Camera
tmp - Temporary 4-dim DoubleVector to be overwritten with temporary values
Returns:
distance

collideWithLine

public Double4Vector collideWithLine(DoubleVector pointOnLine,
                                     DoubleVector direction)

getEdges

public java.util.Vector getEdges()

getBoundingBox

public java.awt.Rectangle getBoundingBox(Camera cam)

computeNormal

public void computeNormal()

toString

public java.lang.String toString()