com.brackeen.javagamebook.bsp2D
Class BSPPolygon

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

public class BSPPolygon
extends TexturedPolygon3D

A BSPPolygon is a TexturedPolygon3D with a type (TYPE_FLOOR, TYPE_WALL, or TYPE_PASSABLE_WALL) an ambient light intensity value, and a BSPLine representation if the type is a TYPE_WALL or TYPE_PASSABLE_WALL.


Field Summary
static int PASSABLE_ENTRYWAY_THRESHOLD
          How tall an entryway must be so that monsters/players can pass through it
static int PASSABLE_WALL_THRESHOLD
          How short a wall must be so that monsters/players can step over it.
static int TYPE_FLOOR
           
static int TYPE_PASSABLE_WALL
           
static int TYPE_WALL
           
 
Constructor Summary
BSPPolygon(Vector3D[] vertices, int type)
          Creates a new BSPPolygon with the specified vertices and type (TYPE_FLOOR, TYPE_WALL, or TYPE_PASSABLE_WALL).
 
Method Summary
 BSPPolygon clone(Vector3D[] vertices)
          Clone this polygon, but with a different set of vertices.
 float getAmbientLightIntensity()
           
 BSPLine getLine()
          Gets the line representing the BSPPolygon.
 boolean isSolidWall()
          Returns true if the BSPPolygon is a solid wall (not passable).
 boolean isWall()
          Returns true if the BSPPolygon is a wall.
 void setAmbientLightIntensity(float a)
           
 
Methods inherited from class com.brackeen.javagamebook.math3D.TexturedPolygon3D
add, addRotation, calcBoundingRectangle, getTexture, getTextureBounds, setTexture, setTexture, setTo, subtract, subtractRotation
 
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
 

Field Detail

TYPE_FLOOR

public static final int TYPE_FLOOR
See Also:
Constant Field Values

TYPE_WALL

public static final int TYPE_WALL
See Also:
Constant Field Values

TYPE_PASSABLE_WALL

public static final int TYPE_PASSABLE_WALL
See Also:
Constant Field Values

PASSABLE_WALL_THRESHOLD

public static final int PASSABLE_WALL_THRESHOLD
How short a wall must be so that monsters/players can step over it.

See Also:
Constant Field Values

PASSABLE_ENTRYWAY_THRESHOLD

public static final int PASSABLE_ENTRYWAY_THRESHOLD
How tall an entryway must be so that monsters/players can pass through it

See Also:
Constant Field Values
Constructor Detail

BSPPolygon

public BSPPolygon(Vector3D[] vertices,
                  int type)
Creates a new BSPPolygon with the specified vertices and type (TYPE_FLOOR, TYPE_WALL, or TYPE_PASSABLE_WALL).

Method Detail

clone

public BSPPolygon clone(Vector3D[] vertices)
Clone this polygon, but with a different set of vertices.


isWall

public boolean isWall()
Returns true if the BSPPolygon is a wall.


isSolidWall

public boolean isSolidWall()
Returns true if the BSPPolygon is a solid wall (not passable).


getLine

public BSPLine getLine()
Gets the line representing the BSPPolygon. Returns null if this BSPPolygon is not a wall.


setAmbientLightIntensity

public void setAmbientLightIntensity(float a)

getAmbientLightIntensity

public float getAmbientLightIntensity()