com.threerings.opengl.model.config
Class ModelConfig

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.config.ManagedConfig
          extended by com.threerings.config.ParameterizedConfig
              extended by com.threerings.opengl.model.config.ModelConfig
All Implemented Interfaces:
ConfigUpdateListener<ManagedConfig>, Exportable, com.threerings.resource.ResourceManager.ModificationObserver, Copyable, Cloneable
Direct Known Subclasses:
ActorModelConfig

public class ModelConfig
extends ParameterizedConfig

The configuration of a model.


Nested Class Summary
static class ModelConfig.BaseWrapper
          Base wrapper implementation.
static class ModelConfig.Derived
          A derived implementation.
static class ModelConfig.Implementation
          Contains the actual implementation of the model.
static class ModelConfig.Imported
          Superclass of the imported implementations (this is not abstract because in order for the exporter to create a prototype of MaterialMapping, it must be able to instantiate this class).
static class ModelConfig.MeshSet
          Contains a set of meshes.
static class ModelConfig.Schemed
          Chooses different models based on the render scheme.
static class ModelConfig.SchemedModel
          Combines a render scheme with a model reference.
static class ModelConfig.VisibleMesh
          Pairs a texture name with a geometry config.
 
Field Summary
static String DEFAULT_TAG
          The default tag for unskinned meshes.
 ModelConfig.Implementation implementation
          The actual model implementation.
static String SKINNED_TAG
          The default tag for skinned meshes.
 
Fields inherited from class com.threerings.config.ParameterizedConfig
parameters
 
Constructor Summary
ModelConfig()
          Default constructor.
ModelConfig(ModelConfig.Implementation impl)
          Constructor that takes an already-created implementation.
 
Method Summary
 ConfigManager getConfigManager()
          Returns a reference to the config manager to use when resolving references within this config.
 Model.Implementation getModelImplementation(GlContext ctx, Scope scope, Model.Implementation impl)
          Creates or updates a model implementation for this configuration.
 ModelConfig.Implementation getOriginal()
          Retrieves a reference to the underlying original implementation.
 GeometryConfig getParticleGeometry(GlContext ctx)
          Returns the GeometryConfig to use when this model is selected for use within a particle system (or null if it cannot be used).
 ConfigReference<MaterialConfig> getParticleMaterial(GlContext ctx)
          Returns a reference to the material to use when this model is selected for use within a particle system.
 void init(ConfigManager cfgmgr)
          Initializes this config with a reference to the config manager that it should use to resolve references.
 void updateFromSource(EditorContext ctx, boolean force)
          Updates this configuration from its external source, if any.
 boolean validateReferences(String where, PrintStream out)
          Validates the references in this config.
 
Methods inherited from class com.threerings.config.ParameterizedConfig
getInstance, getParameter, getReference, validateOuters, wasUpdated
 
Methods inherited from class com.threerings.config.ManagedConfig
addListener, configUpdated, getInstance, getInstance, getInstance, getInstance, getName, removeListener, resourceModified, setName
 
Methods inherited from class com.threerings.util.DeepObject
clone, copy, copy, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_TAG

public static final String DEFAULT_TAG
The default tag for unskinned meshes.

See Also:
Constant Field Values

SKINNED_TAG

public static final String SKINNED_TAG
The default tag for skinned meshes.

See Also:
Constant Field Values

implementation

@Editable
public ModelConfig.Implementation implementation
The actual model implementation.

Constructor Detail

ModelConfig

public ModelConfig()
Default constructor.


ModelConfig

public ModelConfig(ModelConfig.Implementation impl)
Constructor that takes an already-created implementation.

Method Detail

getOriginal

public ModelConfig.Implementation getOriginal()
Retrieves a reference to the underlying original implementation.


getModelImplementation

public Model.Implementation getModelImplementation(GlContext ctx,
                                                   Scope scope,
                                                   Model.Implementation impl)
Creates or updates a model implementation for this configuration.

Parameters:
scope - the model's expression scope.
impl - an existing implementation to reuse, if possible.
Returns:
either a reference to the existing implementation (if reused), a new implementation, or null if no implementation could be created.

getParticleGeometry

public GeometryConfig getParticleGeometry(GlContext ctx)
Returns the GeometryConfig to use when this model is selected for use within a particle system (or null if it cannot be used).


getParticleMaterial

public ConfigReference<MaterialConfig> getParticleMaterial(GlContext ctx)
Returns a reference to the material to use when this model is selected for use within a particle system.


init

public void init(ConfigManager cfgmgr)
Description copied from class: ManagedConfig
Initializes this config with a reference to the config manager that it should use to resolve references.

Overrides:
init in class ManagedConfig

getConfigManager

public ConfigManager getConfigManager()
Description copied from class: ManagedConfig
Returns a reference to the config manager to use when resolving references within this config.

Overrides:
getConfigManager in class ManagedConfig

updateFromSource

public void updateFromSource(EditorContext ctx,
                             boolean force)
Description copied from class: ManagedConfig
Updates this configuration from its external source, if any.

Overrides:
updateFromSource in class ManagedConfig
force - if true, reload the source data even if it has already been loaded.

validateReferences

public boolean validateReferences(String where,
                                  PrintStream out)
Description copied from class: ManagedConfig
Validates the references in this config.

Overrides:
validateReferences in class ParameterizedConfig
Returns:
true if the references are valid


Copyright © 2011. All Rights Reserved.