|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.geometry.Geometry
com.threerings.opengl.geometry.DynamicGeometry
com.threerings.opengl.effect.ParticleGeometry
public abstract class ParticleGeometry
Represents a particle geometry instance.
| Nested Class Summary | |
|---|---|
static class |
ParticleGeometry.Lines
Renders particles as single line segments. |
static class |
ParticleGeometry.LineTrails
Renders particles as multi-segment line trails. |
static class |
ParticleGeometry.Meshes
Renders particles as meshes. |
static class |
ParticleGeometry.Points
Renders particles as points. |
static class |
ParticleGeometry.Quads
Renders particles as single quads. |
static class |
ParticleGeometry.QuadTrails
Renders particles as multi-segment quad trails. |
| Field Summary | |
|---|---|
protected ArrayState[] |
_arrayStates
The array states for each pass. |
protected Vector3f |
_center
The center of the geometry. |
protected int |
_colorOffset
The offset of the color data. |
protected ParticleSystemConfig.Layer |
_config
The configuration of the layer. |
protected SimpleBatch.DrawElements |
_drawCommand
The draw command shared by all passes. |
protected Vector3f |
_last
Used to compute particle positions. |
protected MutableInteger |
_living
The number of particles currently active. |
protected Vector3f |
_n
Used to compute particle normals. |
protected Vector3f |
_next
Used to compute particle positions. |
protected int |
_normalOffset
The offset of the normal data, or -1 if not using normals. |
protected Particle[] |
_particles
The particles to render. |
protected Vector3f |
_position
Used to compute particle positions. |
protected Vector3f |
_r
Used to compute particle offsets. |
protected Quaternion |
_rotation
Used to compute particle rotations. |
protected Vector3f |
_s
Used to compute particle offsets. |
protected int |
_stride
The stride (number of floats) between adjacent vertices. |
protected Vector3f |
_t
Used to compute particle offsets. |
protected int |
_texCoordOffset
The offset of the texture coordinate data. |
protected TransformState |
_transformState
The layer's transform state. |
protected int |
_vertexOffset
The offset of the vertex data. |
protected Vector3f |
_view
Used to store the view vector. |
protected Quaternion |
_vrot
Used to compute particle rotations. |
protected Transform3D |
_xform
Used to compose particle transforms. |
| Fields inherited from class com.threerings.opengl.geometry.DynamicGeometry |
|---|
_arrayBuffer, _data, _floatArray, _scratchBuffer |
| Fields inherited from class com.threerings.opengl.geometry.Geometry |
|---|
EMPTY |
| Constructor Summary | |
|---|---|
ParticleGeometry(Scope scope)
Creates a new geometry object. |
|
| Method Summary | |
|---|---|
protected static void |
computeOffset(Vector3f v1,
Vector3f v2,
float size,
Vector3f result)
Computes an offset vector orthogonal to the two provided vectors with the specified size. |
protected ShortBuffer |
createIndices()
Creates and populates the index buffer. |
ArrayState |
getArrayState(int pass)
Returns the array state for the specified pass. |
Vector3f |
getCenter()
Returns a reference to the location of the center of the geometry (used for depth sorting). |
SimpleBatch.DrawCommand |
getDrawCommand(int pass)
Returns the draw command for the specified pass. |
protected abstract int |
getMode()
Returns the primitive mode. |
protected abstract int |
getParticleIndexCount()
Returns the number of indices in each particle. |
protected abstract int |
getParticleVertexCount()
Returns the number of vertices in each particle. |
protected abstract int[] |
getPrototypeIndices()
Returns the array of prototype indices that will be replicated at different offsets to create the actual index buffer. |
protected void |
init(GlContext ctx,
PassDescriptor[] passes)
Initializes the geometry. |
void |
update()
Updates the state of the geometry. |
protected static int |
write(float[] data,
int idx,
int stride,
Color4f value)
Writes a color to the data buffer at the specified position and returns the position advanced by the stride. |
protected static int |
write(float[] data,
int idx,
int stride,
float v0,
float v1)
Writes a pair of values to the data buffer at the specified position and returns the position advanced by the stride (the hope is that these methods will be inlined; if not, they should be expanded manually). |
protected static int |
write(float[] data,
int idx,
int stride,
float v0,
float v1,
float v2)
Writes a triplet to the data buffer at the specified position and returns the position advanced by the stride. |
protected static int |
write(float[] data,
int idx,
int stride,
float v0,
float v1,
float v2,
float v3)
Writes a quadruplet to the data buffer at the specified position and returns the position advanced by the stride. |
protected static int |
write(float[] data,
int idx,
int stride,
Vector3f value)
Writes a vector to the data buffer at the specified position and returns the position advanced by the stride. |
| Methods inherited from class com.threerings.opengl.geometry.DynamicGeometry |
|---|
getScratchBuffer, requiresUpdate, updateData |
| Methods inherited from class com.threerings.opengl.geometry.Geometry |
|---|
getBoneMatrices, getCoordSpace |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@Bound protected ParticleSystemConfig.Layer _config
@Bound protected Particle[] _particles
@Bound protected MutableInteger _living
@Bound protected TransformState _transformState
@Bound protected Vector3f _center
protected int _stride
protected int _texCoordOffset
protected int _colorOffset
protected int _normalOffset
protected int _vertexOffset
protected ArrayState[] _arrayStates
protected SimpleBatch.DrawElements _drawCommand
protected Transform3D _xform
protected Vector3f _position
protected Vector3f _last
protected Vector3f _next
protected Vector3f _view
protected Quaternion _rotation
protected Quaternion _vrot
protected Vector3f _s
protected Vector3f _t
protected Vector3f _r
protected Vector3f _n
| Constructor Detail |
|---|
public ParticleGeometry(Scope scope)
| Method Detail |
|---|
public Vector3f getCenter()
Geometry
getCenter in class Geometrypublic ArrayState getArrayState(int pass)
Geometry
getArrayState in class Geometrypublic SimpleBatch.DrawCommand getDrawCommand(int pass)
Geometry
getDrawCommand in class Geometrypublic void update()
Geometry
update in class DynamicGeometry
protected void init(GlContext ctx,
PassDescriptor[] passes)
protected ShortBuffer createIndices()
protected abstract int getMode()
protected abstract int getParticleVertexCount()
protected abstract int getParticleIndexCount()
protected abstract int[] getPrototypeIndices()
protected static void computeOffset(Vector3f v1,
Vector3f v2,
float size,
Vector3f result)
protected static int write(float[] data,
int idx,
int stride,
float v0,
float v1)
protected static int write(float[] data,
int idx,
int stride,
float v0,
float v1,
float v2)
protected static int write(float[] data,
int idx,
int stride,
float v0,
float v1,
float v2,
float v3)
protected static int write(float[] data,
int idx,
int stride,
Vector3f value)
protected static int write(float[] data,
int idx,
int stride,
Color4f value)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||