@Override public void getCenter(Point3d center) { center.add(lower, upper); center.scale(0.5d); }
@Override Point3d getCenter() { Point3d cent = new Point3d(); cent.add(upper, lower); cent.scale(0.5d); return cent; }
private void cacheEyePosCoexistenceRelative(Point3d leftManualEyeInCoexistence, Point3d rightManualEyeInCoexistence) { tPnt1.set(leftManualEyeInCoexistence); viewCache.coexistenceToTrackerBase.transform(tPnt1); screenViewCache.trackerBaseToImagePlate.transform(tPnt1); tPnt1.add(coexistenceCenter); tPnt2.set(rightManualEyeInCoexistence); viewCache.coexistenceToTrackerBase.transform(tPnt2); screenViewCache.trackerBaseToImagePlate.transform(tPnt2); tPnt2.add(coexistenceCenter); cacheEyePosScreenRelative(tPnt1, tPnt2); }
/** * Make sure that the average center of all contents is visible in the canvas. */ public void addCenterOf(final Iterable<Content> contents) { final Point3d center = new Point3d(); final Point3d tmp = new Point3d(); int counter = 0; for (final Content c : contents) { final Transform3D localToVworld = new Transform3D(); c.getContent().getLocalToVworld(localToVworld); c.getContent().getMin(tmp); center.add(tmp); c.getContent().getMax(tmp); center.add(tmp); counter += 2; } center.x /= counter; center.y /= counter; center.z /= counter; add(center); }
/** * Retrieves the actual position of the center eye * in image-plate * coordinates and copies that value into the object provided. * The center eye is the fictional eye half-way between the left and * right eye. * This value is a function of the windowEyepointPolicy, the tracking * enable flag, and the manual right and left eye positions. * @param position the object that will receive the position * @see #setMonoscopicViewPolicy */ // XXXX: This might not make sense for field-sequential HMD. public void getCenterEyeInImagePlate(Point3d position) { if (canvasViewCache != null) { synchronized(canvasViewCache) { position.set(canvasViewCache.getCenterEyeInImagePlate()); } } else { Point3d cenEye = new Point3d(); cenEye.add(leftManualEyeInImagePlate, rightManualEyeInImagePlate); cenEye.scale(0.5); position.set(cenEye); } }
leftEyeInImagePlate.set(canvas.leftManualEyeInImagePlate); rightEyeInImagePlate.set(canvas.rightManualEyeInImagePlate); centerEyeInImagePlate.add(leftEyeInImagePlate, rightEyeInImagePlate); centerEyeInImagePlate.scale(0.5);
centerEyeInImagePlate.add(leftEyeInImagePlate, rightEyeInImagePlate); centerEyeInImagePlate.scale(0.5);
vec.normalize(); vec.scale(-r); pickPtInVWorld.add(centerInVWorld, vec);