diff options
Diffstat (limited to 'src/jogl/classes/jogamp')
6 files changed, 20 insertions, 18 deletions
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java index 1bc0fe0f4..cc0aece27 100644 --- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java +++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java @@ -250,7 +250,7 @@ class TypecastFont implements Font { @Override public AABBox getMetricBounds(final CharSequence string) { - return getMetricBoundsFU(string).scale2(1.0f/metrics.getUnitsPerEM(), new float[3]); + return getMetricBoundsFU(string).scale2(1.0f/metrics.getUnitsPerEM()); } @Override @@ -290,7 +290,7 @@ class TypecastFont implements Font { } @Override public AABBox getGlyphBounds(final CharSequence string, final AffineTransform tmp1, final AffineTransform tmp2) { - return getGlyphBoundsFU(string, tmp1, tmp2).scale2(1.0f/metrics.getUnitsPerEM(), new float[3]); + return getGlyphBoundsFU(string, tmp1, tmp2).scale2(1.0f/metrics.getUnitsPerEM()); } @Override diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java index 6747cca82..560d0902b 100644 --- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java +++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java @@ -148,14 +148,14 @@ public final class TypecastGlyph implements Font.Glyph { public final AABBox getBoundsFU(final AABBox dest) { return dest.copy(bbox); } @Override - public final AABBox getBounds(final AABBox dest, final float[] tmpV3) { - return dest.copy(bbox).scale2(1.0f/font.getMetrics().getUnitsPerEM(), tmpV3); + public final AABBox getBounds(final AABBox dest) { + return dest.copy(bbox).scale2(1.0f/font.getMetrics().getUnitsPerEM()); } @Override public final AABBox getBounds() { - final AABBox dest = new AABBox(); - return dest.copy(bbox).scale2(1.0f/font.getMetrics().getUnitsPerEM(), new float[2]); + final AABBox dest = new AABBox(bbox); + return dest.scale2(1.0f/font.getMetrics().getUnitsPerEM()); } @Override diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java index 5e56d1932..11f1ce7c7 100644 --- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java +++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java @@ -119,7 +119,7 @@ final class TypecastHMetrics implements Metrics { } @Override - public AABBox getBounds(final AABBox dest, final float[] tmpV3) { - return dest.setSize(bbox.getLow(), bbox.getHigh()).scale2(unitsPerEM_inv, tmpV3); + public AABBox getBounds(final AABBox dest) { + return dest.copy(bbox).scale2(unitsPerEM_inv); } } diff --git a/src/jogl/classes/jogamp/opengl/ProjectFloat.java b/src/jogl/classes/jogamp/opengl/ProjectFloat.java index 5ec5a8e3f..3fcc75f3d 100644 --- a/src/jogl/classes/jogamp/opengl/ProjectFloat.java +++ b/src/jogl/classes/jogamp/opengl/ProjectFloat.java @@ -227,7 +227,7 @@ public class ProjectFloat { final float[] projMatrix, final int projMatrix_offset, final int[] viewport, final int viewport_offset, final float[] win_pos, final int win_pos_offset ) { - return FloatUtil.mapObjToWinCoords(objx, objy, objz, + return FloatUtil.mapObjToWin(objx, objy, objz, modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, viewport, viewport_offset, @@ -347,7 +347,7 @@ public class ProjectFloat { final float[] projMatrix, final int projMatrix_offset, final int[] viewport, final int viewport_offset, final float[] obj_pos, final int obj_pos_offset) { - return FloatUtil.mapWinToObjCoords(winx, winy, winz, + return FloatUtil.mapWinToObj(winx, winy, winz, modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, viewport, viewport_offset, @@ -505,7 +505,7 @@ public class ProjectFloat { final int[] viewport, final int viewport_offset, final float near, final float far, final float[] obj_pos, final int obj_pos_offset ) { - return FloatUtil.mapWinToObjCoords(winx, winy, winz, clipw, + return FloatUtil.mapWinToObj4(winx, winy, winz, clipw, modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, viewport, viewport_offset, diff --git a/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDevice.java b/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDevice.java index bfe93b59c..60adc7d74 100644 --- a/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDevice.java +++ b/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDevice.java @@ -34,6 +34,7 @@ import com.jogamp.nativewindow.util.PointImmutable; import com.jogamp.nativewindow.util.Rectangle; import com.jogamp.nativewindow.util.RectangleImmutable; import com.jogamp.opengl.math.FovHVHalves; +import com.jogamp.opengl.math.Vec3f; import com.jogamp.opengl.util.stereo.StereoDeviceConfig; import com.jogamp.opengl.util.stereo.EyeParameter; import com.jogamp.opengl.util.stereo.LocationSensorParameter; @@ -63,9 +64,9 @@ public class GenericStereoDevice implements StereoDevice { private static final GenericStereoDeviceConfig[] configs; static { - final float[] DEFAULT_EYE_POSITION_OFFSET_STEREO_LENSES = { 0.0f, 1.6f, -5.0f }; // 1.6 up, 5 forward - final float[] DEFAULT_EYE_POSITION_OFFSET_STEREO = { 0.0f, 0.3f, 3.0f }; // 0.3 up, 3 back - final float[] DEFAULT_EYE_POSITION_OFFSET_MONO = { 0.0f, 0.0f, 3.0f }; // 3 back + final Vec3f DEFAULT_EYE_POSITION_OFFSET_STEREO_LENSES = new Vec3f( 0.0f, 1.6f, -5.0f ); // 1.6 up, 5 forward + final Vec3f DEFAULT_EYE_POSITION_OFFSET_STEREO = new Vec3f( 0.0f, 0.3f, 3.0f ); // 0.3 up, 3 back + final Vec3f DEFAULT_EYE_POSITION_OFFSET_MONO = new Vec3f( 0.0f, 0.0f, 3.0f ); // 3 back final DimensionImmutable surfaceSizeInPixelDK1 = new Dimension(1280, 800); final float[] screenSizeInMetersDK1 = new float[] { 0.14976f, 0.0936f }; @@ -175,7 +176,7 @@ public class GenericStereoDevice implements StereoDevice { public int getRequiredRotation() { return 0; } @Override - public float[] getDefaultEyePositionOffset() { return config.defaultEyeParam[0].positionOffset; } + public Vec3f getDefaultEyePositionOffset() { return config.defaultEyeParam[0].positionOffset; } @Override public final FovHVHalves[] getDefaultFOV() { return defaultEyeFov; } @@ -264,7 +265,7 @@ public class GenericStereoDevice implements StereoDevice { @Override public final StereoDeviceRenderer createRenderer(final int distortionBits, - final int textureCount, final float[] eyePositionOffset, + final int textureCount, final Vec3f eyePositionOffset, final FovHVHalves[] eyeFov, final float pixelsPerDisplayPixel, final int textureUnit) { final EyeParameter[] eyeParam = new EyeParameter[eyeFov.length]; diff --git a/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDeviceRenderer.java b/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDeviceRenderer.java index 21567a0f1..3c6f5e37e 100644 --- a/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDeviceRenderer.java +++ b/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDeviceRenderer.java @@ -45,6 +45,7 @@ import jogamp.common.os.PlatformPropsImpl; import com.jogamp.common.nio.Buffers; import com.jogamp.common.os.Platform; import com.jogamp.opengl.JoglVersion; +import com.jogamp.opengl.math.Vec3f; import com.jogamp.opengl.util.GLArrayDataServer; import com.jogamp.opengl.util.glsl.ShaderCode; import com.jogamp.opengl.util.glsl.ShaderProgram; @@ -90,7 +91,7 @@ public class GenericStereoDeviceRenderer implements StereoDeviceRenderer { public final EyeParameter getEyeParameter() { return eyeParameter; } /* pp */ GenericEye(final GenericStereoDevice device, final int distortionBits, - final float[] eyePositionOffset, final EyeParameter eyeParam, + final Vec3f eyePositionOffset, final EyeParameter eyeParam, final DimensionImmutable textureSize, final RectangleImmutable eyeViewport) { this.eyeName = eyeParam.number; this.distortionBits = distortionBits; @@ -387,7 +388,7 @@ public class GenericStereoDeviceRenderer implements StereoDeviceRenderer { private static final DimensionImmutable zeroSize = new Dimension(0, 0); /* pp */ GenericStereoDeviceRenderer(final GenericStereoDevice context, final int distortionBits, - final int textureCount, final float[] eyePositionOffset, + final int textureCount, final Vec3f eyePositionOffset, final EyeParameter[] eyeParam, final float pixelsPerDisplayPixel, final int textureUnit, final DimensionImmutable[] eyeTextureSizes, final DimensionImmutable totalTextureSize, final RectangleImmutable[] eyeViewports) { |