From 846032c284f4516664dff398f71b3f7f6327281c Mon Sep 17 00:00:00 2001 From: Chien Yang Date: Thu, 4 Nov 2004 22:59:21 +0000 Subject: 1) Do not compute cachedFrustum if j3d.viewFrustumCulling is false. 2) Removed an unuse method in CachedFrustum.java. git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@70 ba19aa83-45c5-6ac9-afd3-db810772062c --- .../share/javax/media/j3d/CachedFrustum.java | 131 --------------------- src/classes/share/javax/media/j3d/Canvas3D.java | 6 +- 2 files changed, 5 insertions(+), 132 deletions(-) diff --git a/src/classes/share/javax/media/j3d/CachedFrustum.java b/src/classes/share/javax/media/j3d/CachedFrustum.java index a034e7d..e4d1df1 100644 --- a/src/classes/share/javax/media/j3d/CachedFrustum.java +++ b/src/classes/share/javax/media/j3d/CachedFrustum.java @@ -437,135 +437,4 @@ class CachedFrustum { } - - /** - * Tests for intersection of six sided hull and the frustum - * @param six sided bounding box ( lower (x,y,z), upper (x,y,z)) - * @return true if they intersect - */ - boolean intersect( double lx, double ly, double lz, - double ux, double uy, double uz) { - int i,index; - - // System.out.println("intersect frustum with box : lower ( " + lx + ", " + ly + ", " + lz + - // ") upper( " + ux + ", " + uy + ", " + uz + ")"); - // System.out.println("frustum "+this.toString()); - // check if box and bounding box of frustum intersect - if( ux > this.lower.x && - lx < this.upper.x && - uy > this.lower.y && - ly < this.upper.y && - uz > this.lower.z && - lz < this.upper.z ) { - } else { - // System.out.println("false box and bounding box of frustum do not intersect"); - return false; - } - - // check if all box points out any frustum plane - for(i=0;i<6;i++){ - if(( ux*this.clipPlanes[i].x + - uy*this.clipPlanes[i].y + - uz*this.clipPlanes[i].z + this.clipPlanes[i].w ) > -EPSILON ) { - continue; // corner inside plane - } - if(( ux*this.clipPlanes[i].x + - ly*this.clipPlanes[i].y + - uz*this.clipPlanes[i].z + this.clipPlanes[i].w ) > -EPSILON ){ - continue; - } - if(( ux*this.clipPlanes[i].x + - ly*this.clipPlanes[i].y + - lz*this.clipPlanes[i].z + this.clipPlanes[i].w ) > -EPSILON ){ - continue; - } - if(( ux*this.clipPlanes[i].x + - uy*this.clipPlanes[i].y + - lz*this.clipPlanes[i].z + this.clipPlanes[i].w ) > -EPSILON ) { - continue; - } - if(( lx*this.clipPlanes[i].x + - uy*this.clipPlanes[i].y + - uz*this.clipPlanes[i].z + this.clipPlanes[i].w ) > -EPSILON ) { - continue; - } - if(( lx*this.clipPlanes[i].x + - ly*this.clipPlanes[i].y + - uz*this.clipPlanes[i].z + this.clipPlanes[i].w ) > -EPSILON ) { - continue; - } - if(( lx*this.clipPlanes[i].x + - ly*this.clipPlanes[i].y + - lz*this.clipPlanes[i].z + this.clipPlanes[i].w ) > -EPSILON ) { - continue; - } - if(( lx*this.clipPlanes[i].x + - uy*this.clipPlanes[i].y + - lz*this.clipPlanes[i].z + this.clipPlanes[i].w ) > -EPSILON ) { - continue; - } - // System.out.println("false all corners outside this frustum plane"+frustum.clipPlanes[i].toString()); - return false; // all corners outside this frustum plane - } - - // check if any box corner is inside of the frustum silhoette edges in the 3 views - // y-z - for(i=0;i