@Override
 public boolean isLetterboxedAsOpposedToDistorted(
     edu.cmu.cs.dennisc.scenegraph.AbstractCamera sgCamera) {
   edu.cmu.cs.dennisc.render.gl.imp.adapters.GlrAbstractCamera<
           ? extends edu.cmu.cs.dennisc.scenegraph.AbstractCamera>
       cameraAdapter = AdapterFactory.getAdapterFor(sgCamera);
   return cameraAdapter.isLetterboxedAsOpposedToDistorted();
 }
 @Override
 public void setSpecifiedViewportAsAwtRectangle(
     edu.cmu.cs.dennisc.scenegraph.AbstractCamera camera, java.awt.Rectangle viewport) {
   edu.cmu.cs.dennisc.render.gl.imp.adapters.GlrAbstractCamera<
           ? extends edu.cmu.cs.dennisc.scenegraph.AbstractCamera>
       cameraAdapter = AdapterFactory.getAdapterFor(camera);
   cameraAdapter.setSpecifiedViewport(viewport);
 }
 @Override
 public edu.cmu.cs.dennisc.math.Matrix4x4 getActualProjectionMatrix(
     edu.cmu.cs.dennisc.math.Matrix4x4 rv, edu.cmu.cs.dennisc.scenegraph.AbstractCamera camera) {
   synchronized (s_actualViewportBufferForReuse) {
     edu.cmu.cs.dennisc.render.gl.imp.adapters.GlrAbstractCamera<
             ? extends edu.cmu.cs.dennisc.scenegraph.AbstractCamera>
         cameraAdapter = AdapterFactory.getAdapterFor(camera);
     getActualViewport(s_actualViewportBufferForReuse, cameraAdapter);
     return cameraAdapter.getActualProjectionMatrix(rv, s_actualViewportBufferForReuse);
   }
 }
 private edu.cmu.cs.dennisc.math.Ray getRayAtPixel(
     edu.cmu.cs.dennisc.math.Ray rv,
     int xPixel,
     int yPixel,
     edu.cmu.cs.dennisc.scenegraph.AbstractCamera sgCamera) {
   if (sgCamera != null) {
     synchronized (s_actualViewportBufferForReuse) {
       edu.cmu.cs.dennisc.render.gl.imp.adapters.GlrAbstractCamera<
               ? extends edu.cmu.cs.dennisc.scenegraph.AbstractCamera>
           cameraAdapter = AdapterFactory.getAdapterFor(sgCamera);
       getActualViewport(s_actualViewportBufferForReuse, cameraAdapter);
       //			double halfWidth = s_actualViewportBufferForReuse.width / 2.0;
       //			double halfHeight = s_actualViewportBufferForReuse.height / 2.0;
       //			double xInPlane = (xPixel + 0.5 - halfWidth) / halfWidth;
       //			double yInPlane = -(yPixel + 0.5 - halfHeight) / halfHeight;
       cameraAdapter.getRayAtPixel(rv, xPixel, yPixel, s_actualViewportBufferForReuse);
     }
   } else {
     rv.setNaN();
   }
   //		java.awt.Rectangle viewport = getActualViewport( camera );
   //		double halfWidth = viewport.width / 2.0;
   //		double halfHeight = viewport.height / 2.0;
   //		double x = (xPixel + 0.5 - halfWidth) / halfWidth;
   //		double y = -(yPixel + 0.5 - halfHeight) / halfHeight;
   //
   //		edu.cmu.cs.dennisc.math.Matrix4d inverseProjection = getActualProjectionMatrix( camera );
   //		inverseProjection.invert();
   //
   //		edu.cmu.cs.dennisc.math.Point3d origin = new edu.cmu.cs.dennisc.math.Point3d(
   //				inverseProjection.backward.x / inverseProjection.backward.w,
   //				inverseProjection.backward.y / inverseProjection.backward.w,
   //				inverseProjection.backward.z / inverseProjection.backward.w
   //		);
   //
   //		edu.cmu.cs.dennisc.math.Vector4d qs = new edu.cmu.cs.dennisc.math.Vector4d( x, y, 0, 1 );
   //		edu.cmu.cs.dennisc.math.Vector4d qw = edu.cmu.cs.dennisc.math.LinearAlgebra.multiply( qs,
   // inverseProjection );
   //
   //		edu.cmu.cs.dennisc.math.Vector3d direction = new edu.cmu.cs.dennisc.math.Vector3d(
   //				qw.x * inverseProjection.backward.w - qw.w * inverseProjection.backward.x,
   //				qw.y * inverseProjection.backward.w - qw.w * inverseProjection.backward.y,
   //				qw.z * inverseProjection.backward.w - qw.w * inverseProjection.backward.z
   //		);
   //		direction.normalize();
   //
   //		rv.setOrigin( origin );
   //		rv.setDirection( direction );
   //		return rv;
   return rv;
 }
 public java.awt.Rectangle getActualViewport(
     java.awt.Rectangle rv,
     edu.cmu.cs.dennisc.render.gl.imp.adapters.GlrAbstractCamera<
             ? extends edu.cmu.cs.dennisc.scenegraph.AbstractCamera>
         cameraAdapter) {
   java.awt.Dimension surfaceSize = this.getSurfaceSize();
   return cameraAdapter.getActualViewport(rv, surfaceSize.width, surfaceSize.height);
 }