/** * Constructs and initializes a transform to the identity matrix. */ public Transform3D() { setIdentity(); // this will also classify the matrix }
/** * Constructs a trivial transform interpolator with a specified alpha, * a specified target and an default axis set to Identity. * @param alpha The alpha object for this transform Interpolator * @param target The target TransformGroup for this TransformInterpolator */ public TransformInterpolator(Alpha alpha, TransformGroup target) { super(alpha); this.target = target; axis.setIdentity(); axisInverse.setIdentity(); } /**
/** * Compute derived data using the snapshot of the per-view data. */ synchronized void computeDerivedData() { if (doHeadTracking) { trackerBaseToHeadTracker.invert(headTrackerToTrackerBase); //System.err.println("trackerBaseToHeadTracker: "); //System.err.println(trackerBaseToHeadTracker); } else { trackerBaseToHeadTracker.setIdentity(); } // XXXX: implement head to vworld tracking if userHeadToVworldEnable is set userHeadToVworld.setIdentity(); }
/** * Gets the nominal sensor transform. * * @param t3d <code>Transform3D</code> to receive a copy of the * nominal sensor transform */ public void getNominalSensorRotation(Transform3D t3d) { if (nominalSensorRotation != null) { t3d.set(nominalSensorRotation); } else { t3d.setIdentity(); } }
void getLastVworldToImagePlate(Transform3D t) { if (canvasViewCache != null) { synchronized(canvasViewCache) { t.set(canvasViewCache.getLastVworldToImagePlate()); } } else { t.setIdentity(); } }
/** * Retrieves the current ImagePlate coordinates to Virtual World * coordinates transform and places it into the specified object. * @param t the Transform3D object that will receive the * transform */ // TODO: Document -- This will return the transform of left plate. public void getImagePlateToVworld(Transform3D t) { if (canvasViewCache != null) { synchronized(canvasViewCache) { t.set(canvasViewCache.getImagePlateToVworld()); } } else { t.setIdentity(); } }
/** * Retrieves the current Virtual World coordinates to ImagePlate * coordinates transform and places it into the specified object. * @param t the Transform3D object that will receive the * transform */ // TODO: Document -- This will return the transform of left plate. public void getVworldToImagePlate(Transform3D t) { if (canvasViewCache != null) { synchronized(canvasViewCache) { t.set(canvasViewCache.getVworldToImagePlate()); } } else { t.setIdentity(); } }
/** * Constructs a new RenderBin */ RenderBin(VirtualUniverse u, View v) { super(u, J3dThread.UPDATE_RENDER); vworldToVpc.setIdentity(); universe = u; view = v; transpSortMode = v.transparencySortingPolicy; cachedTranspSortMode = v.transparencySortingPolicy; maxLights = VirtualUniverse.mc.maxLights; ViewPlatform vp = view.getViewPlatform(); if (vp != null) { locale = ((ViewPlatformRetained) (vp.retained)).locale; } dlistRenderMethod = (DisplayListRenderMethod) VirtualUniverse.mc.getDisplayListRenderMethod(); }
private void computeHeadToVworld() { // Concatenate headToLeftImagePlate with leftPlateToVworld if (viewCache.compatibilityModeEnable) { // XXXX: implement this correctly for compat mode headToVworld.setIdentity(); } else { headToVworld.mul(leftPlateToVworld, headToLeftImagePlate); if((J3dDebug.devPhase) && (J3dDebug.canvasViewCache >= J3dDebug.LEVEL_2)) { System.err.println("leftPlateToVworld:"); System.err.println(leftPlateToVworld); System.err.println("headToLeftImagePlate:"); System.err.println(headToLeftImagePlate); System.err.println("...gives -> headToVworld:"); System.err.println(headToVworld); } } // Denote that eyes-in-ImagePlate fields have changed so that // these new values can be sent to the AudioDevice if (this.viewCache.view.soundScheduler != null) this.viewCache.view.soundScheduler.setListenerFlag( SoundScheduler.HEAD_TO_VWORLD_CHANGED); }
/** * Get the localToVworld transform for a node. */ void getLocalToVworld(Transform3D t) { if (inSharedGroup) { throw new IllegalSharingException(J3dI18N.getString("NodeRetained0")); } // Lock the object while writing into t. if (localToVworld == null) { t.setIdentity(); } else { computeLocalToVworld(this, this, null, t); } }
duration = DURATION_UNKNOWN; numberOfChannels = 0; vworldXfrm.setIdentity(); vwXfrmFlag = false; position.set(0.0f, 0.0f, 0.0f);
leftInverseProjection.setIdentity(); rightInverseProjection.setIdentity();
/** * After animation was stopped, the transformation of the animation * TransformGroup is incorporated in the rotation TransformGroup and the * animation TransformGroup is set to identity. This is necessary, because * otherwise a following rotation by the mouse would not take place around the * expected axis. */ private void incorporateAnimationInRotation() { rotationTG.getTransform(rotationXform); animationTG.getTransform(animationXform); rotationXform.mul(rotationXform, animationXform); animationXform.setIdentity(); animationTG.setTransform(animationXform); rotationTG.setTransform(rotationXform); }
int processBgs(ArrayList<BackgroundRetained> globalBgs, BoundingSphere bounds, int nbacks, Locale viewLocale) { int size = globalBgs.size(); for (int i = 0; i < size; i++) { BackgroundRetained back = globalBgs.get(i); if (back.transformedRegion == null || !back.switchState.currentSwitchOn) continue; if (back.cachedLocale != viewLocale) { Bounds localeBounds = (Bounds)back.transformedRegion.clone(); // Translate the transformed region back.cachedLocale.hiRes.difference(viewLocale.hiRes, localeTranslation); localeXform.setIdentity(); localeXform.setTranslation(localeTranslation); localeBounds.transform(localeXform); if (localeBounds.intersect(bounds) == true) { intersectedBounds[nbacks] = localeBounds; intersectedBacks[nbacks++] = back; } } else { if (back.transformedRegion.intersect(bounds) == true) { intersectedBounds[nbacks] = back.transformedRegion; intersectedBacks[nbacks++] = back; } } } return nbacks; }
/** * Compute the LocalToVworld of this node even though it is not live. We * assume the graph is attached at the origin of a locale */ void computeNonLiveLocalToVworld(Transform3D t, Node caller) { NodeRetained n = getParent(); if (n==null) t.setIdentity(); else n.computeNonLiveLocalToVworld(t, caller); if (this instanceof TransformGroupRetained && this.source!=caller) { Transform3D trans = new Transform3D(); ((TransformGroupRetained)this).getTransform(trans); t.mul(trans); } }
positions[currentKnotIndex].z) * currentInterpolationValue; position.setIdentity(); position.setTranslation(pos);
/** * Center the view at the given point. * * @param center */ public void centerAt(final Point3d center) { // set the center transformation to the translation given by // the specified point centerV.set(center.x, center.y, center.z); centerXform.set(centerV); centerTG.setTransform(centerXform); // set the global translation to identity centerXform.setIdentity(); translateTG.setTransform(centerXform); transformChanged(BehaviorCallback.TRANSLATE, centerXform); // update rotation center rotCenter.set(center); }
private void computeCoexistenceToPlate() { if (viewCache.compatibilityModeEnable) { coexistenceToLeftPlate.setIdentity(); return;
/** * Reset the transformations of the view side of the scene graph as if the * Contents of this universe were just displayed. */ public void resetView() { fireTransformationStarted(); // rotate so that y shows downwards final Transform3D t = new Transform3D(); final AxisAngle4d aa = new AxisAngle4d(1, 0, 0, Math.PI); t.set(aa); getRotationTG().setTransform(t); t.setIdentity(); getTranslateTG().setTransform(t); getZoomTG().setTransform(t); recalculateGlobalMinMax(); getViewPlatformTransformer().centerAt(globalCenter); // reset zoom final double d = oldRange / Math.tan(Math.PI / 8); getViewPlatformTransformer().zoomTo(d); fireTransformationUpdated(); fireTransformationFinished(); }