private double[] getCameraFixXYZValues(SimulationConstructionSet scs) { ClassicCameraController classicCameraController = getClassicCameraController(scs); double x = classicCameraController.getFixX(); double y = classicCameraController.getFixY(); double z = classicCameraController.getFixZ(); return new double[] {x, y, z}; }
public void storePosition() { storedCameraPositions.add(new Point3D(getCamX(), getCamY(), getCamZ())); storedFixPositions.add(new Point3D(getFixX(), getFixY(), getFixZ())); }
public void storePosition() { storedCameraPositions.add(new Point3d(getCamX(), getCamY(), getCamZ())); storedFixPositions.add(new Point3d(getFixX(), getFixY(), getFixZ())); }
@Override public void computeTransform(RigidBodyTransform currXform) { update(); CameraMountInterface cameraMount = getCameraMount(); if (isMounted() && (cameraMount != null)) { cameraMount.getTransformToCamera(currXform); return; } positionOffset.set(getCamX(), getCamY(), getCamZ()); xAxis.set(getFixX(), getFixY(), getFixZ()); fixPointNode.translateTo(getFixX(), getFixY(), getFixZ()); xAxis.sub(positionOffset); xAxis.normalize(); zAxis.set(0.0, 0.0, 1.0); yAxis.cross(zAxis, xAxis); zAxis.cross(xAxis, yAxis); rotationMatrix.setColumn(0, xAxis); rotationMatrix.setColumn(1, yAxis); rotationMatrix.setColumn(2, zAxis); currXform.setRotationAndZeroTranslation(rotationMatrix); currXform.setTranslation(positionOffset); currXform.normalizeRotationPart(); }
@Override public void computeTransform(RigidBodyTransform currXform) { update(); CameraMountInterface cameraMount = getCameraMount(); if (isMounted() && (cameraMount != null)) { cameraMount.getTransformToCamera(currXform); return; } positionOffset.set(getCamX(), getCamY(), getCamZ()); xAxis.set(getFixX(), getFixY(), getFixZ()); fixPointNode.translateTo(getFixX(), getFixY(), getFixZ()); xAxis.sub(positionOffset); xAxis.normalize(); zAxis.set(0.0, 0.0, 1.0); yAxis.cross(zAxis, xAxis); yAxis.normalize(); zAxis.cross(xAxis, yAxis); rotationMatrix.setColumns(xAxis, yAxis, zAxis); currXform.setRotationAndZeroTranslation(rotationMatrix); currXform.setTranslation(positionOffset); currXform.normalizeRotationPart(); }