com.threerings.opengl.geometry.config
Class GeometryConfig.Stored

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.opengl.geometry.config.GeometryConfig
          extended by com.threerings.opengl.geometry.config.GeometryConfig.Stored
All Implemented Interfaces:
Exportable, Copyable, Cloneable
Direct Known Subclasses:
GeometryConfig.ArrayStored, GeometryConfig.IndexedStored
Enclosing class:
GeometryConfig

public abstract static class GeometryConfig.Stored
extends GeometryConfig

Superclass of configurations with stored geometry.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.opengl.geometry.config.GeometryConfig
GeometryConfig.ArrayStored, GeometryConfig.AttributeArrayConfig, GeometryConfig.IndexedStored, GeometryConfig.Mode, GeometryConfig.SkinnedIndexedStored, GeometryConfig.Stored
 
Field Summary
 Box bounds
          The bounds of the geometry.
 ClientArrayConfig colorArray
          The color array.
 GeometryConfig.Mode mode
          The type of primitives to render.
 ClientArrayConfig normalArray
          The normal array.
 ClientArrayConfig[] texCoordArrays
          The texture coordinate arrays.
 ClientArrayConfig vertexArray
          The vertex array.
 GeometryConfig.AttributeArrayConfig[] vertexAttribArrays
          The vertex attribute arrays.
 
Constructor Summary
GeometryConfig.Stored()
           
GeometryConfig.Stored(Box bounds, GeometryConfig.Mode mode, GeometryConfig.AttributeArrayConfig[] vertexAttribArrays, ClientArrayConfig[] texCoordArrays, ClientArrayConfig colorArray, ClientArrayConfig normalArray, ClientArrayConfig vertexArray)
           
 
Method Summary
 ArrayState[] createArrayStates(GlContext ctx, PassDescriptor[] passes, boolean staticVBO, boolean staticIBO)
          Creates a set of array states for this geometry.
 ArrayState[] createArrayStates(GlContext ctx, PassDescriptor[] passes, PassSummary summary, boolean staticVBO, boolean staticIBO, BufferObject arrayBuffer, FloatBuffer floatArray)
          Creates a set of array states for this geometry.
abstract  SimpleBatch.DrawCommand createDrawCommand(boolean ibo)
          Creates the non-list draw command for this geometry.
 Geometry createGeometry(GlContext ctx, Scope scope, DeformerConfig deformer, PassDescriptor[] passes)
          Creates an instance of the geometry described by this config.
 Geometry createStaticGeometry(GlContext ctx, Scope scope, PassDescriptor[] passes)
          Creates static geometry for the described passes.
 Matrix4f[] getBoneMatrices(Scope scope)
          Returns the matrices of the bones influencing this geometry, if any.
 Box getBounds()
          Returns the bounds of the geometry.
 float[] getFloatArray(boolean align, ClientArrayConfig... arrays)
          Returns a float array containing the interleaved contents of the specified arrays.
 int[] getIntArray(boolean align, ClientArrayConfig... arrays)
          Returns an int array containing the interleaved contents of the specified arrays.
 ClientArrayConfig getTexCoordArray(int idx)
          Returns the texture coordinate array config at the specified index.
 GeometryConfig.AttributeArrayConfig getVertexAttribArray(String name)
          Returns the vertex attribute array config with the specified name.
 int getVertexCount()
          Returns the number of vertices in the arrays.
 GeometryConfig merge(List<TransformedGeometry> glist)
          Attempts to merge several transformed geometries.
 
Methods inherited from class com.threerings.opengl.geometry.config.GeometryConfig
createQuad, getQuad
 
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

bounds

public Box bounds
The bounds of the geometry.


mode

public GeometryConfig.Mode mode
The type of primitives to render.


vertexAttribArrays

public GeometryConfig.AttributeArrayConfig[] vertexAttribArrays
The vertex attribute arrays.


texCoordArrays

