org.ogre4j
Class VertexAnimationTrack

java.lang.Object
  extended by org.xbig.base.NativeObject
      extended by org.ogre4j.VertexAnimationTrack
All Implemented Interfaces:
IAllocatedObject<IAnimationAllocPolicy>, IAnimationAllocatedObject, IAnimationTrack, IVertexAnimationTrack, INativeObject

public class VertexAnimationTrack
extends NativeObject
implements IVertexAnimationTrack


Nested Class Summary
static class VertexAnimationTrack.TargetMode
           
 
Nested classes/interfaces inherited from interface org.ogre4j.IAnimationTrack
IAnimationTrack.IKeyFrameIndexMap, IAnimationTrack.IKeyFrameList, IAnimationTrack.IListener
 
Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  VertexAnimationTrack(IAnimation parent, int handle, VertexAnimationType animType)
           
  VertexAnimationTrack(IAnimation parent, int handle, VertexAnimationType animType, IVertexData targetData, VertexAnimationTrack.TargetMode target)
           
  VertexAnimationTrack(InstancePointer p)
          This constructor is public for internal useage only!
protected VertexAnimationTrack(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  VertexAnimationTrack(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 void _buildKeyFrameIndexMap(Ivector<java.lang.Float> keyFrameTimes)
          Internal method to build keyframe time index map to translate global lower bound index to local lower bound index.
 IVertexAnimationTrack _clone(IAnimation newParent)
          Clone this track (internal use only)
 void _collectKeyFrameTimes(Ivector<java.lang.Float> keyFrameTimes)
          Internal method to collect keyframe times, in unique, ordered format.
 void _keyFrameDataChanged()
          Internal method used to tell the track that keyframe data has been changed, which may cause it to rebuild some internal data.
 void apply(ITimeIndex timeIndex, float weight, float scale)
          Applies an animation track to the designated target.
 void applyToVertexData(IVertexData data, ITimeIndex timeIndex, float weight, IPoseList poseList)
          As the 'apply' method but applies to specified instead of associated data.
 IKeyFrame createKeyFrame(float timePos)
          Creates a new and adds it to this animation at the given time index.
 IVertexMorphKeyFrame createVertexMorphKeyFrame(float timePos)
          Creates a new morph and adds it to this animation at the given time index.
 IVertexPoseKeyFrame createVertexPoseKeyFrame(float timePos)
          Creates the single pose and adds it to this animation.
 void delete()
          Deletes the corresponding C++ object.
 void finalize()
           
 VertexAnimationType getAnimationType()
          Get the type of vertex animation we're performing.
 IVertexData getAssociatedVertexData()
          Gets the associated which this track will update.
 int getHandle()
          Get the handle associated with this track.
 void getInterpolatedKeyFrame(ITimeIndex timeIndex, IKeyFrame kf)
          This method in fact does nothing, since interpolation is not performed inside the keyframes for this type of track.
 IKeyFrame getKeyFrame(int index)
          Returns the at the specified index.
 float getKeyFramesAtTime(ITimeIndex timeIndex, NativeObjectPointer<IKeyFrame> keyFrame1, NativeObjectPointer<IKeyFrame> keyFrame2, IntegerPointer firstKeyIndex)
          Gets the 2 objects which are active at the time given, and the blend value between them.
 int getNumKeyFrames()
          Returns the number of keyframes in this animation.
 IAnimation getParent()
          Returns the parent object for this track.
 VertexAnimationTrack.TargetMode getTargetMode()
           
 IVertexMorphKeyFrame getVertexMorphKeyFrame(int index)
          Returns the morph at the specified index.
 IVertexPoseKeyFrame getVertexPoseKeyFrame(int index)
          Returns the pose at the specified index.
 boolean hasNonZeroKeyFrames()
          Method to determine if this track has any KeyFrames which are doing anything useful - can be used to determine if this track can be optimised out.
 void optimise()
          Optimise the current track by removing any duplicate keyframes.
 void removeAllKeyFrames()
          Removes all the KeyFrames from this track.
 void removeKeyFrame(int index)
          Removes a by it's index.
 void setAssociatedVertexData(IVertexData data)
          Sets the associated which this track will update.
 void setListener(IAnimationTrack.IListener l)
          Set a listener for this track.
 void setTargetMode(VertexAnimationTrack.TargetMode m)
           
 
Methods inherited from class org.xbig.base.NativeObject
disconnectFromNativeObject, equals, getInstancePointer, hashCode, setInstancePointer, setInstancePointer, setInstancePointer, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xbig.base.INativeObject
disconnectFromNativeObject, getInstancePointer, setInstancePointer, setInstancePointer, setInstancePointer
 

Constructor Detail

VertexAnimationTrack

public VertexAnimationTrack(InstancePointer p)
This constructor is public for internal useage only! Do not use it!


VertexAnimationTrack

protected VertexAnimationTrack(InstancePointer p,
                               boolean remote)
Creates a Java wrapper object for an existing C++ object. If remote is set to 'true' this object cannot be deleted in Java.


VertexAnimationTrack

public VertexAnimationTrack(WithoutNativeObject val)
Allows creation of Java objects without C++ objects.

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()

VertexAnimationTrack

public VertexAnimationTrack(IAnimation parent,
                            int handle,
                            VertexAnimationType animType)

VertexAnimationTrack

public VertexAnimationTrack(IAnimation parent,
                            int handle,
                            VertexAnimationType animType,
                            IVertexData targetData,
                            VertexAnimationTrack.TargetMode target)
Method Detail

delete

public void delete()
Description copied from interface: INativeObject
Deletes the corresponding C++ object.

Subclasses must implement this but if the native instance was created by the underlying library the native call to dispose must not happen!

Specified by:
delete in interface INativeObject
Specified by:
delete in class NativeObject
See Also:
#remote

finalize

public void finalize()
Overrides:
finalize in class NativeObject

getAnimationType

public VertexAnimationType getAnimationType()
Get the type of vertex animation we're performing.

Specified by:
getAnimationType in interface IVertexAnimationTrack

createVertexMorphKeyFrame

public IVertexMorphKeyFrame createVertexMorphKeyFrame(float timePos)
Creates a new morph and adds it to this animation at the given time index.

Specified by:
createVertexMorphKeyFrame in interface IVertexAnimationTrack

createVertexPoseKeyFrame

public IVertexPoseKeyFrame createVertexPoseKeyFrame(float timePos)
Creates the single pose and adds it to this animation.

Specified by:
createVertexPoseKeyFrame in interface IVertexAnimationTrack

getInterpolatedKeyFrame

public void getInterpolatedKeyFrame(ITimeIndex timeIndex,
                                    IKeyFrame kf)
This method in fact does nothing, since interpolation is not performed inside the keyframes for this type of track.

Specified by:
getInterpolatedKeyFrame in interface IAnimationTrack
Specified by:
getInterpolatedKeyFrame in interface IVertexAnimationTrack

apply

public void apply(ITimeIndex timeIndex,
                  float weight,
                  float scale)
Description copied from interface: IAnimationTrack
Applies an animation track to the designated target.

Specified by:
apply in interface IAnimationTrack
Specified by:
apply in interface IVertexAnimationTrack

applyToVertexData

public void applyToVertexData(IVertexData data,
                              ITimeIndex timeIndex,
                              float weight,
                              IPoseList poseList)
As the 'apply' method but applies to specified instead of associated data.

Specified by:
applyToVertexData in interface IVertexAnimationTrack

getVertexMorphKeyFrame

public IVertexMorphKeyFrame getVertexMorphKeyFrame(int index)
Returns the morph at the specified index.

Specified by:
getVertexMorphKeyFrame in interface IVertexAnimationTrack

getVertexPoseKeyFrame

public IVertexPoseKeyFrame getVertexPoseKeyFrame(int index)
Returns the pose at the specified index.

Specified by:
getVertexPoseKeyFrame in interface IVertexAnimationTrack

setAssociatedVertexData

public void setAssociatedVertexData(IVertexData data)
Sets the associated which this track will update.

Specified by:
setAssociatedVertexData in interface IVertexAnimationTrack

getAssociatedVertexData

public IVertexData getAssociatedVertexData()
Gets the associated which this track will update.

Specified by:
getAssociatedVertexData in interface IVertexAnimationTrack

setTargetMode

public void setTargetMode(VertexAnimationTrack.TargetMode m)
Specified by:
setTargetMode in interface IVertexAnimationTrack

getTargetMode

public VertexAnimationTrack.TargetMode getTargetMode()
Specified by:
getTargetMode in interface IVertexAnimationTrack

hasNonZeroKeyFrames

public boolean hasNonZeroKeyFrames()
Method to determine if this track has any KeyFrames which are doing anything useful - can be used to determine if this track can be optimised out.

Specified by:
hasNonZeroKeyFrames in interface IAnimationTrack
Specified by:
hasNonZeroKeyFrames in interface IVertexAnimationTrack

optimise

public void optimise()
Optimise the current track by removing any duplicate keyframes.

Specified by:
optimise in interface IAnimationTrack
Specified by:
optimise in interface IVertexAnimationTrack

_clone

public IVertexAnimationTrack _clone(IAnimation newParent)
Clone this track (internal use only)

Specified by:
_clone in interface IVertexAnimationTrack

getHandle

public int getHandle()
Get the handle associated with this track.

Specified by:
getHandle in interface IAnimationTrack

getNumKeyFrames

public int getNumKeyFrames()
Returns the number of keyframes in this animation.

Specified by:
getNumKeyFrames in interface IAnimationTrack

getKeyFrame

public IKeyFrame getKeyFrame(int index)
Returns the at the specified index.

Specified by:
getKeyFrame in interface IAnimationTrack

getKeyFramesAtTime

public float getKeyFramesAtTime(ITimeIndex timeIndex,
                                NativeObjectPointer<IKeyFrame> keyFrame1,
                                NativeObjectPointer<IKeyFrame> keyFrame2,
                                IntegerPointer firstKeyIndex)
Gets the 2 objects which are active at the time given, and the blend value between them.

Specified by:
getKeyFramesAtTime in interface IAnimationTrack

createKeyFrame

public IKeyFrame createKeyFrame(float timePos)
Creates a new and adds it to this animation at the given time index.

Specified by:
createKeyFrame in interface IAnimationTrack

removeKeyFrame

public void removeKeyFrame(int index)
Removes a by it's index.

Specified by:
removeKeyFrame in interface IAnimationTrack

removeAllKeyFrames

public void removeAllKeyFrames()
Removes all the KeyFrames from this track.

Specified by:
removeAllKeyFrames in interface IAnimationTrack

_keyFrameDataChanged

public void _keyFrameDataChanged()
Internal method used to tell the track that keyframe data has been changed, which may cause it to rebuild some internal data.

Specified by:
_keyFrameDataChanged in interface IAnimationTrack

_collectKeyFrameTimes

public void _collectKeyFrameTimes(Ivector<java.lang.Float> keyFrameTimes)
Internal method to collect keyframe times, in unique, ordered format.

Specified by:
_collectKeyFrameTimes in interface IAnimationTrack

_buildKeyFrameIndexMap

public void _buildKeyFrameIndexMap(Ivector<java.lang.Float> keyFrameTimes)
Internal method to build keyframe time index map to translate global lower bound index to local lower bound index.

Specified by:
_buildKeyFrameIndexMap in interface IAnimationTrack

setListener

public void setListener(IAnimationTrack.IListener l)
Set a listener for this track.

Specified by:
setListener in interface IAnimationTrack

getParent

public IAnimation getParent()
Returns the parent object for this track.

Specified by:
getParent in interface IAnimationTrack


Copyright © 2007 netAllied GmbH. All Rights Reserved.