com.brackeen.javagamebook.math3D
Class TexturedPolygon3D

java.lang.Object
  extended bycom.brackeen.javagamebook.math3D.Polygon3D
      extended bycom.brackeen.javagamebook.math3D.TexturedPolygon3D
All Implemented Interfaces:
Transformable
Direct Known Subclasses:
BSPPolygon

public class TexturedPolygon3D
extends Polygon3D

The TexturedPolygon3D class is a Polygon with a texture.


Constructor Summary
TexturedPolygon3D()
           
TexturedPolygon3D(Vector3D[] vertices)
           
TexturedPolygon3D(Vector3D v0, Vector3D v1, Vector3D v2)
           
TexturedPolygon3D(Vector3D v0, Vector3D v1, Vector3D v2, Vector3D v3)
           
 
Method Summary
 void add(Vector3D u)
           
 void addRotation(Transform3D xform)
           
 Rectangle3D calcBoundingRectangle()
          Calculates the bounding rectangle for this polygon that is aligned with the texture bounds.
 Texture getTexture()
          Gets this polygon's texture.
 Rectangle3D getTextureBounds()
          Gets this polygon's texture bounds.
 void setTexture(Texture texture)
          Sets this polygon's texture.
 void setTexture(Texture texture, Rectangle3D bounds)
          Sets this polygon's texture and texture bounds.
 void setTo(Polygon3D poly)
          Sets this polygon to the same vertices as the specfied polygon.
 void subtract(Vector3D u)
           
 void subtractRotation(Transform3D xform)
           
 
Methods inherited from class com.brackeen.javagamebook.math3D.Polygon3D
add, calcNormal, clip, getNormal, getNumVertices, getVertex, insertVertex, isFacing, project, setNormal, subtract
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TexturedPolygon3D

public TexturedPolygon3D()

TexturedPolygon3D

public TexturedPolygon3D(Vector3D v0,
                         Vector3D v1,
                         Vector3D v2)

TexturedPolygon3D

public TexturedPolygon3D(Vector3D v0,
                         Vector3D v1,
                         Vector3D v2,
                         Vector3D v3)

TexturedPolygon3D

public TexturedPolygon3D(Vector3D[] vertices)
Method Detail

setTo

public void setTo(Polygon3D poly)
Description copied from class: Polygon3D
Sets this polygon to the same vertices as the specfied polygon.

Overrides:
setTo in class Polygon3D

getTexture

public Texture getTexture()
Gets this polygon's texture.


getTextureBounds

public Rectangle3D getTextureBounds()
Gets this polygon's texture bounds.


setTexture

public void setTexture(Texture texture)
Sets this polygon's texture.


setTexture

public void setTexture(Texture texture,
                       Rectangle3D bounds)
Sets this polygon's texture and texture bounds.


add

public void add(Vector3D u)
Specified by:
add in interface Transformable
Overrides:
add in class Polygon3D

subtract

public void subtract(Vector3D u)
Specified by:
subtract in interface Transformable
Overrides:
subtract in class Polygon3D

addRotation

public void addRotation(Transform3D xform)
Specified by:
addRotation in interface Transformable
Overrides:
addRotation in class Polygon3D

subtractRotation

public void subtractRotation(Transform3D xform)
Specified by:
subtractRotation in interface Transformable
Overrides:
subtractRotation in class Polygon3D

calcBoundingRectangle

public Rectangle3D calcBoundingRectangle()
Calculates the bounding rectangle for this polygon that is aligned with the texture bounds.

Overrides:
calcBoundingRectangle in class Polygon3D