|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.util.SimpleRenderable
com.threerings.opengl.util.SimpleTransformable
com.threerings.opengl.scene.SimpleSceneElement
public abstract class SimpleSceneElement
Extends SimpleTransformable and provides a basic implementation of the
SceneElement interface.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.threerings.opengl.scene.SceneElement |
|---|
SceneElement.TickPolicy |
| Field Summary | |
|---|---|
protected Box |
_bounds
The bounds of the element. |
protected SceneInfluenceSet |
_influences
The influences affecting the element. |
protected int |
_lastVisit
The visitation id of the last visit. |
protected Box |
_nbounds
Holds the new bounds of the element when updating. |
protected Scene |
_scene
The scene to which this element has been added. |
protected SceneElement.TickPolicy |
_tickPolicy
The element's tick policy. |
protected Object |
_userObject
The element's user object. |
| Fields inherited from class com.threerings.opengl.util.SimpleTransformable |
|---|
_transform |
| Fields inherited from class com.threerings.opengl.util.SimpleRenderable |
|---|
_batch, _ctx, _priority, _queue |
| Constructor Summary | |
|---|---|
SimpleSceneElement(GlContext ctx)
Creates a new scene element. |
|
SimpleSceneElement(GlContext ctx,
String queue)
Creates a new simple scene element. |
|
SimpleSceneElement(GlContext ctx,
String queue,
int priority)
Creates a new simple scene element. |
|
SimpleSceneElement(GlContext ctx,
String queue,
int priority,
boolean modifiesColorState,
int primitiveCount)
Creates a new simple scene element. |
|
| Method Summary | |
|---|---|
protected void |
boundsDidChange()
Notes that the bounds have changed. |
protected void |
boundsWillChange()
Notes that the bounds are about to change. |
protected void |
computeBounds(Box result)
Computes the bounds of the element and places them in the provided result object. |
Box |
getBounds()
Returns a reference to the bounds of the object. |
boolean |
getIntersection(Ray3D ray,
Vector3f result)
Finds the intersection of a ray with this object and places it in the supplied vector (if it exists). |
protected Box |
getLocalBounds()
Returns the local bounds of the element. |
SceneElement.TickPolicy |
getTickPolicy()
Returns the policy that determines when the Tickable.tick(float) method must be called. |
Object |
getUserObject()
Returns this element's user object reference. |
void |
setInfluences(SceneInfluenceSet influences)
Sets the influences affecting this element. |
void |
setTickPolicy(SceneElement.TickPolicy policy)
Sets the element's tick policy. |
void |
setTransform(Transform3D transform)
Sets the transform to the specified value and promotes it to Transform3D.UNIFORM,
then updates the bounds of the element. |
void |
setUserObject(Object object)
Sets the element's user object reference. |
void |
tick(float elapsed)
Updates the state of this object based on the elapsed time in seconds. |
void |
updateBounds()
Updates the bounds of the element. |
boolean |
updateLastVisit(int visit)
Checks and updates the last visit value. |
void |
wasAdded(Scene scene)
Notes that the element was added to the specified scene. |
void |
willBeRemoved()
Notes that the element will be removed from the scene. |
| Methods inherited from class com.threerings.opengl.util.SimpleTransformable |
|---|
createStates, enqueue, getCenter, getTransform |
| Methods inherited from class com.threerings.opengl.util.SimpleRenderable |
|---|
composite, createBatch, draw, getStates |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.threerings.opengl.compositor.Compositable |
|---|
composite |
| Field Detail |
|---|
protected Box _bounds
protected Box _nbounds
protected SceneElement.TickPolicy _tickPolicy
protected Object _userObject
protected Scene _scene
protected SceneInfluenceSet _influences
protected int _lastVisit
| Constructor Detail |
|---|
public SimpleSceneElement(GlContext ctx)
public SimpleSceneElement(GlContext ctx,
String queue)
queue - the name of the queue into which we place the batch.
public SimpleSceneElement(GlContext ctx,
String queue,
int priority)
queue - the name of the queue into which we place the batch.priority - the priority level at which to enqueue the batch.
public SimpleSceneElement(GlContext ctx,
String queue,
int priority,
boolean modifiesColorState,
int primitiveCount)
queue - the name of the queue into which we place the batch.priority - the priority level at which to enqueue the batch.modifiesColorState - if true, invalidate the color state after calling the
SimpleRenderable.draw() method.primitiveCount - the primitive count to report to the renderer.| Method Detail |
|---|
public void setTickPolicy(SceneElement.TickPolicy policy)
public void setUserObject(Object object)
public void setTransform(Transform3D transform)
Transform3D.UNIFORM,
then updates the bounds of the element.
public void updateBounds()
getLocalBounds().
public SceneElement.TickPolicy getTickPolicy()
SceneElementTickable.tick(float) method must be called.
getTickPolicy in interface SceneElementpublic Object getUserObject()
SceneElement
getUserObject in interface SceneElementpublic void wasAdded(Scene scene)
SceneElement
wasAdded in interface SceneElementpublic void willBeRemoved()
SceneElement
willBeRemoved in interface SceneElementpublic void setInfluences(SceneInfluenceSet influences)
SceneElement
setInfluences in interface SceneElementpublic Box getBounds()
SceneObject
getBounds in interface SceneObjectpublic boolean updateLastVisit(int visit)
SceneObject
updateLastVisit in interface SceneObjectpublic void tick(float elapsed)
Tickable
tick in interface Tickable
public boolean getIntersection(Ray3D ray,
Vector3f result)
Intersectable
getIntersection in interface Intersectableprotected void computeBounds(Box result)
getLocalBounds().
protected Box getLocalBounds()
Box.ZERO;
override to return actual local bounds.
protected void boundsWillChange()
protected void boundsDidChange()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||