Class TriggerChannel
java.lang.Object
com.ardor3d.extension.animation.skeletal.clip.AbstractAnimationChannel
com.ardor3d.extension.animation.skeletal.clip.TriggerChannel
- All Implemented Interfaces:
Savable
- Direct Known Subclasses:
GuaranteedTriggerChannel
An animation source channel consisting of keyword samples indicating when a specific trigger condition is met. Each
channel can only be in one keyword "state" at a given moment in time.
-
Field Summary
Fields inherited from class com.ardor3d.extension.animation.skeletal.clip.AbstractAnimationChannel
_channelName, _times
-
Constructor Summary
ModifierConstructorDescriptionprotected
TriggerChannel
(String channelName, float[] times, String[] keys) Construct a new TriggerChannel. -
Method Summary
Modifier and TypeMethodDescriptioncreateStateDataObject
(AnimationClipInstance instance) Class
<? extends TriggerChannel> String[]
getKeys()
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.static TriggerChannel
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
-
_keys
Our key samples.
-
-
Constructor Details
-
TriggerChannel
Construct a new TriggerChannel.- Parameters:
channelName
- the name of this channel.times
- the time sampleskeys
- our key samples. Entries may be null. Should have as many entries as the times array.
-
TriggerChannel
protected TriggerChannel()
-
-
Method Details
-
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.
-
getKeys
- Returns:
- our keys array
-
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.
-
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
-