diff options
author | Kevin Rushforth <[email protected]> | 2004-06-26 01:31:07 +0000 |
---|---|---|
committer | Kevin Rushforth <[email protected]> | 2004-06-26 01:31:07 +0000 |
commit | 8f7712250b4daa15d2aac7990264efd8940e6e4d (patch) | |
tree | 44af2a55ba6154990a288ae754cef2b51daafda7 /src/classes/share/javax | |
parent | ac5fd5c390be54f9979a363f97af034f719809ee (diff) |
Fixed a transparency sorting problem for Project Looking Glass
Updated pre-release info files
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@21 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/classes/share/javax')
4 files changed, 61 insertions, 1 deletions
diff --git a/src/classes/share/javax/media/j3d/GeometryAtom.java b/src/classes/share/javax/media/j3d/GeometryAtom.java index b8dc3f5..a02f711 100644 --- a/src/classes/share/javax/media/j3d/GeometryAtom.java +++ b/src/classes/share/javax/media/j3d/GeometryAtom.java @@ -226,6 +226,35 @@ class GeometryAtom extends Object implements BHLeafInterface, NnuId { // value is up-to-date void updateCentroid() { + // New for 1.3.2 + // If the sortShape3DBounds flag is set, the bounds of the + // Shape3D node will be used in place of the computed + // GeometryArray bounds for transparency sorting for those + // Shape3D nodes whose boundsAutoCompute attribute is set to + // false. + if (VirtualUniverse.mc.sortShape3DBounds && + !source.boundsAutoCompute) { + + synchronized(lockObj) { + if (centroid == null) { + centroid = new Point3d[geometryArray.length]; + for (int j = 0; j < centroid.length; j++) { + centroid[j] = new Point3d(source.localBounds.getCenter()); + source.getCurrentLocalToVworld(0).transform(centroid[j]); + } + } + else { + for (int j = 0; j < centroid.length; j++) { + centroid[j].set(source.localBounds.getCenter()); + source.getCurrentLocalToVworld(0).transform(centroid[j]); + } + } + } + + return; + } + // End of new for 1.3.2 + synchronized(lockObj) { for (int j = 0; j < geometryArray.length; j++) { if (geometryArray[j] == null) diff --git a/src/classes/share/javax/media/j3d/MasterControl.java b/src/classes/share/javax/media/j3d/MasterControl.java index 5d92ff0..7d7bdcf 100644 --- a/src/classes/share/javax/media/j3d/MasterControl.java +++ b/src/classes/share/javax/media/j3d/MasterControl.java @@ -418,6 +418,13 @@ class MasterControl { // successfully disabled. boolean xineramaDisabled = false; + // Set by the -Dj3d.sortShape3DBounds property, When this flag is + // set to true, the bounds of the Shape3D node will be used in + // place of the computed GeometryArray bounds for transparency + // sorting for those Shape3D nodes whose boundsAutoCompute + // attribute is set to false. + boolean sortShape3DBounds = false; + /** * Constructs a new MasterControl object. Note that there is * exatly one MasterControl object, created statically by @@ -571,6 +578,23 @@ class MasterControl { "Java 3D: Separate Specular Color disabled if possible"); } + Boolean j3dSortShape3DBounds = + (Boolean) java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public Object run() { + String str = System.getProperty("j3d.sortShape3DBounds"); + if (str == null) { + return Boolean.FALSE; + } else { + return Boolean.TRUE; + } + } + }); + sortShape3DBounds = j3dSortShape3DBounds.booleanValue(); + if (sortShape3DBounds) { + System.err.println("Java 3D: Shape3D bounds enabled for transparency sorting"); + } + // Get the maximum number of texture units final int defaultTextureUnitMax = textureUnitMax; Integer textureUnitLimit = diff --git a/src/classes/share/javax/media/j3d/Shape3DRetained.java b/src/classes/share/javax/media/j3d/Shape3DRetained.java index f115c99..da8dd1a 100644 --- a/src/classes/share/javax/media/j3d/Shape3DRetained.java +++ b/src/classes/share/javax/media/j3d/Shape3DRetained.java @@ -736,6 +736,13 @@ class Shape3DRetained extends LeafRetained { ms.locale = locale; ms.parent = parent; + // New 1.3.2 + // Used when user supplied their own bounds for transparency sorting + // GeometryAtom uses this to change how it computes the centroid + ms.boundsAutoCompute = boundsAutoCompute; + ms.localBounds = localBounds; + // End new 1.3.2 + OrderedPath op = (OrderedPath)s.orderedPaths.get(index); if (op.pathElements.size() == 0) { ms.orderedPath = null; diff --git a/src/classes/share/javax/media/j3d/VersionInfo.java b/src/classes/share/javax/media/j3d/VersionInfo.java index 3e52f01..d70147c 100644 --- a/src/classes/share/javax/media/j3d/VersionInfo.java +++ b/src/classes/share/javax/media/j3d/VersionInfo.java @@ -61,7 +61,7 @@ class VersionInfo extends Object { * This will typically by null for final, released builds, but * should be non-null for all other builds. */ - private static final String VERSION_BUILD = "build2"; + private static final String VERSION_BUILD = "build3"; /** * Time and date stamp appended to the end of the version string. |