diff options
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/stereo/ViewerPose.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/stereo/ViewerPose.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/stereo/ViewerPose.java b/src/jogl/classes/com/jogamp/opengl/util/stereo/ViewerPose.java index 10ee4c994..5d2cf925c 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/stereo/ViewerPose.java +++ b/src/jogl/classes/com/jogamp/opengl/util/stereo/ViewerPose.java @@ -1,5 +1,5 @@ /** - * Copyright 2014 JogAmp Community. All rights reserved. + * Copyright 2014-2023 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: @@ -28,13 +28,14 @@ package com.jogamp.opengl.util.stereo; import com.jogamp.opengl.math.Quaternion; +import com.jogamp.opengl.math.Vec3f; /** * {@link #position} and {@link #orientation} of viewer. */ public final class ViewerPose { /** - * float[3] position of viewer in meter. + * position of viewer in meter. * <p> * Apply the following to resolve the actual eye position: * <ul> @@ -43,13 +44,13 @@ public final class ViewerPose { * </ul> * </p> */ - public final float[] position; + public final Vec3f position; /** Orientation of viewer. */ public final Quaternion orientation; public ViewerPose() { - this.position = new float[3]; + this.position = new Vec3f(); this.orientation = new Quaternion(); } public ViewerPose(final float[] position, final Quaternion orientation) { @@ -64,11 +65,14 @@ public final class ViewerPose { } /** Set position and orientation of this instance. */ public final void setPosition(final float posX, final float posY, final float posZ) { - position[0] = posX; - position[1] = posY; - position[2] = posZ; + position.set( posX, posY, posZ ); } + /** Set position and orientation of this instance. */ + public final void setPosition(final Vec3f pos) { + position.set( pos ); + } + @Override public final String toString() { - return "ViewerPose[pos["+position[0]+", "+position[1]+", "+position[2]+"], "+orientation+"]"; + return "ViewerPose[pos["+position+"], "+orientation+"]"; } }
\ No newline at end of file |