summaryrefslogtreecommitdiffstats
path: root/src/gleem/CameraParameters.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2003-11-04 02:29:09 +0000
committerKenneth Russel <[email protected]>2003-11-04 02:29:09 +0000
commit917325a616f2bd89589bc3b6a4bdce0679bb99cf (patch)
tree0105b9f1710a0be9304a980fa722617a688b3a0f /src/gleem/CameraParameters.java
parent645dc4e330e1685b280b8a406bd6a400fffa06b8 (diff)
Implemented a per-thread GLContext stack, which gives a thread
knowledge of the OpenGL contexts it has made current and allows a GLDrawable to make its context current recursively as well as allowing a GLEventListener to call another GLDrawable's display() method from within its display(). This mechanism can be used fairly easily to expose swapBuffers in the public API, as has been requested. Updated the demos which had to explicitly call display() on more than one drawable to use the Animator class and to call GLDrawable.display() from within their GLEventListeners' display() methods. Updated documentation. Fixed bugs in gleem's CameraParameters class. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@27 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/gleem/CameraParameters.java')
-rw-r--r--src/gleem/CameraParameters.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gleem/CameraParameters.java b/src/gleem/CameraParameters.java
index 658820d..c406cda 100644
--- a/src/gleem/CameraParameters.java
+++ b/src/gleem/CameraParameters.java
@@ -61,6 +61,8 @@ public class CameraParameters {
Vec3f forwardDirection,
Vec3f upDirection,
Rotf orientation,
+ Mat4f modelviewMatrix,
+ Mat4f projectionMatrix,
float vertFOV,
float imagePlaneAspectRatio,
int xSize,
@@ -69,6 +71,8 @@ public class CameraParameters {
setForwardDirection(forwardDirection);
setUpDirection(upDirection);
setOrientation(orientation);
+ setModelviewMatrix(modelviewMatrix);
+ setProjectionMatrix(projectionMatrix);
setVertFOV(vertFOV);
setImagePlaneAspectRatio(imagePlaneAspectRatio);
setXSize(xSize);
@@ -79,12 +83,25 @@ public class CameraParameters {
setPosition(params.getPosition());
setForwardDirection(params.getForwardDirection());
setUpDirection(params.getUpDirection());
+ setOrientation(params.getOrientation());
+ setModelviewMatrix(params.getModelviewMatrix());
+ setProjectionMatrix(params.getProjectionMatrix());
setVertFOV(params.getVertFOV());
setImagePlaneAspectRatio(params.getImagePlaneAspectRatio());
setXSize(params.getXSize());
setYSize(params.getYSize());
}
+ public Object clone() {
+ CameraParameters params = new CameraParameters();
+ params.set(this);
+ return params;
+ }
+
+ public CameraParameters copy() {
+ return (CameraParameters) clone();
+ }
+
/** Sets 3-space origin of camera */
public void setPosition(Vec3f position) { this.position.set(position); }
/** Gets 3-space origin of camera */