Game Development Reference
In-Depth Information
+ */
+public AnimationEvent(Spatial model, String animationName,
LoopMode loopMode, int channelIndex, float blendTime) {
+this.model = model;
+this.animationName = animationName;
+this.loopMode = loopMode;
+initialDuration =
model.getControl(AnimControl.class).getAnimationLength(animationName);
+this.channelIndex = channelIndex;
+this.blendTime = blendTime;
+}
/**
* creates an animation event
@@ -264,11 +282,16 @@
Object s = cinematic.getEventData(MODEL_CHANNELS, model);
if (s == null) {
s = new HashMap<integer , AnimChannel>();
+int numChannels =
model.getControl(AnimControl.class).getNumChannels();
+for(int i = 0; i < numChannels; i++){
+ ((HashMap<Integer, AnimChannel>)s).put(i,
model.getControl(AnimControl.class).getChannel(i));
+}
cinematic.putEventData(MODEL_CHANNELS, model, s);
}
Map</integer><integer , AnimChannel> map =
(Map</integer><integer , AnimChannel>) s;
this.channel = map.get(channelIndex);
+
if (this.channel == null) {
if (model == null) {
//the model is null we try to find it
according to the name
Search WWH ::




Custom Search