diff options
Diffstat (limited to 'src/test/com/jogamp')
4 files changed, 26 insertions, 15 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java index 395f6661d..7b8fa077a 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java @@ -56,12 +56,12 @@ public class TestVersionSemanticsNOUI extends SingletonJunitCase { static final VersionNumberString curVersionNumber = new VersionNumberString(curVersion.getImplementationVersion()); static final Set<String> excludesDefault; - static final Set<String> excludesV230V23X; + static final Set<String> excludesStereoPackage; static { excludesDefault = new HashSet<String>(); excludesDefault.add("^\\Qjogamp/\\E.*$"); - excludesV230V23X = new HashSet<String>(excludesDefault); - excludesV230V23X.add("^\\Qcom/jogamp/opengl/util/stereo/\\E.*$"); + excludesStereoPackage = new HashSet<String>(excludesDefault); + excludesStereoPackage.add("^\\Qcom/jogamp/opengl/util/stereo/\\E.*$"); } @@ -138,7 +138,7 @@ public class TestVersionSemanticsNOUI extends SingletonJunitCase { VersionSemanticsUtil.testVersion(diffCriteria, expectedCompatibilityType, previousJar, preVersionNumber, curVersion.getClass(), currentCL, curVersionNumber, - excludesV230V23X); + excludesStereoPackage); } public static void main(final String args[]) throws IOException { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java index e95c2a9da..9b414d7c5 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java @@ -43,7 +43,7 @@ import com.jogamp.opengl.util.glsl.ShaderCode; import com.jogamp.opengl.util.glsl.ShaderProgram; import com.jogamp.opengl.util.glsl.ShaderState; import com.jogamp.opengl.util.stereo.EyeParameter; -import com.jogamp.opengl.util.stereo.EyePose; +import com.jogamp.opengl.util.stereo.ViewerPose; import com.jogamp.opengl.util.stereo.StereoGLEventListener; import java.nio.FloatBuffer; @@ -407,9 +407,11 @@ public class GearsES2 implements StereoGLEventListener, TileRendererBase.TileRen private final float[] vec3Tmp2 = new float[3]; private final float[] vec3Tmp3 = new float[3]; + private static final float[] vec3ScalePos = new float[] { 20f, 20f, 20f }; + @Override public void reshapeForEye(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height, - final EyeParameter eyeParam, final EyePose eyePose) { + final EyeParameter eyeParam, final ViewerPose viewerPose) { final GL2ES2 gl = drawable.getGL().getGL2ES2(); pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION); final float[] mat4Projection = FloatUtil.makePerspective(mat4Tmp1, 0, true, eyeParam.fovhv, zNear, zFar); @@ -426,10 +428,11 @@ public class GearsES2 implements StereoGLEventListener, TileRendererBase.TileRen final Quaternion rollPitchYaw = new Quaternion(); // private final float eyeYaw = FloatUtil.PI; // 180 degrees in radians // rollPitchYaw.rotateByAngleY(eyeYaw); - final float[] shiftedEyePos = rollPitchYaw.rotateVector(vec3Tmp1, 0, eyePose.position, 0); + final float[] shiftedEyePos = rollPitchYaw.rotateVector(vec3Tmp1, 0, viewerPose.position, 0); + VectorUtil.scaleVec3(shiftedEyePos, shiftedEyePos, vec3ScalePos); // amplify viewerPose position VectorUtil.addVec3(shiftedEyePos, shiftedEyePos, eyeParam.positionOffset); - rollPitchYaw.mult(eyePose.orientation); + rollPitchYaw.mult(viewerPose.orientation); final float[] up = rollPitchYaw.rotateVector(vec3Tmp2, 0, VectorUtil.VEC3_UNIT_Y, 0); final float[] forward = rollPitchYaw.rotateVector(vec3Tmp3, 0, VectorUtil.VEC3_UNIT_Z_NEG, 0); final float[] center = VectorUtil.addVec3(forward, shiftedEyePos, forward); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSBSStereo.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSBSStereo.java index 57aa76c82..e936bf991 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSBSStereo.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSBSStereo.java @@ -46,6 +46,7 @@ import com.jogamp.graph.curve.Region; import com.jogamp.graph.curve.opengl.GLRegion; import com.jogamp.graph.curve.opengl.RegionRenderer; import com.jogamp.graph.font.Font; +import com.jogamp.junit.util.JunitTracer; import com.jogamp.newt.Window; import com.jogamp.newt.event.KeyAdapter; import com.jogamp.newt.event.KeyEvent; @@ -71,7 +72,7 @@ import com.jogamp.opengl.util.glsl.ShaderCode; import com.jogamp.opengl.util.glsl.ShaderProgram; import com.jogamp.opengl.util.glsl.ShaderState; import com.jogamp.opengl.util.stereo.EyeParameter; -import com.jogamp.opengl.util.stereo.EyePose; +import com.jogamp.opengl.util.stereo.ViewerPose; import com.jogamp.opengl.util.stereo.StereoClientRenderer; import com.jogamp.opengl.util.stereo.StereoGLEventListener; import com.jogamp.opengl.util.texture.Texture; @@ -415,7 +416,7 @@ public class MovieSBSStereo implements StereoGLEventListener { ", "+drawable.getClass().getName()+", "+drawable); if(waitForKey) { - UITestCase.waitForKey("Init>"); + JunitTracer.waitForKey("Init>"); } final Texture tex; try { @@ -639,9 +640,11 @@ public class MovieSBSStereo implements StereoGLEventListener { GLArrayDataServer interleavedVBOCurrent = null; + private static final float[] vec3ScalePos = new float[] { 4f, 4f, 4f }; + @Override public void reshapeForEye(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height, - final EyeParameter eyeParam, final EyePose eyePose) { + final EyeParameter eyeParam, final ViewerPose viewerPose) { final GL2ES2 gl = drawable.getGL().getGL2ES2(); interleavedVBOCurrent = 0 == eyeParam.number ? interleavedVBOLeft : interleavedVBORight; @@ -657,10 +660,11 @@ public class MovieSBSStereo implements StereoGLEventListener { pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW); final Quaternion rollPitchYaw = new Quaternion(); - final float[] shiftedEyePos = rollPitchYaw.rotateVector(vec3Tmp1, 0, eyePose.position, 0); + final float[] shiftedEyePos = rollPitchYaw.rotateVector(vec3Tmp1, 0, viewerPose.position, 0); + VectorUtil.scaleVec3(shiftedEyePos, shiftedEyePos, vec3ScalePos); // amplify viewerPose position VectorUtil.addVec3(shiftedEyePos, shiftedEyePos, eyeParam.positionOffset); - rollPitchYaw.mult(eyePose.orientation); + rollPitchYaw.mult(viewerPose.orientation); final float[] up = rollPitchYaw.rotateVector(vec3Tmp2, 0, VectorUtil.VEC3_UNIT_Y, 0); final float[] forward = rollPitchYaw.rotateVector(vec3Tmp3, 0, VectorUtil.VEC3_UNIT_Z_NEG, 0); final float[] center = VectorUtil.addVec3(forward, shiftedEyePos, forward); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/stereo/StereoDemo01.java b/src/test/com/jogamp/opengl/test/junit/jogl/stereo/StereoDemo01.java index 693f2f72b..c2e808770 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/stereo/StereoDemo01.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/stereo/StereoDemo01.java @@ -245,7 +245,7 @@ public class StereoDemo01 { System.err.println("StereoDevice "+stereoDevice); // Start the sensor which provides the Rift’s pose and motion. - if( !stereoDevice.startSensors(true) ) { + if( !stereoDevice.startSensors(stereoDevice.getSupportedSensorBits(), 0) ) { System.err.println("Could not start sensors on device "+deviceIndex); } @@ -335,7 +335,11 @@ public class StereoDemo01 { } switch(e.getKeySymbol()) { case KeyEvent.VK_R: { - stereoDevice.startSensors(!stereoDevice.getSensorsStarted()); + if( stereoDevice.getSensorsStarted() ) { + stereoDevice.stopSensors(); + } else { + stereoDevice.startSensors(stereoDevice.getSupportedSensorBits(), 0); + } break; } } |