@Override protected void controlRender(RenderManager rm, ViewPort vp) { if (!wasMeshUpdated) { updateTargetsAndMaterials(spatial);
/** * Access the attachments node of the named bone. If the bone doesn't * already have an attachments node, create one and attach it to the scene * graph. Models and effects attached to the attachments node will follow * the bone's motions. * * @param boneName the name of the bone * @return the attachments node of the bone */ public Node getAttachmentsNode(String boneName) { Bone b = skeleton.getBone(boneName); if (b == null) { throw new IllegalArgumentException("Given bone name does not exist " + "in the skeleton."); } updateTargetsAndMaterials(spatial); int boneIndex = skeleton.getBoneIndex(b); Node n = b.getAttachmentsNode(boneIndex, targets); /* * Select a node to parent the attachments node. */ Node parent; if (spatial instanceof Node) { parent = (Node) spatial; // the usual case } else { parent = spatial.getParent(); } parent.attachChild(n); return n; }
@Override public void setSpatial(Spatial spatial) { Spatial oldSpatial = this.spatial; super.setSpatial(spatial); updateTargetsAndMaterials(spatial); if (oldSpatial != null) { oldSpatial.removeMatParamOverride(numberOfBonesParam); oldSpatial.removeMatParamOverride(boneMatricesParam); } if (spatial != null) { spatial.removeMatParamOverride(numberOfBonesParam); spatial.removeMatParamOverride(boneMatricesParam); spatial.addMatParamOverride(numberOfBonesParam); spatial.addMatParamOverride(boneMatricesParam); } }
@Override public void setSpatial(Spatial spatial) { super.setSpatial(spatial); updateTargetsAndMaterials(spatial); }
@Override protected void controlRender(RenderManager rm, ViewPort vp) { if (!wasMeshUpdated) { updateTargetsAndMaterials(spatial);
@Override protected void controlRender(RenderManager rm, ViewPort vp) { if (!wasMeshUpdated) { updateTargetsAndMaterials(spatial);
/** * Access the attachments node of the named bone. If the bone doesn't * already have an attachments node, create one and attach it to the scene * graph. Models and effects attached to the attachments node will follow * the bone's motions. * * @param boneName the name of the bone * @return the attachments node of the bone */ public Node getAttachmentsNode(String boneName) { Bone b = skeleton.getBone(boneName); if (b == null) { throw new IllegalArgumentException("Given bone name does not exist " + "in the skeleton."); } updateTargetsAndMaterials(spatial); int boneIndex = skeleton.getBoneIndex(b); Node n = b.getAttachmentsNode(boneIndex, targets); /* * Select a node to parent the attachments node. */ Node parent; if (spatial instanceof Node) { parent = (Node) spatial; // the usual case } else { parent = spatial.getParent(); } parent.attachChild(n); return n; }
@Override public void setSpatial(Spatial spatial) { Spatial oldSpatial = this.spatial; super.setSpatial(spatial); updateTargetsAndMaterials(spatial); if (oldSpatial != null) { oldSpatial.removeMatParamOverride(numberOfBonesParam); oldSpatial.removeMatParamOverride(boneMatricesParam); } if (spatial != null) { spatial.removeMatParamOverride(numberOfBonesParam); spatial.removeMatParamOverride(boneMatricesParam); spatial.addMatParamOverride(numberOfBonesParam); spatial.addMatParamOverride(boneMatricesParam); } }