Class InterpolatedDoubleChannel
java.lang.Object
com.ardor3d.extension.animation.skeletal.clip.AbstractAnimationChannel
com.ardor3d.extension.animation.skeletal.clip.InterpolatedDoubleChannel
- All Implemented Interfaces:
Savable
An animation source channel consisting of double value samples. These samples are interpolated between key frames.
Potential uses for this channel include extracting and using forward motion from walk animations, animating colors or
texture coordinates, etc.
-
Field Summary
Fields inherited from class com.ardor3d.extension.animation.skeletal.clip.AbstractAnimationChannel
_channelName, _times
-
Constructor Summary
ModifierConstructorDescriptionprotected
InterpolatedDoubleChannel
(String channelName, float[] times, double[] values) Construct a new InterpolatedDoubleChannel. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
createStateDataObject
(AnimationClipInstance instance) Class
<? extends InterpolatedDoubleChannel> 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.double[]
static InterpolatedDoubleChannel
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
-
Field Details
-
_values
protected final double[] _valuesOur key samples.
-
-
Constructor Details
-
InterpolatedDoubleChannel
Construct a new InterpolatedDoubleChannel.- Parameters:
channelName
- the name of this channel.times
- the time samplesvalues
- our key samples. Entries may be null. Should have as many entries as the times array.
-
InterpolatedDoubleChannel
protected InterpolatedDoubleChannel()
-
-
Method Details
-
getValues
public double[] getValues() -
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.
-
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.
-
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.
-
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
-