com.jme3.scene.plugins.blender.animations
Class IpoHelper

java.lang.Object
  extended by com.jme3.scene.plugins.blender.AbstractBlenderHelper
      extended by com.jme3.scene.plugins.blender.animations.IpoHelper

public class IpoHelper
extends AbstractBlenderHelper

This class helps to compute values from interpolation curves for features like animation or constraint influence. The curves are 3rd degree bezier curves.


Field Summary
 
Fields inherited from class com.jme3.scene.plugins.blender.AbstractBlenderHelper
blenderVersion, fixUpAxis, upAxisRotationQuaternion
 
Constructor Summary
IpoHelper(java.lang.String blenderVersion, boolean fixUpAxis)
          This constructor parses the given blender version and stores the result.
 
Method Summary
 Ipo fromAction(Structure actionStructure, BlenderContext blenderContext)
          This method creates an ipo object used for interpolation calculations.
 Ipo fromIpoStructure(Structure ipoStructure, BlenderContext blenderContext)
          This method creates an ipo object used for interpolation calculations.
 Ipo fromValue(float constValue)
          This method creates an ipo with only a single value.
 int getCurveType(Structure structure, BlenderContext blenderContext)
          This method returns the type of the ipo curve.
 boolean shouldBeLoaded(Structure structure, BlenderContext blenderContext)
          This method analyzes the given structure and the data contained within blender context and decides if the feature should be loaded.
 
Methods inherited from class com.jme3.scene.plugins.blender.AbstractBlenderHelper
applyProperties, clearState, isBlank, loadProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IpoHelper

public IpoHelper(java.lang.String blenderVersion,
                 boolean fixUpAxis)
This constructor parses the given blender version and stores the result. Some functionalities may differ in different blender versions.

Parameters:
blenderVersion - the version read from the blend file
fixUpAxis - a variable that indicates if the Y asxis is the UP axis or not
Method Detail

fromIpoStructure

public Ipo fromIpoStructure(Structure ipoStructure,
                            BlenderContext blenderContext)
                     throws BlenderFileException
This method creates an ipo object used for interpolation calculations.

Parameters:
ipoStructure - the structure with ipo definition
blenderContext - the blender context
Returns:
the ipo object
Throws:
BlenderFileException - this exception is thrown when the blender file is somehow corrupted

fromAction

public Ipo fromAction(Structure actionStructure,
                      BlenderContext blenderContext)
               throws BlenderFileException
This method creates an ipo object used for interpolation calculations. It should be called for blender version 2.50 and higher.

Parameters:
actionStructure - the structure with action definition
blenderContext - the blender context
Returns:
the ipo object
Throws:
BlenderFileException - this exception is thrown when the blender file is somehow corrupted

getCurveType

public int getCurveType(Structure structure,
                        BlenderContext blenderContext)
This method returns the type of the ipo curve.

Parameters:
structure - the structure must contain the 'rna_path' field and 'array_index' field (the type is not important here)
blenderContext - the blender context
Returns:
the type of the curve

fromValue

public Ipo fromValue(float constValue)
This method creates an ipo with only a single value. No track type is specified so do not use it for calculating tracks.

Parameters:
constValue - the value of this ipo
Returns:
constant ipo

shouldBeLoaded

public boolean shouldBeLoaded(Structure structure,
                              BlenderContext blenderContext)
Description copied from class: AbstractBlenderHelper
This method analyzes the given structure and the data contained within blender context and decides if the feature should be loaded.

Specified by:
shouldBeLoaded in class AbstractBlenderHelper
Parameters:
structure - structure to be analyzed
blenderContext - the blender context
Returns:
true if the feature should be loaded and false otherwise