public void applyState(final Spatial target) { target.setTransform(_transform); }
/** * Move our managed spatial to align with the referenced joint's position in the given pose, modified by our offset. * See class javadoc for more information. */ public void poseUpdated(final SkeletonPose pose) { // only update if we have something attached. if (_attachment != null) { final Transform t = pose.getGlobalJointTransforms()[_jointIndex]; t.multiply(_offset, _store); _attachment.setTransform(_store); } } }
/** * Move our managed spatial to align with the referenced joint's position in the given pose, modified by our offset. * See class javadoc for more information. */ public void poseUpdated(final SkeletonPose pose) { // only update if we have something attached. if (_attachment != null) { final Transform t = pose.getGlobalJointTransforms()[_jointIndex]; t.multiply(_offset, _store); _attachment.setTransform(_store); } } }
/** * Creates and returns a new instance of this spatial. Used for instanced rendering. All instances visible on the * screen will be drawn in one draw call. The new instance will share all data (meshData and renderStates) with the * current mesh and all other instances created from this spatial. * * @return an instanced copy of this node */ public Spatial makeInstanced() { final Spatial spat = duplicate(); // copy basic spatial info spat.setName(getName()); spat._sceneHints = _sceneHints; spat.setTransform(_localTransform); // copy local render states spat._renderStateList = _renderStateList; // copy controllers if (_controllers != null) { for (final SpatialController<?> sc : _controllers) { spat.addController(sc); } } return spat; }
/** * Creates and returns a new instance of this spatial. Used for instanced rendering. All instances visible on the * screen will be drawn in one draw call. The new instance will share all data (meshData and renderStates) with the * current mesh and all other instances created from this spatial. * * @return an instanced copy of this node */ public Spatial makeInstanced() { final Spatial spat = duplicate(); // copy basic spatial info spat.setName(getName()); spat._sceneHints = _sceneHints; spat.setTransform(_localTransform); // copy local render states spat._renderStateList = _renderStateList; // copy controllers if (_controllers != null) { for (final SpatialController<?> sc : _controllers) { spat.addController(sc); } } return spat; }
public void applyTo(final Spatial spat) { spat.setTransform(Transform.IDENTITY); spat.setRotation(getRotation()); spat.setScale(getScale()); spat.setTranslation(getTranslation()); }
public void applyTo(final Spatial spat) { spat.setTransform(Transform.IDENTITY); spat.setRotation(getRotation()); spat.setScale(getScale()); spat.setTranslation(getTranslation()); }
/** * Create a copy of this spatial. * * @param shareGeometricData * if true, reuse any data fields describing the geometric shape of the spatial, as applicable. * @return the copy as described. */ public Spatial makeCopy(final boolean shareGeometricData) { final Spatial spat = duplicate(); // copy basic spatial info spat.setName(getName()); spat.getSceneHints().set(_sceneHints); spat.setTransform(_localTransform); // copy local render states for (final StateType type : _renderStateList.keySet()) { final RenderState state = _renderStateList.get(type); if (state != null) { spat.setRenderState(state); } } // copy controllers if (_controllers != null) { for (final SpatialController<?> sc : _controllers) { spat.addController(sc); } } return spat; }
/** * Create a copy of this spatial. * * @param shareGeometricData * if true, reuse any data fields describing the geometric shape of the spatial, as applicable. * @return the copy as described. */ public Spatial makeCopy(final boolean shareGeometricData) { final Spatial spat = duplicate(); // copy basic spatial info spat.setName(getName()); spat.getSceneHints().set(_sceneHints); spat.setTransform(_localTransform); // copy local render states for (final StateType type : _renderStateList.keySet()) { final RenderState state = _renderStateList.get(type); if (state != null) { spat.setRenderState(state); } } // copy controllers if (_controllers != null) { for (final SpatialController<?> sc : _controllers) { spat.addController(sc); } } return spat; }