@Override public Transform clone() { try { Transform tq = (Transform) super.clone(); tq.rot = rot.clone(); tq.scale = scale.clone(); tq.translation = translation.clone(); return tq; } catch (CloneNotSupportedException e) { throw new AssertionError(); } } }
public Listener(Listener source){ location = source.location.clone(); velocity = source.velocity.clone(); rotation = source.rotation.clone(); volume = source.volume; }
/** * Special-purpose copy constructor. * <p> * Only copies the name, user control state and bind pose transforms from the original. * <p> * The rest of the data is <em>NOT</em> copied, as it will be * generated automatically when the bone is animated. * * @param source The bone from which to copy the data. */ Bone(Bone source) { this.name = source.name; userControl = source.userControl; bindPos = source.bindPos.clone(); bindRot = source.bindRot.clone(); bindScale = source.bindScale.clone(); modelBindInversePos = source.modelBindInversePos.clone(); modelBindInverseRot = source.modelBindInverseRot.clone(); modelBindInverseScale = source.modelBindInverseScale.clone(); // parent and children will be assigned manually.. }
/** * Sets the transform for the given frame. * * @param frameIndex * the frame for which the transform will be set * @param transform * the transformation to be set */ public void setTransform(int frameIndex, Transform transform) { if (translations == null) { translations = this.createList(Vector3f.ZERO, frameIndex); } this.append(translations, Vector3f.ZERO, frameIndex - translations.size()); translations.add(transform.getTranslation().clone()); if (rotations == null) { rotations = this.createList(Quaternion.IDENTITY, frameIndex); } this.append(rotations, Quaternion.IDENTITY, frameIndex - rotations.size()); rotations.add(transform.getRotation().clone()); if (scales == null) { scales = this.createList(Vector3f.UNIT_XYZ, frameIndex); } this.append(scales, Vector3f.UNIT_XYZ, frameIndex - scales.size()); scales.add(transform.getScale().clone()); }
@Override public Camera clone() { try { Camera cam = (Camera) super.clone(); cam.viewportChanged = true; cam.planeState = 0; cam.worldPlane = new Plane[MAX_WORLD_PLANES]; for (int i = 0; i < worldPlane.length; i++) { cam.worldPlane[i] = worldPlane[i].clone(); } cam.coeffLeft = new float[2]; cam.coeffRight = new float[2]; cam.coeffBottom = new float[2]; cam.coeffTop = new float[2]; cam.location = location.clone(); cam.rotation = rotation.clone(); if (projectionMatrixOverride != null) { cam.projectionMatrixOverride = projectionMatrixOverride.clone(); } cam.viewMatrix = viewMatrix.clone(); cam.projectionMatrix = projectionMatrix.clone(); cam.viewProjectionMatrix = viewProjectionMatrix.clone(); cam.guiBounding = (BoundingBox) guiBounding.clone(); cam.update(); return cam; } catch (CloneNotSupportedException ex) { throw new AssertionError(); } }
Quaternion initRotation = model.getLocalRotation().clone(); initScale = model.getLocalScale().clone();
Quaternion initRotation = model.getLocalRotation().clone(); initScale = model.getLocalScale().clone();
break; case Rotation: rotations[j] = ((Quaternion) ((Rotation) keyFrames[i]).rotation).clone(); break; case Scale:
targetAngles = targetTransform.getRotation().toAngles(targetAngles); Quaternion startRotation = ownerRotation.clone(); Quaternion offset = Quaternion.IDENTITY; if ((flag & ROTLIKE_OFFSET) != 0) {// we add the original rotation to
link.initalWorldRotation = bone.getModelSpaceRotation().clone();
link.initalWorldRotation = bone.getModelSpaceRotation().clone();
public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); location = (Vector3f) capsule.readSavable("location", Vector3f.ZERO.clone()); rotation = (Quaternion) capsule.readSavable("rotation", Quaternion.DIRECTION_Z.clone()); frustumNear = capsule.readFloat("frustumNear", 1); frustumFar = capsule.readFloat("frustumFar", 2); frustumLeft = capsule.readFloat("frustumLeft", -0.5f); frustumRight = capsule.readFloat("frustumRight", 0.5f); frustumTop = capsule.readFloat("frustumTop", 0.5f); frustumBottom = capsule.readFloat("frustumBottom", -0.5f); coeffLeft = capsule.readFloatArray("coeffLeft", new float[2]); coeffRight = capsule.readFloatArray("coeffRight", new float[2]); coeffBottom = capsule.readFloatArray("coeffBottom", new float[2]); coeffTop = capsule.readFloatArray("coeffTop", new float[2]); viewPortLeft = capsule.readFloat("viewPortLeft", 0); viewPortRight = capsule.readFloat("viewPortRight", 1); viewPortTop = capsule.readFloat("viewPortTop", 1); viewPortBottom = capsule.readFloat("viewPortBottom", 0); width = capsule.readInt("width", 1); height = capsule.readInt("height", 1); name = capsule.readString("name", null); onFrustumChange(); onViewPortChange(); onFrameChange(); } }
@Override public Transform clone() { try { Transform tq = (Transform) super.clone(); tq.rot = rot.clone(); tq.scale = scale.clone(); tq.translation = translation.clone(); return tq; } catch (CloneNotSupportedException e) { throw new AssertionError(); } } }
@Override public Transform clone() { try { Transform tq = (Transform) super.clone(); tq.rot = rot.clone(); tq.scale = scale.clone(); tq.translation = translation.clone(); return tq; } catch (CloneNotSupportedException e) { throw new AssertionError(); } } }
public Listener(Listener source){ location = source.location.clone(); velocity = source.velocity.clone(); rotation = source.rotation.clone(); volume = source.volume; }
public Listener(Listener source){ location = source.location.clone(); velocity = source.velocity.clone(); rotation = source.rotation.clone(); volume = source.volume; }
public PossessionCameraControl(Camera camera, Direction direction) { this.camera = camera; this.direction = direction; if (direction == Direction.ENTRANCE) { qFrom = camera.getRotation().clone(); pFrom = camera.getLocation().clone(); } else { qTo = camera.getRotation().clone(); pTo = camera.getLocation().clone(); } }
@Override public void setSpatial(Spatial spatial) { super.setSpatial(spatial); if (spatial != null) { if (direction == Direction.ENTRANCE) { qTo = spatial.getLocalRotation().clone(); pTo = spatial.getLocalTranslation().clone(); } else { qFrom = spatial.getLocalRotation().clone(); pFrom = spatial.getLocalTranslation().clone(); } } }