java.lang.Object
com.ardor3d.extension.animation.skeletal.util.SkinUtils

public class SkinUtils extends Object
General utility methods useful for Skin manipulation.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static float[]
    convertToFloat(short... shorts)
    Convert a short array to a float array
    static float[]
    pad(float[] src, int srcElementSize, int attribSize)
    Expand out our src data so that each attribute is a certain size, padding with 0's as needed.
    static short[]
    pad(short[] src, int srcElementSize, int attribSize)
    Expand out our src data so that each attribute is a certain size, padding with 0's as needed.
    static float[]
    reorderAndPad(float[] src, int srcElementSize, int matSide)
    Rearrange the data from data per element, to a list of matSide x matSide matrices, output by row as such: row0element0, row0element1, row0element2...
    row1element0, row1element1, row1element2...
    row2element0, row2element1, row2element2...
    If there is not enough values in the source data to fill out a row, 0 is used.
    static void
    setAutoUpdateBounds(Spatial root, boolean doUpdate)
    Simple utility to turn on / off bounding volume updating on skinned mesh objects in a given scenegraph.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SkinUtils

      public SkinUtils()
  • Method Details

    • setAutoUpdateBounds

      public static void setAutoUpdateBounds(Spatial root, boolean doUpdate)
      Simple utility to turn on / off bounding volume updating on skinned mesh objects in a given scenegraph.
      Parameters:
      root - the root node on the scenegraph
      doUpdate - if true, skinned mesh objects will automatically update their model bounds when applying pose.
    • convertToFloat

      public static float[] convertToFloat(short... shorts)
      Convert a short array to a float array
      Parameters:
      shorts - the short values
      Returns:
      our new float array
    • reorderAndPad

      public static float[] reorderAndPad(float[] src, int srcElementSize, int matSide)
      Rearrange the data from data per element, to a list of matSide x matSide matrices, output by row as such: row0element0, row0element1, row0element2...
      row1element0, row1element1, row1element2...
      row2element0, row2element1, row2element2...
      If there is not enough values in the source data to fill out a row, 0 is used.
      Parameters:
      src - our source data, stored as element0, element1, etc.
      srcElementSize - the number of values per element in our source data
      matSide - the size of the matrix edge... eg. 4 would mean a 4x4 matrix.
      Returns:
      our new data array.
    • pad

      public static float[] pad(float[] src, int srcElementSize, int attribSize)
      Expand out our src data so that each attribute is a certain size, padding with 0's as needed. If src is already correct size, we just return that without creating a new data array.
      Parameters:
      src - our source data, stored as element0, element1, etc.
      srcElementSize - the number of values per element in our source data
      attribSize - the desired size of each element in the return array.
      Returns:
      the padded array.
    • pad

      public static short[] pad(short[] src, int srcElementSize, int attribSize)
      Expand out our src data so that each attribute is a certain size, padding with 0's as needed. If src is already correct size, we just return that without creating a new data array.
      Parameters:
      src - our source data, stored as element0, element1, etc.
      srcElementSize - the number of values per element in our source data
      attribSize - the desired size of each element in the return array.
      Returns:
      the padded array.