/** * creates an animation event * * @param model the model on which the animation will be played * @param animationName the name of the animation to play * @param initialDuration the initial duration of the event */ public AnimationEvent(Spatial model, String animationName, float initialDuration) { super(initialDuration); this.model = model; this.modelName = model.getName(); this.animationName = animationName; }
/** * creates an animation event * * @param model the model on which the animation will be played * @param animationName the name of the animation to play * @param initialDuration the initial duration of the event * @param channelIndex the index of the channel default is 0. Events on the * same channelIndex will use the same channel. */ public AnimationEvent(Spatial model, String animationName, float initialDuration, int channelIndex) { super(initialDuration); this.model = model; this.modelName = model.getName(); this.animationName = animationName; this.channelIndex = channelIndex; }
/** * creates an animation event * * @param model the model on which the animation will be played * @param animationName the name of the animation to play * @param initialDuration the initial duration of the event * @param blendTime the time during the animation are gonna be blended * @see AnimChannel#setAnim(java.lang.String, float) */ public AnimationEvent(Spatial model, String animationName, float initialDuration, float blendTime) { super(initialDuration); this.model = model; this.modelName = model.getName(); this.animationName = animationName; this.blendTime = blendTime; }
/** * creates an animation event * * @param model the model on which the animation will be played * @param animationName the name of the animation to play * @param initialDuration the initial duration of the event * @param loopMode the loopMode * @see LoopMode */ public AnimationEvent(Spatial model, String animationName, float initialDuration, LoopMode loopMode) { super(initialDuration, loopMode); this.model = model; this.modelName = model.getName(); this.animationName = animationName; }
/** * creates an animation event * * @param model the model on which the animation will be played * @param animationName the name of the animation to play * @param initialDuration the initial duration of the event * @param loopMode the loopMode * @see LoopMode * @param blendTime the time during the animation are gonna be blended * @see AnimChannel#setAnim(java.lang.String, float) */ public AnimationEvent(Spatial model, String animationName, float initialDuration, LoopMode loopMode, float blendTime) { super(initialDuration, loopMode); this.model = model; this.modelName = model.getName(); this.animationName = animationName; this.blendTime = blendTime; }
/** * creates an animation event * * @param model the model on which the animation will be played * @param animationName the name of the animation to play * @param initialDuration the initial duration of the event * @param loopMode the loopMode * @see LoopMode * @param channelIndex the index of the channel default is 0. Events on the * same channelIndex will use the same channel. */ public AnimationEvent(Spatial model, String animationName, float initialDuration, LoopMode loopMode, int channelIndex) { super(initialDuration, loopMode); this.model = model; this.modelName = model.getName(); this.animationName = animationName; this.channelIndex = channelIndex; }
/** * creates an animation event * * @param model the model on which the animation will be played * @param animationName the name of the animation to play */ public AnimationEvent(Spatial model, String animationName) { this.model = model; this.modelName = model.getName(); this.animationName = animationName; initialDuration = model.getControl(AnimControl.class).getAnimationLength(animationName); }
/** * creates an animation event * * @param model the model on which the animation will be played * @param animationName the name of the animation to play * @param loopMode the loopMode * @see LoopMode */ public AnimationEvent(Spatial model, String animationName, LoopMode loopMode) { super(loopMode); initialDuration = model.getControl(AnimControl.class).getAnimationLength(animationName); this.model = model; this.modelName = model.getName(); this.animationName = animationName; }
/** * creates an animation event * * @param model the model on which the animation will be played * @param animationName the name of the animation to play * @param channelIndex the index of the channel default is 0. Events on the * same channelIndex will use the same channel. */ public AnimationEvent(Spatial model, String animationName, int channelIndex) { this.model = model; this.modelName = model.getName(); this.animationName = animationName; initialDuration = model.getControl(AnimControl.class).getAnimationLength(animationName); this.channelIndex = channelIndex; }
/** * creates an animation event * * @param model the model on which the animation will be played * @param animationName the name of the animation to play * @param loopMode the loopMode * @see LoopMode * @param blendTime the time during the animation are gonna be blended * @see AnimChannel#setAnim(java.lang.String, float) */ public AnimationEvent(Spatial model, String animationName, LoopMode loopMode, float blendTime) { super(loopMode); initialDuration = model.getControl(AnimControl.class).getAnimationLength(animationName); this.model = model; this.modelName = model.getName(); this.animationName = animationName; this.blendTime = blendTime; }
/** * creates an animation event * * @param model the model on which the animation will be played * @param animationName the name of the animation to play * @param loopMode the loopMode * @see LoopMode * @param channelIndex the index of the channel default is 0. Events on the * same channelIndex will use the same channel. */ public AnimationEvent(Spatial model, String animationName, LoopMode loopMode, int channelIndex) { super(loopMode); initialDuration = model.getControl(AnimControl.class).getAnimationLength(animationName); this.model = model; this.modelName = model.getName(); this.animationName = animationName; this.channelIndex = channelIndex; }
/** * creates an animation event * * @param model the model on which the animation will be played * @param animationName the name of the animation to play * @param channelIndex the index of the channel default is 0. Events on the * @param blendTime the time during the animation are gonna be blended * same channelIndex will use the same channel. */ public AnimationEvent(Spatial model, String animationName, LoopMode loopMode, int channelIndex, float blendTime) { this.model = model; this.modelName = model.getName(); this.animationName = animationName; this.loopMode = loopMode; initialDuration = model.getControl(AnimControl.class).getAnimationLength(animationName); this.channelIndex = channelIndex; this.blendTime = blendTime; }
/** * <code>detachChild</code> removes a given child from the node's list. * This child will no longe be maintained. Only the first child with a * matching name is removed. * * @param childName * the child to remove. * @return the index the child was at. -1 if the child was not in the list. */ public int detachChildNamed(String childName) { if (childName == null) throw new NullPointerException(); for (int x = 0, max = children.size(); x < max; x++) { Spatial child = children.get(x); if (childName.equals(child.getName())) { detachChildAt( x ); return x; } } return -1; }
private Geometry findGeom(Spatial spatial, String name) { if (spatial instanceof Node) { Node node = (Node) spatial; for (int i = 0; i < node.getQuantity(); i++) { Spatial child = node.getChild(i); Geometry result = findGeom(child, name); if (result != null) { return result; } } } else if (spatial instanceof Geometry) { if (spatial.getName().startsWith(name)) { return (Geometry) spatial; } } return null; }
public void onWayPointReach(MotionEvent control, int wayPointIndex) { if (path.getNbWayPoints() == wayPointIndex + 1) { wayPointsText.setText(control.getSpatial().getName() + " Finish!!! "); } else { wayPointsText.setText(control.getSpatial().getName() + " Reached way point " + wayPointIndex); } wayPointsText.setLocalTranslation((cam.getWidth() - wayPointsText.getLineWidth()) / 2, cam.getHeight(), 0); } });
public void onWayPointReach(MotionEvent control, int wayPointIndex) { if (path.getNbWayPoints() == wayPointIndex + 1) { wayPointsText.setText(control.getSpatial().getName() + "Finished!!! "); } else { wayPointsText.setText(control.getSpatial().getName() + " Reached way point " + wayPointIndex); } wayPointsText.setLocalTranslation((cam.getWidth() - wayPointsText.getLineWidth()) / 2, cam.getHeight(), 0); } });
private void dumpScene(Spatial s, int indent) { System.err.println(indentString.substring(0, indent) + s.getName() + " (" + s.getClass().getSimpleName() + ") / " + s.getLocalTransform().getTranslation().toString() + ", " + s.getLocalTransform().getRotation().toString() + ", " + s.getLocalTransform().getScale().toString()); if (s instanceof Node) { Node n = (Node) s; for (Spatial spatial : n.getChildren()) { dumpScene(spatial, indent + 1); } } } }
@Override public Node clone(boolean cloneMaterials) { BatchNode clone = (BatchNode) super.clone(cloneMaterials); if (batches.size() > 0) { for (Batch b : batches) { for (int i = 0; i < clone.children.size(); i++) { if (clone.children.get(i).getName().equals(b.geometry.getName())) { clone.children.remove(i); break; } } } clone.needsFullRebatch = true; clone.batches = new SafeArrayList<Batch>(Batch.class); clone.batchesByGeom = new HashMap<Geometry, Batch>(); clone.batch(); } return clone; }
private void dumpScene(Spatial s, int indent) { System.err.println(indentString.substring(0, indent) + s.getName() + " (" + s.getClass().getSimpleName() + ") / " + s.getLocalTransform().getTranslation().toString() + ", " + s.getLocalTransform().getRotation().toString() + ", " + s.getLocalTransform().getScale().toString()); if (s instanceof Node) { Node n = (Node) s; for (Spatial spatial : n.getChildren()) { dumpScene(spatial, indent + 1); } } } }