SpatialTrack[] tracks = action.toTracks(node, blenderContext); if (tracks != null && tracks.length > 0) { Animation spatialAnimation = new Animation(action.getName(), action.getAnimationTime()); spatialAnimation.setTracks(tracks); animations.add(spatialAnimation);
BoneTrack[] tracks = action.toTracks(skeleton, blenderContext); if (tracks != null && tracks.length > 0) { Animation boneAnimation = new Animation(action.getName(), action.getAnimationTime()); boneAnimation.setTracks(tracks); animations.add(boneAnimation);
/** * Creates an Animation based on the keyFrames previously added to the helper. * @return the generated animation */ public Animation buildAnimation() { interpolateTime(); interpolate(keyFramesTranslation, Type.Translation); interpolate(keyFramesRotation, Type.Rotation); interpolate(keyFramesScale, Type.Scale); SpatialTrack spatialTrack = new SpatialTrack(times, translations, rotations, scales); //creating the animation Animation spatialAnimation = new Animation(name, duration); spatialAnimation.setTracks(new SpatialTrack[]{spatialTrack}); return spatialAnimation; }
float animStart = animInfo.firstFrame / this.animFrameRate; float animStop = animInfo.lastFrame / this.animFrameRate; Animation anim = new Animation(animInfo.name, length); if(tracks == null || tracks.length == 0) continue; anim = new Animation(animInfo.name, realLength); for(Track track : tracks) anim.addTrack(track);
/** * No ClassCastException when clear() a Cinematic with AnimationEvent */ @Test public void clearAnimationEvent() { Cinematic sut = new Cinematic(); Node model = new Node("model"); AnimControl ac = new AnimControl(); ac.addAnim(new Animation("animName", 1.0f)); model.addControl(ac); sut.enqueueCinematicEvent(new AnimationEvent(model, "animName")); sut.initialize(null, null); sut.clear(); } }
Animation spatialAnimation = new Animation("anim", animTime); spatialAnimation.setTracks(new SpatialTrack[] { spatialTrack });
String name = SAXUtil.parseString(attribs.getValue("name")); float length = SAXUtil.parseFloat(attribs.getValue("length")); animation = new Animation(name, length); } else if (qName.equals("bonehierarchy")) { assert elementStack.peek().equals("skeleton");
String name = SAXUtil.parseString(attribs.getValue("name")); float length = SAXUtil.parseFloat(attribs.getValue("length")); animation = new Animation(name, length); } else if (qName.equals("bonehierarchy")) { assert elementStack.peek().equals("skeleton");
String name = SAXUtil.parseString(attribs.getValue("name")); float length = SAXUtil.parseFloat(attribs.getValue("length")); animation = new Animation(name, length); } else if (qName.equals("bonehierarchy")) { assert elementStack.peek().equals("skeleton");
float animStart = animInfo.firstFrame / this.animFrameRate; float animStop = animInfo.lastFrame / this.animFrameRate; Animation anim = new Animation(animInfo.name, length);
/** * Creates an Animation based on the keyFrames previously added to the helper. * @return the generated animation */ public Animation buildAnimation() { interpolateTime(); interpolate(keyFramesTranslation, Type.Translation); interpolate(keyFramesRotation, Type.Rotation); interpolate(keyFramesScale, Type.Scale); SpatialTrack spatialTrack = new SpatialTrack(times, translations, rotations, scales); //creating the animation Animation spatialAnimation = new Animation(name, duration); spatialAnimation.setTracks(new SpatialTrack[]{spatialTrack}); return spatialAnimation; }
com.jme3.animation.Animation animation = new com.jme3.animation.Animation("anim", (anim.getFrames() - 1) / 30f); animation.setTracks(poseTracks.toArray(new PoseTrack[poseTracks.size()])); AnimControl control = new AnimControl();
/** * Creates an Animation based on the keyFrames previously added to the helper. * @return the generated animation */ public Animation buildAnimation() { interpolateTime(); interpolate(keyFramesTranslation, Type.Translation); interpolate(keyFramesRotation, Type.Rotation); interpolate(keyFramesScale, Type.Scale); SpatialTrack spatialTrack = new SpatialTrack(times, translations, rotations, scales); //creating the animation Animation spatialAnimation = new Animation(name, duration); spatialAnimation.setTracks(new SpatialTrack[]{spatialTrack}); return spatialAnimation; }
float animStart = animInfo.firstFrame / this.animFrameRate; float animStop = animInfo.lastFrame / this.animFrameRate; Animation anim = new Animation(animInfo.name, length); if(tracks == null || tracks.length == 0) continue; anim = new Animation(animInfo.name, realLength); for(Track track : tracks) anim.addTrack(track);
Animation anim = new Animation(); anim.setName(name); int skinIndex = -1;
BoneTrack boneTrack = new BoneTrack(0, times, translations, rotations); Animation boneAnim = new Animation("test animation", 3); boneAnim.setTracks(new BoneTrack[] {boneTrack});
private Animation createAnimation(DAENode animationNode, Bone bone, Skeleton skeleton) { DAENode channel = animationNode.getChild(Names.CHANNEL); DAENode sampler = animationNode.getChild(Names.SAMPLER); DAENode times = sampler.getChild(Names.INPUT, Names.SEMANTIC, Semantic.INPUT.name()).getLinkedSource(); DAENode values = sampler.getChild(Names.INPUT, Names.SEMANTIC, Semantic.OUTPUT.name()).getLinkedSource(); float[] timeValues = times.getChild(Names.FLOAT_ARRAY).getContent(FLOAT_LIST).get(); float[] outputValues = values.getChild(Names.FLOAT_ARRAY).getContent(FLOAT_LIST).get(); ChannelTarget channelTarget = ChannelTarget.forName(channel.getAttribute(Names.TARGET, TEXT).get()); Conditions.checkTrue(sampler.isDefined()); Conditions.checkTrue(times.isDefined()); Conditions.checkTrue(values.isDefined()); Conditions.checkTrue(channel.isDefined()); Conditions.checkNotNull(channelTarget); Conditions.checkNotNull(timeValues); Conditions.checkNotNull(outputValues); Transform[] transformList = channelTarget.transform(outputValues).get(); Conditions.checkNotNull(transformList); Conditions.checkValue(transformList.length, timeValues.length); int boneIndex = skeleton.getBoneIndex(bone); float animationLength = max(timeValues); Quaternion[] rotations = getRotations(transformList); Vector3f[] translations = getTranslations(transformList); BoneTrack track = new BoneTrack(boneIndex, timeValues, translations, rotations); Animation anim = new Animation(animationNode.getAttribute(Names.ID, TEXT).get(), animationLength); anim.setTracks(new BoneTrack[] {track}); return anim; }