public ClientArrayConfig[] texCoordArrays
The texture coordinate arrays.


colorArray

public ClientArrayConfig colorArray
The color array.


normalArray

public ClientArrayConfig normalArray
The normal array.


vertexArray

public ClientArrayConfig vertexArray
The vertex array.

Constructor Detail

GeometryConfig.Stored

public GeometryConfig.Stored(Box bounds,
                             GeometryConfig.Mode mode,
                             GeometryConfig.AttributeArrayConfig[] vertexAttribArrays,
                             ClientArrayConfig[] texCoordArrays,
                             ClientArrayConfig colorArray,
                             ClientArrayConfig normalArray,
                             ClientArrayConfig vertexArray)

GeometryConfig.Stored

public GeometryConfig.Stored()
Method Detail

getVertexCount

public int getVertexCount()
Returns the number of vertices in the arrays.


getVertexAttribArray

public GeometryConfig.AttributeArrayConfig getVertexAttribArray(String name)
Returns the vertex attribute array config with the specified name.


getTexCoordArray

public ClientArrayConfig getTexCoordArray(int idx)
Returns the texture coordinate array config at the specified index.


getFloatArray

public float[] getFloatArray(boolean align,
                             ClientArrayConfig... arrays)
Returns a float array containing the interleaved contents of the specified arrays.

Parameters:
align - if true, use power-of-two alignment.

getIntArray

public int[] getIntArray(boolean align,
                         ClientArrayConfig... arrays)
Returns an int array containing the interleaved contents of the specified arrays.

Parameters:
align - if true, use power-of-two alignment.

createStaticGeometry

public Geometry createStaticGeometry(GlContext ctx,
                                     Scope scope,
                                     PassDescriptor[] passes)
Creates static geometry for the described passes.


getBoneMatrices

public Matrix4f[] getBoneMatrices(Scope scope)
Returns the matrices of the bones influencing this geometry, if any.


createArrayStates

public ArrayState[] createArrayStates(GlContext ctx,
                                      PassDescriptor[] passes,
                                      boolean staticVBO,
                                      boolean staticIBO)
Creates a set of array states for this geometry.

Parameters:
staticVBO - if true, use a shared static buffer object for vertex data.
staticIBO - if true, use a shared static buffer object for index data.

createArrayStates

public ArrayState[] createArrayStates(GlContext ctx,
                                      PassDescriptor[] passes,
                                      PassSummary summary,
                                      boolean staticVBO,
                                      boolean staticIBO,
                                      BufferObject arrayBuffer,
                                      FloatBuffer floatArray)
Creates a set of array states for this geometry.

Parameters:
staticVBO - if true, use a shared static buffer object for vertex data.
staticIBO - if true, use a shared static buffer object for index data.
arrayBuffer - the precreated buffer object to use for the arrays, if any.
floatArray - the precreated float buffer to use for the arrays, if any.

createDrawCommand

public abstract SimpleBatch.DrawCommand createDrawCommand(boolean ibo)
Creates the non-list draw command for this geometry.

Parameters:
ibo - if true, indices will be read from a buffer object.

getBounds

public Box getBounds()
Description copied from class: GeometryConfig
Returns the bounds of the geometry.

Specified by:
getBounds in class GeometryConfig

createGeometry

public Geometry createGeometry(GlContext ctx,
                               Scope scope,
                               DeformerConfig deformer,
                               PassDescriptor[] passes)
Description copied from class: GeometryConfig
Creates an instance of the geometry described by this config.

Specified by:
createGeometry in class GeometryConfig

merge

public GeometryConfig merge(List<TransformedGeometry> glist)
Description copied from class: GeometryConfig
Attempts to merge several transformed geometries.

Overrides:
merge in class GeometryConfig
Parameters:
glist - a list of the geometry to merge. Any successfully merged elements will be removed from the list.
Returns:
the combined geometry, or null if we could not merge any.


Copyright © 2011. All Rights Reserved.