|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.expr.DynamicScope
com.threerings.opengl.model.Model
public class Model
A 3D model.
| Nested Class Summary | |
|---|---|
static class |
Model.Implementation
The actual model implementation. |
| Nested classes/interfaces inherited from interface com.threerings.opengl.scene.SceneElement |
|---|
SceneElement.TickPolicy |
| Field Summary | |
|---|---|
static int |
DEFINITION_INFLUENCE
A flag indicating that the model implementation relies on the definitions. |
static int |
FOG_INFLUENCE
A flag indicating that the model implementation relies on the fog state. |
static int |
LIGHT_INFLUENCE
A flag indicating that the model implementation relies on the light state. |
static int |
PROJECTION_INFLUENCE
A flag indicating that the model implementation relies on the projections. |
| Fields inherited from interface com.threerings.expr.Scope |
|---|
EPOCH, NOW |
| Constructor Summary | |
|---|---|
Model(GlContext ctx)
Creates a new model with a null configuration. |
|
Model(GlContext ctx,
ConfigReference<ModelConfig> ref)
Creates a new model with the referenced configuration. |
|
Model(GlContext ctx,
ModelConfig config)
Creates a new model with the given configuration. |
|
Model(GlContext ctx,
String name)
Creates a new model with the named configuration. |
|
Model(GlContext ctx,
String name,
String firstKey,
Object firstValue,
Object... otherArgs)
Creates a new model with the named configuration and arguments. |
|
| Method Summary | ||
|---|---|---|
void |
addObserver(ModelObserver observer)
Adds an observer to this model. |
|
void |
attach(String point,
Model model)
Attaches the specified model at the given point. |
|
void |
attach(String point,
Model model,
boolean replace)
Attaches the specified model at the given point. |
|
void |
boundsDidChange(Model.Implementation impl)
Notes that the bounds have changed. |
|
void |
boundsWillChange(Model.Implementation impl)
Notes that the bounds will change. |
|
void |
clearConfig()
Resets the configuration of this model to the null configuration. |
|
void |
completed(Model.Implementation impl)
Notes that the model has completed. |
|
void |
composite()
Adds this object's Dependencys and Enqueueables to the compositor in
preparation for rendering. |
|
void |
configUpdated(ConfigEvent<ModelConfig> event)
Called when a configuration has been updated. |
|
Animation |
createAnimation()
Creates an unconfigured animation for the model. |
|
Animation |
createAnimation(ConfigReference<AnimationConfig> ref)
Creates an animation for this model. |
|
Animation |
createAnimation(String name)
Creates an animation for this model. |
|
Animation |
createAnimation(String name,
String firstKey,
Object firstValue,
Object... otherArgs)
Creates an animation for this model. |
|
void |
detach(Model model)
Detaches an attached model. |
|
void |
detachAll(String point)
Detaches any models attached to the specified point. |
|
void |
dispose()
Releases the resources associated with this scope. |
|
void |
drawBounds()
Draws the bounds of the model in immediate mode. |
|
|
get(String name,
Class<T> clazz)
Looks up a symbol in this scope. |
|
Animation |
getAnimation(String name)
Retrieves an animation by name. |
|
Animation[] |
getAnimations()
Returns a reference to this model's list of animations. |
|
Box |
getBounds()
Returns a reference to the bounds of the object. |
|
ColorState |
getColorState()
Returns a reference to the model's color state. |
|
ModelConfig |
getConfig()
Returns a reference to this model's configuration. |
|
FogState |
getFogState()
Returns a reference to the model's fog state. |
|
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). |
|
LightState |
getLightState()
Returns a reference to the model's light state. |
|
Transform3D |
getLocalTransform()
Returns a reference to the model's local transform. |
|
static MaterialConfig |
getMaterialConfig(GlContext ctx,
String texture,
String tag,
ModelConfig.Imported.MaterialMapping[] materialMappings,
Map<String,MaterialConfig> materialConfigs)
Resolves a material config through a cache. |
|
List<Animation> |
getPlayingAnimations()
Returns a list containing all animations currently playing on this model. |
|
Transform3D |
getPointWorldTransform(String point)
Returns a reference to the world transform of the model point. |
|
String |
getRenderScheme()
Returns the model's render scheme. |
|
Scene |
getScene(Model.Implementation impl)
Returns a reference to the scene containing the model, if any. |
|
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. |
|
boolean |
hasCompleted()
Determines whether this model (such as a transient effect) has completed. |
|
boolean |
isAnimationPlaying(String name)
Checks whether the named animation is playing. |
|
boolean |
isVisible()
Returns the value of the model's visibility flag. |
|
void |
removeObserver(ModelObserver observer)
Removes an observer from this model. |
|
void |
reset()
Resets the state of this model. |
|
void |
setColorState(ColorState state)
Sets the model's color state. |
|
void |
setConfig(ConfigReference<ModelConfig> ref)
Sets the configuration of this model. |
|
void |
setConfig(ModelConfig config)
Sets the configuration of this model. |
|
void |
setConfig(String name)
Sets the configuration of this model. |
|
void |
setConfig(String name,
String firstKey,
Object firstValue,
Object... otherArgs)
Sets the configuration of this model. |
|
void |
setFogState(FogState state)
Sets the model's fog state. |
|
void |
setInfluences(SceneInfluenceSet influences)
Sets the influences affecting this element. |
|
void |
setLightState(LightState state)
Sets the model's light state. |
|
void |
setLocalTransform(Transform3D transform)
Sets the local transform to the specified value and promotes it to Transform3D.UNIFORM, then updates the bounds of the model. |
|
void |
setRenderScheme(String scheme)
Sets the model's render scheme. |
|
void |
setTickPolicy(SceneElement.TickPolicy policy)
Sets the tick policy of the model. |
|
void |
setUserObject(Object object)
Sets the model's user object reference. |
|
void |
setVisible(boolean visible)
Sets the model's visibility flag. |
|
void |
startAnimation(String name)
Starts an animation by name. |
|
void |
stopAllAnimations()
Stops all animations currently playing. |
|
void |
stopAnimation(String name)
Stops an animation by name. |
|
void |
stopAnimations(int priority,
float blendOut)
Stops all animations playing at the specified priority level, blending them out over the specified interval. |
|
void |
tick(float elapsed)
Updates the state of this object based on the elapsed time in seconds. |
|
void |
tickPolicyDidChange(Model.Implementation impl)
Notes that the tick policy has changed. |
|
void |
tickPolicyWillChange(Model.Implementation impl)
Notes that the tick policy will change. |
|
void |
updateBounds()
Updates the bounds of the model. |
|
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 |
wasUpdated()
Notes that this scope has been updated. |
|
void |
willBeRemoved()
Notes that the element will be removed from the scene. |
|
| Methods inherited from class com.threerings.expr.DynamicScope |
|---|
addListener, endCompoundUpdate, getParentScope, getScopeName, put, remove, removeListener, scopeUpdated, setParentScope, startCompoundUpdate |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int FOG_INFLUENCE
public static final int LIGHT_INFLUENCE
public static final int PROJECTION_INFLUENCE
public static final int DEFINITION_INFLUENCE
| Constructor Detail |
|---|
public Model(GlContext ctx)
public Model(GlContext ctx,
String name)
public Model(GlContext ctx,
String name,
String firstKey,
Object firstValue,
Object... otherArgs)
public Model(GlContext ctx,
ConfigReference<ModelConfig> ref)
public Model(GlContext ctx,
ModelConfig config)
| Method Detail |
|---|
public static MaterialConfig getMaterialConfig(GlContext ctx,
String texture,
String tag,
ModelConfig.Imported.MaterialMapping[] materialMappings,
Map<String,MaterialConfig> materialConfigs)
public void setLocalTransform(Transform3D transform)
Transform3D.UNIFORM, then updates the bounds of the model.
public Transform3D getLocalTransform()
public Transform3D getPointWorldTransform(String point)
public void setConfig(String name)
public void setConfig(ConfigReference<ModelConfig> ref)
public void setConfig(String name,
String firstKey,
Object firstValue,
Object... otherArgs)
public void clearConfig()
public void setConfig(ModelConfig config)
public ModelConfig getConfig()
public void setRenderScheme(String scheme)
public String getRenderScheme()
public void setVisible(boolean visible)
public boolean isVisible()
public void setColorState(ColorState state)
public ColorState getColorState()
public void setFogState(FogState state)
public FogState getFogState()
public void setLightState(LightState state)
public LightState getLightState()
public void attach(String point,
Model model)
public void attach(String point,
Model model,
boolean replace)
replace - if true, replace any existing attachments at the point.public void detach(Model model)
public void detachAll(String point)
public void startAnimation(String name)
public void stopAnimation(String name)
public void stopAnimations(int priority,
float blendOut)
public void stopAllAnimations()
public List<Animation> getPlayingAnimations()
public boolean isAnimationPlaying(String name)
public Animation getAnimation(String name)
public Animation[] getAnimations()
public Animation createAnimation(String name)
public Animation createAnimation(ConfigReference<AnimationConfig> ref)
public Animation createAnimation(String name,
String firstKey,
Object firstValue,
Object... otherArgs)
public Animation createAnimation()
public boolean hasCompleted()
public void addObserver(ModelObserver observer)
public void removeObserver(ModelObserver observer)
public void reset()
public void updateBounds()
public void drawBounds()
public void setTickPolicy(SceneElement.TickPolicy policy)
public void setUserObject(Object object)
public SceneElement.TickPolicy getTickPolicy()
SceneElementTickable.tick(float) method must be called.
getTickPolicy in interface SceneElementpublic Object getUserObject()
SceneElement
getUserObject in interface SceneElementpublic Box getBounds()
SceneObject
getBounds in interface SceneObjectpublic 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 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 Intersectablepublic void composite()
CompositableDependencys and Enqueueables to the compositor in
preparation for rendering.
composite in interface Compositablepublic void configUpdated(ConfigEvent<ModelConfig> event)
ConfigUpdateListener
configUpdated in interface ConfigUpdateListener<ModelConfig>
public <T> T get(String name,
Class<T> clazz)
Scope
get in interface Scopeget in class DynamicScopenull if not found.public void wasUpdated()
DynamicScope
wasUpdated in class DynamicScopepublic void dispose()
DynamicScope
dispose in class DynamicScopepublic Scene getScene(Model.Implementation impl)
_impl.
public void completed(Model.Implementation impl)
_impl.
public void tickPolicyWillChange(Model.Implementation impl)
_impl.
public void tickPolicyDidChange(Model.Implementation impl)
_impl.
public void boundsWillChange(Model.Implementation impl)
_impl.
public void boundsDidChange(Model.Implementation impl)
_impl.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||