com.threerings.opengl.renderer.config
Class ClientArrayConfig

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.opengl.renderer.config.ClientArrayConfig
All Implemented Interfaces:
Exportable, Copyable, Cloneable
Direct Known Subclasses:
GeometryConfig.AttributeArrayConfig

public class ClientArrayConfig
extends DeepObject
implements Exportable

Contains the configuration of a single client array.


Nested Class Summary
static class ClientArrayConfig.Type
          Type constants.
 
Field Summary
 FloatBuffer floatArray
          The float array, if using one.
 boolean normalized
          Whether or not to normalize the components.
 int offset
          The offset of the first component.
 int size
          The number of components in each element.
 int stride
          The stride between adjacent elements.
 ClientArrayConfig.Type type
          The type of the components.
 
Constructor Summary
ClientArrayConfig()
           
ClientArrayConfig(int size)
           
ClientArrayConfig(int size, FloatBuffer floatArray)
           
ClientArrayConfig(int size, int stride, int offset, FloatBuffer floatArray)
           
 
Method Summary
 boolean canMerge(ClientArrayConfig oarray)
          Checks whether, all other things being equal, we can merge this array with the specified other.
 ClientArray createClientArray()
          Creates a client array from this config.
 int getElementBytes()
          Returns the number of bytes in each element.
 void populateClientArray(ClientArray array)
          Populates the supplied client array with the data in this config.
 void populateFloatArray(float[] array, int doffset, int dstride)
          Extracts the contents of this array into the specified float array.
 void populateIntArray(int[] array, int doffset, int dstride)
          Extracts the contents of this array into the specified int array.
 
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

size

public int size
The number of components in each element.


type

public ClientArrayConfig.Type type
The type of the components.


normalized

public boolean normalized
Whether or not to normalize the components.


stride

public int stride
The stride between adjacent elements.


offset

public int offset
The offset of the first component.


floatArray

public FloatBuffer floatArray
The float array, if using one.

Constructor Detail

ClientArrayConfig

public ClientArrayConfig(int size)

ClientArrayConfig

public ClientArrayConfig(int size,
                         FloatBuffer floatArray)

ClientArrayConfig

public ClientArrayConfig(int size,
                         int stride,
                         int offset,
                         FloatBuffer floatArray)

ClientArrayConfig

public ClientArrayConfig()
Method Detail

getElementBytes

public int getElementBytes()
Returns the number of bytes in each element.


canMerge

public boolean canMerge(ClientArrayConfig oarray)
Checks whether, all other things being equal, we can merge this array with the specified other.


createClientArray

public ClientArray createClientArray()
Creates a client array from this config.


populateClientArray

public void populateClientArray(ClientArray array)
Populates the supplied client array with the data in this config.


populateFloatArray

public void populateFloatArray(float[] array,
                               int doffset,
                               int dstride)
Extracts the contents of this array into the specified float array.

Parameters:
doffset - the offset within the array at which to place the first element.
dstride - the stride between adjacent elements within the array.

populateIntArray

public void populateIntArray(int[] array,
                             int doffset,
                             int dstride)
Extracts the contents of this array into the specified int array.

Parameters:
doffset - the offset within the array at which to place the first element.
dstride - the stride between adjacent elements within the array.


Copyright © 2011. All Rights Reserved.