Class GuaranteedTriggerChannel
java.lang.Object
com.ardor3d.extension.animation.skeletal.clip.AbstractAnimationChannel
com.ardor3d.extension.animation.skeletal.clip.TriggerChannel
com.ardor3d.extension.animation.skeletal.clip.GuaranteedTriggerChannel
- All Implemented Interfaces:
Savable
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. This channel guarantees that if we skip over a
sample in this channel, we'll still arm it after that fact. This channel should only be used with non-looping,
forward moving clips.
-
Field Summary
Fields inherited from class com.ardor3d.extension.animation.skeletal.clip.TriggerChannel
_keys
Fields inherited from class com.ardor3d.extension.animation.skeletal.clip.AbstractAnimationChannel
_channelName, _times
-
Constructor Summary
ModifierConstructorDescriptionprotected
GuaranteedTriggerChannel
(String channelName, float[] times, String[] keys) Construct a new GuaranteedTriggerChannel. -
Method Summary
Modifier and TypeMethodDescriptionClass
<? extends GuaranteedTriggerChannel> 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 GuaranteedTriggerChannel
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.Methods inherited from class com.ardor3d.extension.animation.skeletal.clip.TriggerChannel
createStateDataObject, getKeys, read, write
Methods inherited from class com.ardor3d.extension.animation.skeletal.clip.AbstractAnimationChannel
getChannelName, getMaxTime, getSampleCount, getSubchannelBySample, getSubchannelByTime, getTimes, updateSample
-
Constructor Details
-
GuaranteedTriggerChannel
Construct a new GuaranteedTriggerChannel.- 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.
-
GuaranteedTriggerChannel
protected GuaranteedTriggerChannel()
-
-
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.- Overrides:
setCurrentSample
in classTriggerChannel
- 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.- Overrides:
getSubchannelBySample
in classTriggerChannel
- 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.- Overrides:
getSubchannelByTime
in classTriggerChannel
- 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
- Specified by:
getClassTag
in interfaceSavable
- Overrides:
getClassTag
in classTriggerChannel
-
initSavable
-