|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjme.geometry.primitive.Primitive
jme.geometry.primitive.Box
Box
defines a primitive object of a box shape. The box is
made up of six sides, with eight vertices. The vertices of the box is
defined by an array of Vertex3f
. The order of this array is
important due to the fact that the point is defined by it's index.
The indices to point match is as follows:
0 - Front face, top left
1 - Front face, top right
2 - Front face, bottom left
3 - Front face, bottom right
4 - Back face, top left
5 - Back face, top right
6 - Back face, bottom left
7 - Back face, bottom right
Field Summary |
Fields inherited from class jme.geometry.primitive.Primitive |
alpha, blue, green, red |
Constructor Summary | |
Box()
Constructor instantiates an empty Box with all points
of the box defined as (0,0,0). |
|
Box(float size)
Constructor instantiates a new Box object that is a
perfect cube with the given size for a side. |
|
Box(Vector[] corners)
Constructor instantiates a new Box object with the
defined points defining the dimensions. |
Method Summary | |
Vector[] |
getPoints()
getPoints returns an array of Vectors that represents
each point that makes up the piece of geometry. |
void |
initialize()
initialize initializes the box for use. |
void |
preRender()
preRender does not perform any action for Box . |
void |
render()
render renders the box with normals facing outward. |
void |
setCorner(int corner,
Vector point)
setCorner sets a single point of the box. |
void |
setCorners(Vector[] corners)
setCorners sets the points of the box. |
Methods inherited from class jme.geometry.primitive.Primitive |
clean, getTextureId, setColor, setTexture, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Box()
Box
with all points
of the box defined as (0,0,0).
public Box(Vector[] corners)
Box
object with the
defined points defining the dimensions.
corners
- the points of the box.
MonkeyRuntimeException
- if corners is null.public Box(float size)
Box
object that is a
perfect cube with the given size for a side. The center of the
cube is (0,0,0).
size
- the length of a side of the cube.Method Detail |
public void render()
render
renders the box with normals facing outward. If
a texture is assigned, the texture will be rendered on each face of
the box.
render
in interface Geometry
render
in class Primitive
public void initialize()
initialize
initializes the box for use.
public void preRender()
preRender
does not perform any action for Box
.
public void setCorners(Vector[] corners)
setCorners
sets the points of the box.
corners
- the points of the box.
MonkeyRuntimeException
- if corners is null.public void setCorner(int corner, Vector point)
setCorner
sets a single point of the box. Using
the mapping of:
0 - Front face, top left
corner
- the corner to change.point
- the new point for the corner.public Vector[] getPoints()
Geometry
getPoints
returns an array of Vectors that represents
each point that makes up the piece of geometry.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |