com.threerings.opengl.effect
Class BaseParticleSystem.Layer

java.lang.Object
  extended by com.threerings.expr.SimpleScope
      extended by com.threerings.opengl.effect.BaseParticleSystem.Layer
All Implemented Interfaces:
Scope, ScopeUpdateListener
Direct Known Subclasses:
MetaParticleSystem.Layer, ParticleSystem.Layer
Enclosing class:
BaseParticleSystem

public abstract static class BaseParticleSystem.Layer
extends SimpleScope

A single layer of the system.


Field Summary
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
BaseParticleSystem.Layer(GlContext ctx, Scope parentScope)
          Creates a new layer.
 
Method Summary
abstract  void composite()
          Composites the layer for rendering.
 void drawBounds()
          Draws the bounds of the layer.
 Camera getCamera()
          Returns a reference to the camera.
 BaseParticleSystemConfig.Layer getConfig()
          Returns a reference to the layer's config.
 String getScopeName()
          Returns the name of this scope for purposes of qualification.
 Vector3f pointToLayer(Vector3f point, boolean emitter)
          Transforms a point in-place from world space or emitter space into the space of the layer (either world space or emitter space, depending on the value of BaseParticleSystemConfig.Layer.moveParticlesWithEmitter).
 void reset()
          Resets the state of the layer.
 Quaternion rotationToLayer(Quaternion rot, boolean emitter)
          Transforms a rotation in-place from world space or emitter space into the space of the layer (either world space or emitter space, depending on the value of BaseParticleSystemConfig.Layer.moveParticlesWithEmitter).
 void setConfig(BaseParticleSystemConfig.Layer config)
          Sets the layer's config.
 boolean tick(float elapsed)
          Updates the current particle state based on the elapsed time in seconds.
 Vector3f vectorToLayer(Vector3f vector, boolean emitter)
          Transforms a vector in-place from world space or emitter space into the space of the layer (either world space or emitter space, depending on the value of BaseParticleSystemConfig.Layer.moveParticlesWithEmitter).
 
Methods inherited from class com.threerings.expr.SimpleScope
addListener, dispose, get, getParentScope, removeListener, scopeUpdated
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseParticleSystem.Layer

public BaseParticleSystem.Layer(GlContext ctx,
                                Scope parentScope)
Creates a new layer.

Method Detail

setConfig

public void setConfig(BaseParticleSystemConfig.Layer config)
Sets the layer's config.


getConfig

public BaseParticleSystemConfig.Layer getConfig()
Returns a reference to the layer's config.


getCamera

public Camera getCamera()
Returns a reference to the camera.


reset

public void reset()
Resets the state of the layer.


tick

public boolean tick(float elapsed)
Updates the current particle state based on the elapsed time in seconds.

Returns:
true if this layer has completed, false if it is still active.

pointToLayer

public Vector3f pointToLayer(Vector3f point,
                             boolean emitter)
Transforms a point in-place from world space or emitter space into the space of the layer (either world space or emitter space, depending on the value of BaseParticleSystemConfig.Layer.moveParticlesWithEmitter).

Parameters:
emitter - if true, transform from emitter space (else from world space).
Returns:
a reference to the transformed point, for chaining.

vectorToLayer

public Vector3f vectorToLayer(Vector3f vector,
                              boolean emitter)
Transforms a vector in-place from world space or emitter space into the space of the layer (either world space or emitter space, depending on the value of BaseParticleSystemConfig.Layer.moveParticlesWithEmitter).

Parameters:
emitter - if true, transform from emitter space (else from world space).
Returns:
a reference to the transformed vector, for chaining.

rotationToLayer

public Quaternion rotationToLayer(Quaternion rot,
                                  boolean emitter)
Transforms a rotation in-place from world space or emitter space into the space of the layer (either world space or emitter space, depending on the value of BaseParticleSystemConfig.Layer.moveParticlesWithEmitter).

Parameters:
emitter - if true, transform from emitter space (else from world space).
Returns:
a reference to the transformed rotation, for chaining.

drawBounds

public void drawBounds()
Draws the bounds of the layer.


composite

public abstract void composite()
Composites the layer for rendering.


getScopeName

public String getScopeName()
Description copied from interface: Scope
Returns the name of this scope for purposes of qualification. Can return null if qualified symbols cannot specifically address this scope.

Specified by:
getScopeName in interface Scope
Overrides:
getScopeName in class SimpleScope


Copyright © 2011. All Rights Reserved.