|
JSR-184 Public Review Draft - Apr. 30, 2003. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.microedition.m3d.Object3D | +--javax.microedition.m3d.Node | +--javax.microedition.m3d.Group | +--javax.microedition.m3d.World
A top-level container for scene graphs. The scene graph is constructed from a hierarchy of nodes. In a valid scene graph, all nodes are ultimately connected to each other via a common root, which is a World node. An example scene graph is shown in the figure below.
Despite that it is called a graph, the scene graph is actually a tree structure. This implies that a node can belong to at most one group at a time, and cycles are prohibited. Furthermore, a World node cannot belong to any group. However, component objects may be referenced by an arbitrary number of nodes and components. The rules for building valid scene graph structures are summarized below.
Even though World is a scene graph node, its special role as the singular root node has two noteworthy consequences. Firstly, a World cannot be inserted into any Group; this is enforced with an exception. Secondly, the node transformation is ignored for World objects. The transformation can be set, animated, and queried, but it has no effect on anything.
The method Graphics3D.render(World)
renders a World
as observed by its currently active camera. If there is no active camera,
rendering of that World is disabled. Note, however, that the corresponding
render
methods for Groups and Meshes can still be used to
render individual branches of that World.
Field Summary |
Fields inherited from class javax.microedition.m3d.Node |
NONE, ORIGIN, X_AXIS, Y_AXIS, Z_AXIS |
Fields inherited from class javax.microedition.m3d.Object3D |
userObject |
Constructor Summary | |
World()
Creates an empty World with default values. |
Method Summary | |
Camera |
getActiveCamera()
Gets the currently active camera. |
int |
getAmbientLight()
Retrieves the current ambient light color of this World. |
Background |
getBackground()
Retrieves the background settings of this World. |
void |
setActiveCamera(Camera camera)
Sets the Camera to use when rendering this World. |
void |
setAmbientLight(int RGB)
Sets the ambient light intensity for this World. |
void |
setBackground(Background background)
Sets the Background object for this World. |
Methods inherited from class javax.microedition.m3d.Group |
addChild, getChild, getChildCount, pick, removeChild |
Methods inherited from class javax.microedition.m3d.Node |
getAlphaFactor, getOrientation, getParent, getScale, getScopeID, getTransform, getTransformTo, getTranslation, isEnabled, setAlignment, setAlphaFactor, setEnable, setOrientation, setScale, setScopeID, setTransform, setTranslation |
Methods inherited from class javax.microedition.m3d.Object3D |
addAnimationTrack, animate, clone, find, getAnimationTrack, getAnimationTrackCount, getReferences, getUserID, removeAnimationTrack, setUserID |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public World()
Creates an empty World with default values. The default values are:
null
(do not clear the color buffer)null
(world is not renderable)
Method Detail |
public void setBackground(Background background)
Sets the Background object for this World. The background is
used for clearing the color buffer prior to rendering the World
when Graphics3D.render(World)
is called. If there
is no Background object, the depth buffer is cleared as usual,
but the color buffer is not cleared at all.
background
- attributes for clearing the color buffer; null to
not clear the color buffer at allgetBackground()
public Background getBackground()
Retrieves the background settings of this World.
setBackground(javax.microedition.m3d.Background)
public void setActiveCamera(Camera camera)
Sets the Camera to use when rendering this World. If the camera
is not in this world, its position in this world is defined by its
node transformation. The node transformations of its ancestors, if
any, are ignored. Rendering of this World can be disabled by setting
the active camera to null
.
camera
- the Camera object to set as the active cameragetActiveCamera()
public Camera getActiveCamera()
Gets the currently active camera.
setActiveCamera(javax.microedition.m3d.Camera)
public void setAmbientLight(int RGB)
Sets the ambient light intensity for this World. The high order byte of the color value is ignored.
RGB
- the new global ambient color in 0x00RRGGBB formatgetAmbientLight
public int getAmbientLight()
Retrieves the current ambient light color of this World.
setAmbientLight
|
JSR-184 Public Review Draft - Apr. 30, 2003. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |