|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.brackeen.javagamebook.graphics3D.texture.Texture
com.brackeen.javagamebook.graphics3D.texture.ShadedSurface
A ShadedSurface is a pre-shaded Texture that maps onto a polygon.
Field Summary | |
static int |
SHADE_RES
|
static int |
SHADE_RES_BITS
|
static int |
SHADE_RES_MASK
|
static int |
SHADE_RES_SQ
|
static int |
SHADE_RES_SQ_BITS
|
static int |
SURFACE_BORDER_SIZE
|
Constructor Summary | |
ShadedSurface(int width,
int height)
Creates a ShadedSurface with the specified width and height. |
|
ShadedSurface(short[] buffer,
int width,
int height)
Creates a ShadedSurface with the specified buffer, width and height. |
Method Summary | |
void |
buildShadeMap(java.util.List pointLights,
float ambientLightIntensity)
Builds the shade map for this surface from the specified list of point lights and the ambiant light intensity. |
void |
buildSurface()
Builds the surface. |
void |
clearSurface()
Clears this surface, allowing the garbage collector to remove it from memory if needed. |
static void |
createShadedSurface(TexturedPolygon3D poly,
ShadedTexture texture,
java.util.List lights,
float ambientLightIntensity)
Creates a ShadedSurface for the specified polygon. |
static void |
createShadedSurface(TexturedPolygon3D poly,
ShadedTexture texture,
Rectangle3D textureBounds,
java.util.List lights,
float ambientLightIntensity)
Creates a ShadedSurface for the specified polygon. |
short |
getColor(int x,
int y)
Gets the 16-bit color of the pixel at location (x,y) in the bitmap. |
short |
getColorChecked(int x,
int y)
Gets the 16-bit color of the pixel at location (x,y) in the bitmap. |
int |
getInterpolatedShade(int u,
int v)
Gets the shade (from the shade map) for the specified (u,v) location. |
int |
getShade(int u,
int v)
Gets the shade (from the built shade map) for the specified (u,v) location. |
Rectangle3D |
getSurfaceBounds()
Gets the surface bounds for this ShadedSurface. |
boolean |
isCleared()
Checks if the surface has been cleared. |
boolean |
isDirty()
Checks wether this surface is dirty. |
boolean |
retrieveSurface()
If the buffer has been previously built and cleared but not yet removed from memory by the garbage collector, then this method attempts to retrieve it. |
void |
setDirty(boolean dirty)
Marks whether this surface is dirty. |
void |
setSurfaceBounds(Rectangle3D surfaceBounds)
Sets the surface bounds for this ShadedSurface. |
void |
setTexture(ShadedTexture texture)
Sets the source texture for this ShadedSurface. |
void |
setTexture(ShadedTexture texture,
Rectangle3D bounds)
Sets the source texture and source bounds for this ShadedSurface. |
Methods inherited from class com.brackeen.javagamebook.graphics3D.texture.Texture |
countbits, createTexture, createTexture, createTexture, createTexture, getHeight, getWidth, isPowerOfTwo |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SURFACE_BORDER_SIZE
public static final int SHADE_RES_BITS
public static final int SHADE_RES
public static final int SHADE_RES_MASK
public static final int SHADE_RES_SQ
public static final int SHADE_RES_SQ_BITS
Constructor Detail |
public ShadedSurface(int width, int height)
public ShadedSurface(short[] buffer, int width, int height)
Method Detail |
public static void createShadedSurface(TexturedPolygon3D poly, ShadedTexture texture, java.util.List lights, float ambientLightIntensity)
public static void createShadedSurface(TexturedPolygon3D poly, ShadedTexture texture, Rectangle3D textureBounds, java.util.List lights, float ambientLightIntensity)
public short getColor(int x, int y)
getColor
in class Texture
public short getColorChecked(int x, int y)
public void setDirty(boolean dirty)
public boolean isDirty()
public void clearSurface()
public boolean isCleared()
public boolean retrieveSurface()
public void setTexture(ShadedTexture texture)
public void setTexture(ShadedTexture texture, Rectangle3D bounds)
public void setSurfaceBounds(Rectangle3D surfaceBounds)
public Rectangle3D getSurfaceBounds()
public void buildSurface()
public int getInterpolatedShade(int u, int v)
public int getShade(int u, int v)
public void buildShadeMap(java.util.List pointLights, float ambientLightIntensity)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |