com.sygem.jazz3d3
Class Shape

java.lang.Object
  extended bycom.sygem.jazz3d3.Shape
Direct Known Subclasses:
Quad, Triangle

public class Shape
extends java.lang.Object

Base face class. Provides common functionality for faces.

Version:
3.0a

Field Summary
 int b
           
 int g
           
 int r
           
 int vert1
           
 int vert2
           
 int vert3
           
 int vert4
           
 
Constructor Summary
Shape(int v1, int v2, int v3, int r, int g, int b)
          Default constructor.
 
Method Summary
 boolean getDoubleSided()
          Returns whether or not this face is double-sided.
 Vertex getFaceNormal()
          Returns the normal vector for this face.
 Render getRenderer()
           
 int getTransparency()
          Get the transparency value of this face.
 double getU(int u, boolean wrap)
          Get the U value of a particular vertex in this face
 double getV(int v, boolean wrap)
          Get the V value of a particular vertex in this face
 int getVertexID(int vert)
          Returns a vertex ID from this face.
 void setColour(int r, int g, int b)
          Set the colour of this face.
 void setDoubleSided(boolean ds)
          Set this face to be double-sided (culling not applied).
 void setFaceNormal(Vertex norm)
          Set the normal vector for this face.
 void setRenderer(Render r)
           
 void setTransparency(int tr)
          Set the transparency value of this face.
 void setUV(double u1, double v1, double u2, double v2, double u3, double v3, double u4, double v4)
          Set the UV coordinates of a face.
 void setWrapUV(double u1, double v1, double u2, double v2, double u3, double v3, double u4, double v4)
          Set the UV coordinates of a face when using UV wrapping.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

b

public int b

g

public int g

r

public int r

vert1

public int vert1

vert2

public int vert2

vert3

public int vert3

vert4

public int vert4
Constructor Detail

Shape

public Shape(int v1,
             int v2,
             int v3,
             int r,
             int g,
             int b)
Default constructor. Constructs a shape between 3 vertices, with colour (r,g,b)

Method Detail

getDoubleSided

public final boolean getDoubleSided()
Returns whether or not this face is double-sided.


getFaceNormal

public final Vertex getFaceNormal()
Returns the normal vector for this face. The normal is actually returned as a Vertex.

See Also:
setFaceNormal(com.sygem.jazz3d3.Vertex)

getRenderer

public final Render getRenderer()

getTransparency

public final int getTransparency()
Get the transparency value of this face.

Note: This is only used by the transparent renderer.

See Also:
RenderTransparent

getU

public final double getU(int u,
                         boolean wrap)
Get the U value of a particular vertex in this face

Parameters:
u - A value between 1 & 4 - the vertex being queried
wrap - Set to true if you want the UV wrapping co-ord

getV

public final double getV(int v,
                         boolean wrap)
Get the V value of a particular vertex in this face

Parameters:
v - A value between 1 & 4 - the vertex being queried
wrap - Set to true if you want the UV wrapping co-ord

getVertexID

public final int getVertexID(int vert)
Returns a vertex ID from this face. These vertex IDs map directly into the object's vertex container, so they can be used to reference specific vertices in the object. They are selected using an index 1-4 in the method call.


setColour

public final void setColour(int r,
                            int g,
                            int b)
Set the colour of this face.

Parameters:
r - The red component of the new colour (0 - 255)
g - The green component of the new colour (0 - 255)
b - The blue component of the new colour (0 - 255)
See Also:
Object3d.setFaceColour(int, int, int, int)

setDoubleSided

public final void setDoubleSided(boolean ds)
Set this face to be double-sided (culling not applied).


setFaceNormal

public final void setFaceNormal(Vertex norm)
Set the normal vector for this face. The normal is actually represented by a Vertex.

Parameters:
norm - The new face normal
See Also:
getFaceNormal()

setRenderer

public final void setRenderer(Render r)

setTransparency

public final void setTransparency(int tr)
Set the transparency value of this face.

Note: This is only used by the transparent renderer.

See Also:
RenderTransparent

setUV

public final void setUV(double u1,
                        double v1,
                        double u2,
                        double v2,
                        double u3,
                        double v3,
                        double u4,
                        double v4)
Set the UV coordinates of a face. Specified in pairs i.e. (u1,v1),(u2,v2) etc..


setWrapUV

public final void setWrapUV(double u1,
                            double v1,
                            double u2,
                            double v2,
                            double u3,
                            double v3,
                            double u4,
                            double v4)
Set the UV coordinates of a face when using UV wrapping. Specified in pairs i.e. (u1,v1),(u2,v2) etc..


toString

public java.lang.String toString()


Copyright © 1999-2006 SyGem Software. All Rights Reserved.