Class TransformChannel
java.lang.Object
com.ardor3d.extension.animation.skeletal.clip.AbstractAnimationChannel
com.ardor3d.extension.animation.skeletal.clip.TransformChannel
- All Implemented Interfaces:
Savable
- Direct Known Subclasses:
JointChannel
An animation channel consisting of a series of transforms interpolated over time.
-
Field Summary
Fields inherited from class com.ardor3d.extension.animation.skeletal.clip.AbstractAnimationChannel
_channelName, _times
-
Constructor Summary
ModifierConstructorDescriptionprotected
TransformChannel
(String channelName, float[] times, ReadOnlyQuaternion[] rotations, ReadOnlyVector3[] translations, ReadOnlyVector3[] scales) Construct a new TransformChannel.TransformChannel
(String channelName, float[] times, ReadOnlyTransform[] transforms) Construct a new TransformChannel. -
Method Summary
Modifier and TypeMethodDescriptioncreateStateDataObject
(AnimationClipInstance instance) Class
<? extends TransformChannel> getSubchannelBySample
(String name, int startSample, int endSample) Returns a new channel of the same content as this, but trimmed to just the times between start and end sample.getSubchannelByTime
(String name, float startTime, float endTime) Returns a new channel of the same content as this, but trimmed to just the times between start and end sample.getTransformData
(int index, TransformData store) Apply a specific index of this channel to a TransformData object.static TransformChannel
protected TransformChannel
newChannel
(String name, float[] times, ReadOnlyQuaternion[] rotations, ReadOnlyVector3[] translations, ReadOnlyVector3[] scales) void
read
(InputCapsule capsule) void
setCurrentSample
(int sampleIndex, double progressPercent, Object applyTo) Sets data on the given applyTo Object for the given sampleIndex and a percent progress towards the sample following it.void
write
(OutputCapsule capsule) Methods inherited from class com.ardor3d.extension.animation.skeletal.clip.AbstractAnimationChannel
getChannelName, getMaxTime, getSampleCount, getSubchannelBySample, getSubchannelByTime, getTimes, updateSample
-
Constructor Details
-
TransformChannel
public TransformChannel(String channelName, float[] times, ReadOnlyQuaternion[] rotations, ReadOnlyVector3[] translations, ReadOnlyVector3[] scales) Construct a new TransformChannel.- Parameters:
channelName
- our name.times
- our time offset values.rotations
- the rotations to set on this channel at each time offset.translations
- the translations to set on this channel at each time offset.scales
- the scales to set on this channel at each time offset.
-
TransformChannel
Construct a new TransformChannel.- Parameters:
channelName
- our name.times
- our time offset values.transforms
- the transform to set on this channel at each time offset. These are separated into rotation, scale and translation components. Note that supplying transforms with non-rotational matrices (with built in shear, scale.) will produce a warning and may not give you the expected result.
-
TransformChannel
protected TransformChannel()
-
-
Method Details
-
setCurrentSample
Description copied from class:AbstractAnimationChannel
Sets data on the given applyTo Object for the given sampleIndex and a percent progress towards the sample following it.- Specified by:
setCurrentSample
in classAbstractAnimationChannel
- Parameters:
sampleIndex
- the sample to pull information from.progressPercent
- a value [0.0, 1.0] representing progress from sampleIndex to sampleIndex+1applyTo
- the data object to apply this channel's information to.
-
getTransformData
Apply a specific index of this channel to a TransformData object.- Parameters:
index
- the index to grab.store
- the TransformData to store in. If null, a new one is created.- Returns:
- our resulting TransformData.
-
getSubchannelBySample
Description copied from class:AbstractAnimationChannel
Returns a new channel of the same content as this, but trimmed to just the times between start and end sample.- Specified by:
getSubchannelBySample
in classAbstractAnimationChannel
- Parameters:
name
- the new name for our subchannel.startSample
- the sample to start with (inclusive). Sample counting starts at 0.endSample
- the sample to end with (inclusive). max is getSampleCount() - 1.- Returns:
- the new channel.
-
getSubchannelByTime
Description copied from class:AbstractAnimationChannel
Returns a new channel of the same content as this, but trimmed to just the times between start and end sample.- Specified by:
getSubchannelByTime
in classAbstractAnimationChannel
- Parameters:
name
- the new name for our subchannel.startTime
- the time to start with (inclusive)endTime
- the time to end with (inclusive)- Returns:
- the new channel.
-
getTranslations
-
getScales
-
getRotations
-
newChannel
protected TransformChannel newChannel(String name, float[] times, ReadOnlyQuaternion[] rotations, ReadOnlyVector3[] translations, ReadOnlyVector3[] scales) -
createStateDataObject
- Specified by:
createStateDataObject
in classAbstractAnimationChannel
- Parameters:
instance
- the instance creating and storing the state data object.- Returns:
- an Object suitable for storing information for this type of animation channel.
-
getClassTag
-
write
- Specified by:
write
in interfaceSavable
- Overrides:
write
in classAbstractAnimationChannel
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classAbstractAnimationChannel
- Throws:
IOException
-
initSavable
-