├── .gitignore ├── COPYRIGHT.txt ├── LICENSE-SPEC.html ├── LICENSE.txt ├── README.md ├── doc-files ├── Behaviors.html ├── Behaviors1.gif ├── Behaviors2.gif ├── Behaviors3.gif ├── Behaviors4.gif ├── Behaviors5.gif ├── Behaviors6.gif ├── Behaviors7.gif ├── Behaviors8.gif ├── Concepts.html ├── Concepts1.gif ├── Concepts2.gif ├── DAG.gif ├── HelloUniverse.html ├── Immediate.html ├── Immediate1.gif ├── Rendering.html ├── SceneGraphOverview.html ├── SceneGraphSharing.html ├── SceneGraphSharing1.gif ├── SceneGraphSharing2.gif ├── SceneGraphSharing3.gif ├── SceneGraphSharing4.gif ├── SceneGraphSharing5.gif ├── ViewBranch.gif ├── ViewModel.html ├── ViewModel1.gif ├── ViewModel10.gif ├── ViewModel11.gif ├── ViewModel12.gif ├── ViewModel13.gif ├── ViewModel14.gif ├── ViewModel2.gif ├── ViewModel3.gif ├── ViewModel4.gif ├── ViewModel5.gif ├── ViewModel6.gif ├── ViewModel7.gif ├── ViewModel8.gif ├── ViewModel9.gif ├── VirtualUniverse.gif ├── VirtualUniverse.html ├── intro.gif └── intro.html ├── docs ├── ChangeLog-1_4.html ├── ChangeLog-1_5.html ├── GL2ES2PipelineUsageGuide.md ├── api-changes-1_4.txt ├── api-changes-1_5.txt ├── api-changes-1_6.txt ├── api-changes-1_7.txt ├── perf_guide.txt └── tutorial │ ├── j3d_tutorial_ch0.pdf │ ├── j3d_tutorial_ch1.pdf │ ├── j3d_tutorial_ch2.pdf │ ├── j3d_tutorial_ch3.pdf │ ├── j3d_tutorial_ch4.pdf │ ├── j3d_tutorial_ch5.pdf │ ├── j3d_tutorial_ch6.pdf │ └── j3d_tutorial_ch7.pdf ├── pom.xml └── src └── main ├── java-templates └── org │ └── jogamp │ └── java3d │ └── VersionInfo.java ├── java └── org │ └── jogamp │ └── java3d │ ├── Alpha.java │ ├── AlternateAppearance.java │ ├── AlternateAppearanceRetained.java │ ├── AmbientLight.java │ ├── AmbientLightRetained.java │ ├── Appearance.java │ ├── AppearanceRetained.java │ ├── AssertionFailureException.java │ ├── AttributeBin.java │ ├── AudioDevice.java │ ├── AudioDevice3D.java │ ├── AudioDevice3DL2.java │ ├── AudioDeviceEnumerator.java │ ├── AuralAttributes.java │ ├── AuralAttributesRetained.java │ ├── AutoOffScreenCanvas3D.java │ ├── BHInsertStructure.java │ ├── BHInternalNode.java │ ├── BHLeafInterface.java │ ├── BHLeafNode.java │ ├── BHNode.java │ ├── BHTree.java │ ├── Background.java │ ├── BackgroundRetained.java │ ├── BackgroundSound.java │ ├── BackgroundSoundRetained.java │ ├── BadTransformException.java │ ├── Behavior.java │ ├── BehaviorRetained.java │ ├── BehaviorScheduler.java │ ├── BehaviorStructure.java │ ├── Billboard.java │ ├── BoundingBox.java │ ├── BoundingLeaf.java │ ├── BoundingLeafRetained.java │ ├── BoundingPolytope.java │ ├── BoundingSphere.java │ ├── Bounds.java │ ├── BranchGroup.java │ ├── BranchGroupRetained.java │ ├── CachedFrustum.java │ ├── CachedTargets.java │ ├── Canvas3D.java │ ├── CanvasViewCache.java │ ├── CanvasViewEventCatcher.java │ ├── CapabilityBits.java │ ├── CapabilityNotSetException.java │ ├── Clip.java │ ├── ClipRetained.java │ ├── ColorInterpolator.java │ ├── ColoringAttributes.java │ ├── ColoringAttributesRetained.java │ ├── CompileState.java │ ├── CompressedGeometry.java │ ├── CompressedGeometryHeader.java │ ├── CompressedGeometryRenderMethod.java │ ├── CompressedGeometryRetained.java │ ├── ConeSound.java │ ├── ConeSoundRetained.java │ ├── Context.java │ ├── DanglingReferenceException.java │ ├── DecalGroup.java │ ├── DecalGroupRetained.java │ ├── DefaultRenderMethod.java │ ├── DepthComponent.java │ ├── DepthComponentFloat.java │ ├── DepthComponentFloatRetained.java │ ├── DepthComponentInt.java │ ├── DepthComponentIntRetained.java │ ├── DepthComponentNative.java │ ├── DepthComponentNativeRetained.java │ ├── DepthComponentRetained.java │ ├── DirectionalLight.java │ ├── DirectionalLightRetained.java │ ├── DisplayListRenderMethod.java │ ├── DistanceLOD.java │ ├── Drawable.java │ ├── DrawingSurfaceObject.java │ ├── EnvironmentSet.java │ ├── EventCatcher.java │ ├── ExponentialFog.java │ ├── ExponentialFogRetained.java │ ├── Fog.java │ ├── FogRetained.java │ ├── Font3D.java │ ├── FontExtrusion.java │ ├── FreeListManager.java │ ├── GLSLShaderProgram.java │ ├── GLSLShaderProgramRetained.java │ ├── GeneralizedStrip.java │ ├── GeneralizedStripFlags.java │ ├── GeneralizedVertexList.java │ ├── Geometry.java │ ├── GeometryArray.java │ ├── GeometryArrayRetained.java │ ├── GeometryAtom.java │ ├── GeometryDecompressor.java │ ├── GeometryDecompressorRetained.java │ ├── GeometryDecompressorShape3D.java │ ├── GeometryLock.java │ ├── GeometryRetained.java │ ├── GeometryService.java │ ├── GeometryStripArray.java │ ├── GeometryStripArrayRetained.java │ ├── GeometryStructure.java │ ├── GeometryUpdater.java │ ├── GraphStructureChangeListener.java │ ├── GraphicsConfigInfo.java │ ├── GraphicsConfigTemplate3D.java │ ├── GraphicsContext3D.java │ ├── Group.java │ ├── GroupRetained.java │ ├── HashKey.java │ ├── HiResCoord.java │ ├── IllegalRenderingStateException.java │ ├── IllegalSceneGraphException.java │ ├── IllegalSharingException.java │ ├── ImageComponent.java │ ├── ImageComponent2D.java │ ├── ImageComponent2DRetained.java │ ├── ImageComponent3D.java │ ├── ImageComponent3DRetained.java │ ├── ImageComponentRetained.java │ ├── ImageComponentUpdateInfo.java │ ├── IndexedGeometryArray.java │ ├── IndexedGeometryArrayRetained.java │ ├── IndexedGeometryStripArray.java │ ├── IndexedGeometryStripArrayRetained.java │ ├── IndexedLineArray.java │ ├── IndexedLineArrayRetained.java │ ├── IndexedLineStripArray.java │ ├── IndexedLineStripArrayRetained.java │ ├── IndexedObject.java │ ├── IndexedPointArray.java │ ├── IndexedPointArrayRetained.java │ ├── IndexedQuadArray.java │ ├── IndexedQuadArrayRetained.java │ ├── IndexedTriangleArray.java │ ├── IndexedTriangleArrayRetained.java │ ├── IndexedTriangleFanArray.java │ ├── IndexedTriangleFanArrayRetained.java │ ├── IndexedTriangleStripArray.java │ ├── IndexedTriangleStripArrayRetained.java │ ├── IndexedUnorderSet.java │ ├── InputDevice.java │ ├── InputDeviceBlockingThread.java │ ├── InputDeviceScheduler.java │ ├── IntegerFreeList.java │ ├── Interpolator.java │ ├── J3DBuffer.java │ ├── J3DGraphics2D.java │ ├── J3DGraphics2DImpl.java │ ├── J3dClock.java │ ├── J3dDebug.java │ ├── J3dHash.java │ ├── J3dI18N.java │ ├── J3dMessage.java │ ├── J3dNotification.java │ ├── J3dQueryProps.java │ ├── J3dStructure.java │ ├── J3dThread.java │ ├── J3dThreadData.java │ ├── Jogl2es2Context.java │ ├── Jogl2es2DEPPipeline.java │ ├── Jogl2es2MatrixUtil.java │ ├── Jogl2es2PerFrameStats.java │ ├── Jogl2es2Pipeline.java │ ├── JoglContext.java │ ├── JoglDrawable.java │ ├── JoglDrawingSurfaceObject.java │ ├── JoglGraphicsConfiguration.java │ ├── JoglPipeline.java │ ├── JoglShaderObject.java │ ├── LOD.java │ ├── Leaf.java │ ├── LeafRetained.java │ ├── Light.java │ ├── LightBin.java │ ├── LightRetained.java │ ├── LightSet.java │ ├── LineArray.java │ ├── LineArrayRetained.java │ ├── LineAttributes.java │ ├── LineAttributesRetained.java │ ├── LineStripArray.java │ ├── LineStripArrayRetained.java │ ├── LinearFog.java │ ├── LinearFogRetained.java │ ├── Link.java │ ├── LinkRetained.java │ ├── Locale.java │ ├── MRSWLock.java │ ├── MasterControl.java │ ├── MasterControlThread.java │ ├── Material.java │ ├── MaterialRetained.java │ ├── MediaContainer.java │ ├── MediaContainerRetained.java │ ├── MemoryFreeList.java │ ├── ModelClip.java │ ├── ModelClipRetained.java │ ├── Morph.java │ ├── MorphRetained.java │ ├── MultipleParentException.java │ ├── NioImageBuffer.java │ ├── NnuId.java │ ├── NnuIdManager.java │ ├── Node.java │ ├── NodeComponent.java │ ├── NodeComponentRetained.java │ ├── NodeComponentUpdate.java │ ├── NodeData.java │ ├── NodeReferenceTable.java │ ├── NodeRetained.java │ ├── NoopDrawingSurfaceObject.java │ ├── NoopPipeline.java │ ├── NotificationThread.java │ ├── ObjectUpdate.java │ ├── OrderedBin.java │ ├── OrderedChildInfo.java │ ├── OrderedCollection.java │ ├── OrderedGroup.java │ ├── OrderedGroupRetained.java │ ├── OrderedPath.java │ ├── OrderedPathElement.java │ ├── OrientedShape3D.java │ ├── OrientedShape3DRenderMethod.java │ ├── OrientedShape3DRetained.java │ ├── PathInterpolator.java │ ├── PhysicalBody.java │ ├── PhysicalEnvironment.java │ ├── PickBounds.java │ ├── PickCone.java │ ├── PickConeRay.java │ ├── PickConeSegment.java │ ├── PickCylinder.java │ ├── PickCylinderRay.java │ ├── PickCylinderSegment.java │ ├── PickInfo.java │ ├── PickPoint.java │ ├── PickRay.java │ ├── PickSegment.java │ ├── PickShape.java │ ├── Pipeline.java │ ├── PointArray.java │ ├── PointArrayRetained.java │ ├── PointAttributes.java │ ├── PointAttributesRetained.java │ ├── PointLight.java │ ├── PointLightRetained.java │ ├── PointSound.java │ ├── PointSoundRetained.java │ ├── PolygonAttributes.java │ ├── PolygonAttributesRetained.java │ ├── PositionInterpolator.java │ ├── PositionPathInterpolator.java │ ├── QuadArray.java │ ├── QuadArrayRetained.java │ ├── Raster.java │ ├── RasterRetained.java │ ├── RenderAtom.java │ ├── RenderAtomListInfo.java │ ├── RenderBin.java │ ├── RenderMethod.java │ ├── RenderMolecule.java │ ├── Renderer.java │ ├── RendererStructure.java │ ├── RenderingAttributes.java │ ├── RenderingAttributesRetained.java │ ├── RenderingAttributesStructure.java │ ├── RenderingEnvironmentStructure.java │ ├── RenderingError.java │ ├── RenderingErrorListener.java │ ├── RestrictedAccessException.java │ ├── RotPosPathInterpolator.java │ ├── RotPosScalePathInterpolator.java │ ├── RotationInterpolator.java │ ├── RotationPathInterpolator.java │ ├── ScaleInterpolator.java │ ├── SceneGraphCycleException.java │ ├── SceneGraphObject.java │ ├── SceneGraphObjectRetained.java │ ├── SceneGraphPath.java │ ├── Screen3D.java │ ├── ScreenViewCache.java │ ├── Sensor.java │ ├── SensorRead.java │ ├── SetLiveState.java │ ├── Shader.java │ ├── ShaderAppearance.java │ ├── ShaderAppearanceRetained.java │ ├── ShaderAttrLoc.java │ ├── ShaderAttribute.java │ ├── ShaderAttributeArray.java │ ├── ShaderAttributeArrayRetained.java │ ├── ShaderAttributeBinding.java │ ├── ShaderAttributeBindingRetained.java │ ├── ShaderAttributeObject.java │ ├── ShaderAttributeObjectRetained.java │ ├── ShaderAttributeRetained.java │ ├── ShaderAttributeSet.java │ ├── ShaderAttributeSetRetained.java │ ├── ShaderAttributeValue.java │ ├── ShaderAttributeValueRetained.java │ ├── ShaderBin.java │ ├── ShaderConstants.java │ ├── ShaderError.java │ ├── ShaderErrorListener.java │ ├── ShaderId.java │ ├── ShaderProgram.java │ ├── ShaderProgramId.java │ ├── ShaderProgramRetained.java │ ├── ShaderRetained.java │ ├── Shape3D.java │ ├── Shape3DCompileRetained.java │ ├── Shape3DRetained.java │ ├── SharedGroup.java │ ├── SharedGroupRetained.java │ ├── Sound.java │ ├── SoundException.java │ ├── SoundRetained.java │ ├── SoundScheduler.java │ ├── SoundSchedulerAtom.java │ ├── SoundStructure.java │ ├── Soundscape.java │ ├── SoundscapeRetained.java │ ├── SourceCodeShader.java │ ├── SourceCodeShaderRetained.java │ ├── SparseArray.java │ ├── SpotLight.java │ ├── SpotLightRetained.java │ ├── StructureUpdateThread.java │ ├── Switch.java │ ├── SwitchRetained.java │ ├── SwitchState.java │ ├── SwitchValueInterpolator.java │ ├── Targets.java │ ├── TargetsInterface.java │ ├── TexCoordGeneration.java │ ├── TexCoordGenerationRetained.java │ ├── Text3D.java │ ├── Text3DRenderMethod.java │ ├── Text3DRetained.java │ ├── Texture.java │ ├── Texture2D.java │ ├── Texture2DRetained.java │ ├── Texture3D.java │ ├── Texture3DRetained.java │ ├── TextureAttributes.java │ ├── TextureAttributesRetained.java │ ├── TextureBin.java │ ├── TextureCubeMap.java │ ├── TextureCubeMapRetained.java │ ├── TextureRetained.java │ ├── TextureUnitState.java │ ├── TextureUnitStateRetained.java │ ├── TimerThread.java │ ├── Transform3D.java │ ├── TransformGroup.java │ ├── TransformGroupData.java │ ├── TransformGroupRetained.java │ ├── TransformInterpolator.java │ ├── TransformStructure.java │ ├── TransparencyAttributes.java │ ├── TransparencyAttributesRetained.java │ ├── TransparencyInterpolator.java │ ├── TransparencySortGeom.java │ ├── TransparencySortMap.java │ ├── TransparentRenderingInfo.java │ ├── TriangleArray.java │ ├── TriangleArrayRetained.java │ ├── TriangleFanArray.java │ ├── TriangleFanArrayRetained.java │ ├── TriangleStripArray.java │ ├── TriangleStripArrayRetained.java │ ├── UnorderList.java │ ├── UpdateTargets.java │ ├── Utils.java │ ├── VertexArrayRenderMethod.java │ ├── View.java │ ├── ViewCache.java │ ├── ViewPlatform.java │ ├── ViewPlatformRetained.java │ ├── ViewSpecificGroup.java │ ├── ViewSpecificGroupRetained.java │ ├── VirtualUniverse.java │ ├── WakeupAnd.java │ ├── WakeupAndOfOrs.java │ ├── WakeupCondition.java │ ├── WakeupCriteriaEnumerator.java │ ├── WakeupCriterion.java │ ├── WakeupIndexedList.java │ ├── WakeupOnAWTEvent.java │ ├── WakeupOnActivation.java │ ├── WakeupOnBehaviorPost.java │ ├── WakeupOnCollisionEntry.java │ ├── WakeupOnCollisionExit.java │ ├── WakeupOnCollisionMovement.java │ ├── WakeupOnDeactivation.java │ ├── WakeupOnElapsedFrames.java │ ├── WakeupOnElapsedTime.java │ ├── WakeupOnElapsedTimeHeap.java │ ├── WakeupOnSensorEntry.java │ ├── WakeupOnSensorExit.java │ ├── WakeupOnTransformChange.java │ ├── WakeupOnViewPlatformEntry.java │ ├── WakeupOnViewPlatformExit.java │ ├── WakeupOr.java │ └── WakeupOrOfAnds.java ├── javadoc └── org │ └── jogamp │ └── java3d │ ├── doc-files │ ├── Behaviors.html │ ├── Behaviors1.gif │ ├── Behaviors2.gif │ ├── Behaviors3.gif │ ├── Behaviors4.gif │ ├── Behaviors5.gif │ ├── Behaviors6.gif │ ├── Behaviors7.gif │ ├── Behaviors8.gif │ ├── Concepts.html │ ├── Concepts1.gif │ ├── Concepts2.gif │ ├── DAG.gif │ ├── HelloUniverse.html │ ├── Immediate.html │ ├── Immediate1.gif │ ├── Rendering.html │ ├── SceneGraphOverview.html │ ├── SceneGraphSharing.html │ ├── SceneGraphSharing1.gif │ ├── SceneGraphSharing2.gif │ ├── SceneGraphSharing3.gif │ ├── SceneGraphSharing4.gif │ ├── SceneGraphSharing5.gif │ ├── ViewBranch.gif │ ├── ViewModel.html │ ├── ViewModel1.gif │ ├── ViewModel10.gif │ ├── ViewModel11.gif │ ├── ViewModel12.gif │ ├── ViewModel13.gif │ ├── ViewModel14.gif │ ├── ViewModel2.gif │ ├── ViewModel3.gif │ ├── ViewModel4.gif │ ├── ViewModel5.gif │ ├── ViewModel6.gif │ ├── ViewModel7.gif │ ├── ViewModel8.gif │ ├── ViewModel9.gif │ ├── VirtualUniverse.gif │ ├── VirtualUniverse.html │ ├── intro.gif │ └── intro.html │ └── package.html └── resources └── org └── jogamp └── java3d └── ExceptionStrings.properties /.gitignore: -------------------------------------------------------------------------------- 1 | /.classpath 2 | /.project 3 | /.settings/ 4 | /target/ 5 | /doc/ 6 | /doc-all/ 7 | -------------------------------------------------------------------------------- /COPYRIGHT.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/COPYRIGHT.txt -------------------------------------------------------------------------------- /LICENSE-SPEC.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 3D Graphics API for the Java Platform 7 | 8 | 9 |

Copyright 1996-2008 Sun Microsystems, Inc. All rights reserved. 10 | Use is subject to license terms. 11 |

12 |

This javadoc-generated API documentation is not an 13 | official API specification. This documentation may contain references to 14 | Java and Java 3D, both of which are trademarks of Sun Microsystems, Inc. 15 | Any reference to these and other trademarks of Sun Microsystems are 16 | for explanatory purposes only. Their use does impart any rights beyond 17 | those listed in the source code license. In particular, Sun Microsystems 18 | retains all intellectual property and trademark rights as described in 19 | the proprietary rights notice in the COPYRIGHT.txt file. 20 |

21 | 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Java3D Readme 2 | === 3 | The source code for the j3d-core project is copyrighted code that is 4 | licensed to individuals or companies who download or otherwise access 5 | the code. 6 | 7 | The copyright notice for this project is in COPYRIGHT.txt 8 | 9 | The source code license information for this project is in LICENSE.txt 10 | 11 | Additional information and license restrictions for third party source 12 | code are found in the THIRDPARTY-LICENSE-*.txt files. 13 | 14 | ## Building Java3D 15 | 16 | The instructions below are based on eclipse, however they should work on most common IDE's 17 | 18 | Clone the repo using 19 | https://github.com/philjord/java3d-core.git 20 | Make note of the root folder you use 21 | Right click on the Project Explorer view and select Import 22 | Expand the Maven group and select Existing Maven Project and click Next 23 | For Root directory click Browse and find the root folder that you cloned the repo into 24 | There should be a pom.xml that is ticked in the Projects area 25 | Click Finish 26 | Repeat for java3d-utils using 27 | https://github.com/philjord/java3d-utils.git 28 | Repeat for vecmath using 29 | https://github.com/philjord/vecmath.git 30 | 31 | Once that's done it's likely you'll need to 32 | Right click on pom.xml -> Run As -> Maven clean 33 | then 34 | Right click on pom.xml -> Run As -> Maven generate sources 35 | This should place a derived version of VersionInfo.java into /java3d-core/target/generated-sources/java-templates 36 | 37 | 38 | If you are new to Java3D then it might be good to repeat the clone import step for java3d-examples too, using 39 | https://github.com/philjord/java3d-examples.git 40 | 41 | Now if you right click on 42 | org.jdesktop.j3d.examples.hello_universe.HelloUniverse.java 43 | Run as ... Java Application 44 | You should see Java3D working 45 | 46 | ## Documentation 47 | 48 | ### Javadocs 49 | 50 | https://jogamp.org/wiki/index.php?title=Java3D_API_Documentation 51 | 52 | ### Basic overview guide 53 | 54 | For the best kick off point see [/docs/tutorial/](/docs/tutorial/) 55 | For a description of performance see [/docs/perf_guide.txt](/docs/perf_guide.txt) 56 | Old Java3d project site with lots of information 57 | General technical tips 58 | Using the newer ES2/ES3 pipeline [/docs/GL2ES2PipelineUsageGuide.md](/docs/GL2ES2PipelineUsageGuide.md) 59 | 60 | ### Tutorials 61 | 62 | 63 | 64 | ### FAQ 65 | 66 | 67 | 68 | ### General assistance 69 | contact the forum at 70 | 71 | -------------------------------------------------------------------------------- /doc-files/Behaviors1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/Behaviors1.gif -------------------------------------------------------------------------------- /doc-files/Behaviors2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/Behaviors2.gif -------------------------------------------------------------------------------- /doc-files/Behaviors3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/Behaviors3.gif -------------------------------------------------------------------------------- /doc-files/Behaviors4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/Behaviors4.gif -------------------------------------------------------------------------------- /doc-files/Behaviors5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/Behaviors5.gif -------------------------------------------------------------------------------- /doc-files/Behaviors6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/Behaviors6.gif -------------------------------------------------------------------------------- /doc-files/Behaviors7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/Behaviors7.gif -------------------------------------------------------------------------------- /doc-files/Behaviors8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/Behaviors8.gif -------------------------------------------------------------------------------- /doc-files/Concepts1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/Concepts1.gif -------------------------------------------------------------------------------- /doc-files/Concepts2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/Concepts2.gif -------------------------------------------------------------------------------- /doc-files/DAG.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/DAG.gif -------------------------------------------------------------------------------- /doc-files/HelloUniverse.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | HelloUniverse 7 | 8 | 9 |

HelloUniverse: A Sample Java 10 | 3D Program

11 |

Here are code fragments from a simple program, HelloUniverse.java, 12 | that creates a cube and a RotationInterpolator behavior object that 13 | rotates the cube at a constant rate of pi/2 radians per second. The 14 | HelloUniverse class creates the branch graph 15 | that includes the cube and the RotationInterpolator behavior. It then 16 | adds this branch graph to the Locale object generated by the 17 | SimpleUniverse utility. 18 |

19 |


public class HelloUniverse ... {
public BranchGroup createSceneGraph() {
// Create the root of the branch graph
BranchGroup objRoot = new BranchGroup();

// Create the TransformGroup node and initialize it to the
// identity. Enable the TRANSFORM_WRITE capability so that
// our behavior code can modify it at run time. Add it to
// the root of the subgraph.
TransformGroup objTrans = new TransformGroup();
objTrans.setCapability(
TransformGroup.ALLOW_TRANSFORM_WRITE);
objRoot.addChild(objTrans);

// Create a simple Shape3D node; add it to the scene graph.
objTrans.addChild(new ColorCube(0.4));

// Create a new Behavior object that will perform the
// desired operation on the specified transform and add
// it into the scene graph.
Transform3D yAxis = new Transform3D();
Alpha rotationAlpha = new Alpha(-1, 4000);
RotationInterpolator rotator = new RotationInterpolator(
rotationAlpha, objTrans, yAxis,
0.0f, (float) Math.PI*2.0f);
BoundingSphere bounds =
new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
rotator.setSchedulingBounds(bounds);
objRoot.addChild(rotator);

// Have Java 3D perform optimizations on this scene graph.
objRoot.compile();

return objRoot;
}

public HelloUniverse() {
<set layout of container, construct canvas3d, add canvas3d>

// Create the scene; attach it to the virtual universe
BranchGroup scene = createSceneGraph();
SimpleUniverse u = new SimpleUniverse(canvas3d);
u.getViewingPlatform().setNominalViewingTransform();
u.addBranchGraph(scene);
}
}
20 | 21 | 22 | -------------------------------------------------------------------------------- /doc-files/Immediate1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/Immediate1.gif -------------------------------------------------------------------------------- /doc-files/SceneGraphSharing1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/SceneGraphSharing1.gif -------------------------------------------------------------------------------- /doc-files/SceneGraphSharing2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/SceneGraphSharing2.gif -------------------------------------------------------------------------------- /doc-files/SceneGraphSharing3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/SceneGraphSharing3.gif -------------------------------------------------------------------------------- /doc-files/SceneGraphSharing4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/SceneGraphSharing4.gif -------------------------------------------------------------------------------- /doc-files/SceneGraphSharing5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/SceneGraphSharing5.gif -------------------------------------------------------------------------------- /doc-files/ViewBranch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewBranch.gif -------------------------------------------------------------------------------- /doc-files/ViewModel1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel1.gif -------------------------------------------------------------------------------- /doc-files/ViewModel10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel10.gif -------------------------------------------------------------------------------- /doc-files/ViewModel11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel11.gif -------------------------------------------------------------------------------- /doc-files/ViewModel12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel12.gif -------------------------------------------------------------------------------- /doc-files/ViewModel13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel13.gif -------------------------------------------------------------------------------- /doc-files/ViewModel14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel14.gif -------------------------------------------------------------------------------- /doc-files/ViewModel2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel2.gif -------------------------------------------------------------------------------- /doc-files/ViewModel3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel3.gif -------------------------------------------------------------------------------- /doc-files/ViewModel4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel4.gif -------------------------------------------------------------------------------- /doc-files/ViewModel5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel5.gif -------------------------------------------------------------------------------- /doc-files/ViewModel6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel6.gif -------------------------------------------------------------------------------- /doc-files/ViewModel7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel7.gif -------------------------------------------------------------------------------- /doc-files/ViewModel8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel8.gif -------------------------------------------------------------------------------- /doc-files/ViewModel9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel9.gif -------------------------------------------------------------------------------- /doc-files/VirtualUniverse.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/VirtualUniverse.gif -------------------------------------------------------------------------------- /doc-files/intro.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/intro.gif -------------------------------------------------------------------------------- /docs/api-changes-1_6.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------ 2 | $RCSfile$ 3 | $Revision$ 4 | $Date$ 5 | ------------------------------------------------------------------------ 6 | This document conatains proposed API changes to the Java 3D 1.6 API 7 | that deviate from the 1.5 API. 8 | 9 | This file must be updated to record the addition or deprecation of any 10 | public or protected class, interface, field, constructor, or method to 11 | the Java 3D API. 12 | 13 | The one exception to this rule is that you don't need to update this 14 | file when adding a non-final (i.e., virtual) method to a class if that 15 | method--with exactly the same signature--already exists in a 16 | superclass. For example, adding a "toString" method to a j3d object 17 | doesn't require an entry in this file. Likewise, adding duplicateNode 18 | or cloneNode methods to Node subclasses doesn't require an entry in 19 | this file. 20 | 21 | No incompatible changes to the Java 3D 1.5 API are allowed. 22 | 23 | 24 | I. New/deprecated fields, constructors, methods 25 | 26 | 27 | --------------- 28 | New methods: 29 | public 30 | 31 | 32 | II. Reparented classes 33 | 34 | 35 | --------------- 36 | now extends (used to extend ) 37 | 38 | 39 | III. New classes and interfaces (in javax.media.j3d) 40 | 41 | 42 | IV. Deprecated classes and interfaces (in javax.media.j3d) 43 | 44 | -------------------------------------------------------------------------------- /docs/tutorial/j3d_tutorial_ch0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/docs/tutorial/j3d_tutorial_ch0.pdf -------------------------------------------------------------------------------- /docs/tutorial/j3d_tutorial_ch1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/docs/tutorial/j3d_tutorial_ch1.pdf -------------------------------------------------------------------------------- /docs/tutorial/j3d_tutorial_ch2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/docs/tutorial/j3d_tutorial_ch2.pdf -------------------------------------------------------------------------------- /docs/tutorial/j3d_tutorial_ch3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/docs/tutorial/j3d_tutorial_ch3.pdf -------------------------------------------------------------------------------- /docs/tutorial/j3d_tutorial_ch4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/docs/tutorial/j3d_tutorial_ch4.pdf -------------------------------------------------------------------------------- /docs/tutorial/j3d_tutorial_ch5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/docs/tutorial/j3d_tutorial_ch5.pdf -------------------------------------------------------------------------------- /docs/tutorial/j3d_tutorial_ch6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/docs/tutorial/j3d_tutorial_ch6.pdf -------------------------------------------------------------------------------- /docs/tutorial/j3d_tutorial_ch7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/docs/tutorial/j3d_tutorial_ch7.pdf -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/AmbientLightRetained.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | 30 | /** 31 | * An ambient light source object. 32 | */ 33 | 34 | class AmbientLightRetained extends LightRetained { 35 | 36 | AmbientLightRetained() { 37 | this.nodeType = NodeRetained.AMBIENTLIGHT; 38 | lightType = 1; 39 | localBounds = new BoundingBox((Bounds)null); 40 | } 41 | 42 | @Override 43 | void setLive(SetLiveState s) { 44 | super.setLive(s); 45 | J3dMessage createMessage = super.initMessage(7); 46 | VirtualUniverse.mc.processMessage(createMessage); 47 | } 48 | 49 | @Override 50 | void update(Context ctx, int lightSlot, double scale) { 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/AssertionFailureException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Indicates an assertion failure. 31 | */ 32 | 33 | class AssertionFailureException extends RuntimeException { 34 | 35 | /** 36 | * Create the exception object with default values. 37 | */ 38 | AssertionFailureException() { 39 | } 40 | 41 | /** 42 | * Create the exception object that outputs message. 43 | * @param str the message string to be output. 44 | */ 45 | AssertionFailureException(String str) { 46 | super(str); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/AudioDeviceEnumerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | import java.util.Iterator; 30 | import java.util.NoSuchElementException; 31 | 32 | /** 33 | * The class that enumerates all AudioDevices defined in the environment 34 | * 35 | * An AudioDeviceEnumerator generates the audio devices defined with the 36 | * execution environment of the currently running Java 3D application. 37 | */ 38 | 39 | class AudioDeviceEnumerator implements Iterator { 40 | 41 | boolean endOfList; // NOTE: list length always equals one or zero 42 | AudioDevice device; 43 | 44 | AudioDeviceEnumerator(PhysicalEnvironment physicalEnvironment) { 45 | device = physicalEnvironment.getAudioDevice(); 46 | if(device == null) 47 | endOfList = true; 48 | else 49 | endOfList = false; 50 | } 51 | 52 | void reset() { 53 | if(device != null) 54 | endOfList = false; 55 | } 56 | 57 | 58 | /** 59 | * Query that tells whether the enumerator has more elements 60 | * @return true if the enumerator has more elements, false otherwise 61 | */ 62 | @Override 63 | public boolean hasNext() { 64 | if(endOfList == false) 65 | return true; 66 | else 67 | return false; 68 | } 69 | 70 | /** 71 | * Return the next element in the enumerators 72 | * @return the next element in this enumerator 73 | */ 74 | @Override 75 | public AudioDevice next() { 76 | if (this.hasNext()) { 77 | endOfList = true; 78 | return device; 79 | } else { 80 | throw new NoSuchElementException(J3dI18N.getString("AudioDeviceEnumerator0")); 81 | } 82 | } 83 | 84 | @Override 85 | public void remove() 86 | { 87 | throw new UnsupportedOperationException(); 88 | 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/AutoOffScreenCanvas3D.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Harvey Harrison 3 | * 4 | * This code is free software; you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 2 only, as 6 | * published by the Free Software Foundation. Sun designates this 7 | * particular file as subject to the "Classpath" exception as provided 8 | * by Sun in the LICENSE file that accompanied this code. 9 | * 10 | * This code is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 | * version 2 for more details (a copy is included in the LICENSE file that 14 | * accompanied this code). 15 | */ 16 | package org.jogamp.java3d; 17 | 18 | /** 19 | * An interface used to tag Canavs3d subclasses as being offsceen. 20 | */ 21 | public interface AutoOffScreenCanvas3D {} 22 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/BHLeafInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | interface BHLeafInterface { 30 | 31 | abstract BoundingBox computeBoundingHull(); 32 | 33 | abstract boolean isEnable(); 34 | 35 | abstract boolean isEnable(int visibilityPolicy); 36 | 37 | // Can't use getLocale, it is used by BranchGroupRetained 38 | abstract Locale getLocale2(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/BHLeafNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | 30 | class BHLeafNode extends BHNode { 31 | 32 | BHLeafInterface leafIF; 33 | 34 | BHLeafNode() { 35 | super(); 36 | nodeType = BH_TYPE_LEAF; 37 | leafIF = null; 38 | } 39 | 40 | BHLeafNode(BHNode parent) { 41 | super(parent); 42 | nodeType = BH_TYPE_LEAF; 43 | } 44 | 45 | BHLeafNode(BHLeafInterface lIF) { 46 | super(); 47 | nodeType = BH_TYPE_LEAF; 48 | leafIF = lIF; 49 | } 50 | 51 | BHLeafNode(BHNode parent, BHLeafInterface lIF) { 52 | super(parent); 53 | leafIF = lIF; 54 | nodeType = BH_TYPE_LEAF; 55 | } 56 | 57 | BHLeafNode(BHNode parent, BoundingBox bHull) { 58 | super(parent, bHull); 59 | nodeType = BH_TYPE_LEAF; 60 | } 61 | 62 | BHLeafNode(BHNode parent, BHLeafInterface lIF, BoundingBox bHull) { 63 | super(parent, bHull); 64 | leafIF = lIF; 65 | nodeType = BH_TYPE_LEAF; 66 | } 67 | 68 | @Override 69 | void computeBoundingHull() { 70 | bHull = leafIF.computeBoundingHull(); 71 | } 72 | 73 | @Override 74 | void updateMarkedBoundingHull() { 75 | 76 | if(mark == false) 77 | return; 78 | 79 | computeBoundingHull(); 80 | mark = false; 81 | } 82 | 83 | boolean isEnable() { 84 | return leafIF.isEnable(); 85 | } 86 | 87 | boolean isEnable(int vis) { 88 | return leafIF.isEnable(vis); 89 | } 90 | 91 | Locale getLocale() { 92 | return leafIF.getLocale2(); 93 | } 94 | 95 | @Override 96 | void destroyTree(BHNode[] bhArr, int[] index) { 97 | if(bhArr.length <= index[0]) { 98 | // System.err.println("BHLeafNode : Problem bhArr overflow!!!"); 99 | return; 100 | } 101 | 102 | parent = null; 103 | bhArr[index[0]] = this; 104 | index[0]++; 105 | } 106 | 107 | } 108 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/BackgroundSoundRetained.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * BackgroundSound is a class for sounds that are not spatially rendered. 31 | * These sounds are simply added to the stereo sound mix without modification. 32 | * These could be used to play mono or stereo music, or ambient sound effects. 33 | */ 34 | class BackgroundSoundRetained extends SoundRetained { 35 | 36 | BackgroundSoundRetained() { 37 | this.nodeType = NodeRetained.BACKGROUNDSOUND; 38 | localBounds = new BoundingBox((Bounds)null); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/BadTransformException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Indicates an attempt to use a Tranform3D object that is 31 | * inappropriate for the object in which it is being used. 32 | * For example: 33 | *
    34 | *
  • 35 | * Transforms that are used in the scene graph, within a TransformGroup 36 | * node, must be affine. They may optionally contain a non-uniform 37 | * scale and/or a shear, subject to other listed restrictions. 38 | *
  • 39 | * All transforms in the TransformGroup nodes above a ViewPlatform 40 | * object must be congruent. This ensures that the Vworld coordinates to 41 | * ViewPlatform coordinates transform is angle and length-preserving with 42 | * no shear and only uniform scale. 43 | *
  • 44 | * Most viewing transforms other than those in the scene graph can 45 | * only contain translation and rotation. 46 | *
  • 47 | * The projection transform is allowed to be non-affine, but it 48 | * must either be a single point perspective projection or a parallel 49 | * projection. 50 | *
51 | */ 52 | public class BadTransformException extends RuntimeException{ 53 | 54 | /** 55 | * Create the exception object with default values. 56 | */ 57 | public BadTransformException(){ 58 | } 59 | 60 | /** 61 | * Create the exception object that outputs message. 62 | * @param str the message string to be output. 63 | */ 64 | public BadTransformException(String str){ 65 | 66 | super(str); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/CapabilityNotSetException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Indicates an access to a live or 31 | * compiled Scene Graph object without the required capability 32 | * set. 33 | */ 34 | public class CapabilityNotSetException extends RestrictedAccessException { 35 | 36 | /** 37 | * Create the exception object with default values. 38 | */ 39 | public CapabilityNotSetException(){ 40 | } 41 | 42 | /** 43 | * Create the exception object that outputs message. 44 | * @param str the message string to be output. 45 | */ 46 | public CapabilityNotSetException(String str){ 47 | 48 | super(str); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/Context.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Tagging interface for graphics context objects. The rendering pipelines 31 | * will define concrete classes that implement this interface. All code that 32 | * uses the tagged objects will be in the pipelines. 33 | */ 34 | interface Context { 35 | // No methods or constants defined at this time 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/DanglingReferenceException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * During a cloneTree call an updated reference was requested 31 | * for a node that did not get cloned. This happens when a sub-graph is 32 | * duplicated via cloneTree and has at least one Leaf node 33 | * that contains a reference to a Node that has no corresponding node in 34 | * the cloned sub-graph. This results in two Leaf nodes wanting to share 35 | * access to the same Node. 36 | *

37 | * If dangling references are to be allowed during the cloneTree call, 38 | * cloneTree should be called with the 39 | * allowDanglingReferences parameter set to true. 40 | * @see Node#cloneTree 41 | */ 42 | public class DanglingReferenceException extends RuntimeException { 43 | 44 | /** 45 | * Create the exception object with default values. 46 | */ 47 | public DanglingReferenceException() { 48 | } 49 | 50 | /** 51 | * Create the exception object that outputs message. 52 | * @param str the message string to be output. 53 | */ 54 | public DanglingReferenceException(String str) { 55 | super(str); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/DecalGroupRetained.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | class DecalGroupRetained extends OrderedGroupRetained { 30 | 31 | DecalGroupRetained() { 32 | this.nodeType = NodeRetained.DECALGROUP; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/DefaultRenderMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * The RenderMethod interface is used to create various ways to render 31 | * different geometries. 32 | */ 33 | 34 | class DefaultRenderMethod implements RenderMethod { 35 | /** 36 | * The actual rendering code for this RenderMethod 37 | */ 38 | @Override 39 | public boolean render(RenderMolecule rm, Canvas3D cv, 40 | RenderAtomListInfo ra, int dirtyBits) { 41 | 42 | boolean isVisible = false; // True if any of the RAs is visible. 43 | 44 | while (ra != null) { 45 | if (cv.ra == ra.renderAtom) { 46 | if (cv.raIsVisible) { 47 | cv.updateState(dirtyBits); 48 | ra.geometry().execute(cv, ra.renderAtom, 49 | rm.isNonUniformScale, 50 | rm.useAlpha, rm.alpha, 51 | cv.screen.screen, 52 | rm.textureBin.attributeBin. 53 | ignoreVertexColors); 54 | isVisible = true; 55 | } 56 | } 57 | else { 58 | if (!VirtualUniverse.mc.viewFrustumCulling || 59 | ra.renderAtom.localeVwcBounds.intersect(cv.viewFrustum)) { 60 | cv.raIsVisible = true; 61 | cv.updateState(dirtyBits); 62 | ra.geometry().execute(cv, ra.renderAtom, rm.isNonUniformScale, 63 | rm.useAlpha, rm.alpha, 64 | cv.screen.screen, 65 | rm.textureBin.attributeBin. 66 | ignoreVertexColors); 67 | isVisible = true; 68 | } 69 | else { 70 | cv.raIsVisible = false; 71 | } 72 | cv.ra = ra.renderAtom; 73 | } 74 | ra = ra.next; 75 | } 76 | 77 | return isVisible; 78 | 79 | } 80 | 81 | 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/DepthComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Abstract base class that defines a 2D array of depth (Z) values. 31 | */ 32 | 33 | public abstract class DepthComponent extends NodeComponent { 34 | /** 35 | * Specifies that this DepthComponent object allows reading its 36 | * size component information (width and height). 37 | */ 38 | public static final int 39 | ALLOW_SIZE_READ = CapabilityBits.DEPTH_COMPONENT_ALLOW_SIZE_READ; 40 | 41 | /** 42 | * Specifies that this DepthComponent object allows reading its 43 | * depth data component information. 44 | */ 45 | public static final int 46 | ALLOW_DATA_READ = CapabilityBits.DEPTH_COMPONENT_ALLOW_DATA_READ; 47 | 48 | // Array for setting default read capabilities 49 | private static final int[] readCapabilities = { 50 | ALLOW_SIZE_READ, 51 | ALLOW_DATA_READ 52 | }; 53 | 54 | /** 55 | * default constructor 56 | */ 57 | DepthComponent() { 58 | // set default read capabilities 59 | setDefaultReadCapabilities(readCapabilities); 60 | } 61 | 62 | /** 63 | * Retrieves the width of this depth component object. 64 | * @return the width of the array of depth values 65 | * @exception CapabilityNotSetException if appropriate capability is 66 | * not set and this object is part of live or compiled scene graph 67 | */ 68 | public int getWidth() { 69 | if (isLiveOrCompiled()) 70 | if (!this.getCapability(ALLOW_SIZE_READ)) 71 | throw new CapabilityNotSetException(J3dI18N.getString("DepthComponent0")); 72 | return ((DepthComponentRetained)this.retained).getWidth(); 73 | } 74 | 75 | /** 76 | * Retrieves the height of this depth component object. 77 | * @return the height of the array of depth values 78 | * @exception CapabilityNotSetException if appropriate capability is 79 | * not set and this object is part of live or compiled scene graph 80 | */ 81 | public int getHeight() { 82 | if (isLiveOrCompiled()) 83 | if (!this.getCapability(ALLOW_SIZE_READ)) 84 | throw new CapabilityNotSetException(J3dI18N.getString("DepthComponent0")); 85 | return ((DepthComponentRetained)this.retained).getHeight(); 86 | } 87 | 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/DepthComponentFloatRetained.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | 30 | /** 31 | * A 2D array of depth (Z) values in floating point format in the range [0,1]. 32 | * A value of 0.0 indicates the closest Z value to the user while a value of 33 | * 1.0 indicates the farthest Z value. 34 | */ 35 | 36 | class DepthComponentFloatRetained extends DepthComponentRetained { 37 | float depthData[]; 38 | 39 | /** 40 | * Constructs a new floating-point depth (z-buffer) component object with 41 | * the specified width and height. 42 | * @param width the width of the array of depth values 43 | * @param height the height of the array of depth values 44 | */ 45 | void initialize(int width, int height) { 46 | type = DEPTH_COMPONENT_TYPE_FLOAT; 47 | depthData = new float[width * height]; 48 | this.width = width; 49 | this.height = height; 50 | } 51 | 52 | /** 53 | * Copies the specified depth data to this object. 54 | * @param depthData array of floats containing the depth data 55 | */ 56 | void setDepthData(float[] depthData) { 57 | int i; 58 | for (i = 0; i < depthData.length; i++) 59 | this.depthData[i] = depthData[i]; 60 | } 61 | 62 | 63 | /** 64 | * Copies the depth data from this object to the specified array. 65 | * @param depthData array of floats that will receive a copy of 66 | * the depth data 67 | */ 68 | void getDepthData(float[] depthData) { 69 | int i; 70 | for (i = 0; i < this.depthData.length; i++) 71 | depthData[i] = this.depthData[i]; 72 | } 73 | 74 | /* 75 | * retrieve depth data from input buffer 76 | */ 77 | final void retrieveDepth(float[] buf, int wRead, int hRead) { 78 | int srcOffset, dstOffset, i; 79 | 80 | // Yup -> Ydown 81 | for (srcOffset = (hRead - 1) * wRead, dstOffset = 0, 82 | i = 0; i < hRead; i++, 83 | srcOffset -= wRead, dstOffset += width) { 84 | 85 | System.arraycopy(buf, srcOffset, depthData, dstOffset, wRead); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/DepthComponentIntRetained.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | 30 | /** 31 | * A 2D array of depth (Z) values in integer format. Values are in the 32 | * range [0,(2**N)-1], where N is the pixel depth of the Z buffer. 33 | */ 34 | 35 | class DepthComponentIntRetained extends DepthComponentRetained { 36 | int depthData[]; 37 | 38 | /** 39 | * Constructs a new integer depth (z-buffer) component object with the 40 | * specified width and height. 41 | * @param width the width of the array of depth values 42 | * @param height the height of the array of depth values 43 | */ 44 | void initialize(int width, int height) { 45 | type = DEPTH_COMPONENT_TYPE_INT; 46 | depthData = new int[width * height]; 47 | this.width = width; 48 | this.height = height; 49 | } 50 | 51 | /** 52 | * Copies the specified depth data to this object. 53 | * @param depthData array of ints containing the depth data 54 | */ 55 | void setDepthData(int[] depthData) { 56 | int i; 57 | for (i = 0; i < depthData.length; i++) 58 | this.depthData[i] = depthData[i]; 59 | } 60 | 61 | 62 | /** 63 | * Copies the depth data from this object to the specified array. 64 | * @param depthData array of ints that will receive a copy of 65 | * the depth data 66 | */ 67 | void getDepthData(int[] depthData) { 68 | int i; 69 | 70 | for (i = 0; i < this.depthData.length; i++) 71 | depthData[i] = this.depthData[i]; 72 | } 73 | 74 | /** 75 | * retrieve depth data from input buffer 76 | */ 77 | final void retrieveDepth(int[] buf, int wRead, int hRead) { 78 | int srcOffset, dstOffset, i; 79 | 80 | // Yup -> Ydown 81 | for (srcOffset = (hRead - 1) * wRead, dstOffset = 0, 82 | i = 0; i < hRead; i++, 83 | srcOffset -= wRead, dstOffset += width) { 84 | 85 | System.arraycopy(buf, srcOffset, depthData, dstOffset, wRead); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/DepthComponentNativeRetained.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * A 2D array of depth (Z) values stored in the most efficient format for a 31 | * particular device. Values are not accessible by the user and may only be 32 | * used to read the Z values and subsequently write them back. 33 | */ 34 | 35 | class DepthComponentNativeRetained extends DepthComponentRetained { 36 | // Change this to whatever native format is best... 37 | int depthData[]; 38 | 39 | /** 40 | * Constructs a new native depth (z-buffer) component object with the 41 | * specified width and height. 42 | * @param width the width of the array of depth values 43 | * @param height the height of the array of depth values 44 | */ 45 | void initialize(int width, int height) { 46 | type = DEPTH_COMPONENT_TYPE_NATIVE; 47 | depthData = new int[width * height]; 48 | this.width = width; 49 | this.height = height; 50 | } 51 | 52 | /** 53 | * Copies the depth data from this object to the specified array. 54 | * @param depthData array of ints that will receive a copy of 55 | * the depth data 56 | */ 57 | void getDepthData(int[] depthData) { 58 | int i; 59 | for (i = 0; i < this.depthData.length; i++) 60 | depthData[i] = this.depthData[i]; 61 | } 62 | 63 | /** 64 | * retrieve depth data from input buffer 65 | */ 66 | final void retrieveDepth(int[] buf, int wRead, int hRead) { 67 | int srcOffset, dstOffset, i; 68 | 69 | // Yup -> Ydown 70 | for (srcOffset = (hRead - 1) * wRead, dstOffset = 0, 71 | i = 0; i < hRead; i++, 72 | srcOffset -= wRead, dstOffset += width) { 73 | 74 | System.arraycopy(buf, srcOffset, depthData, dstOffset, wRead); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/DepthComponentRetained.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Abstract base class that defines a 2D array of depth (Z) values. 31 | */ 32 | 33 | 34 | abstract class DepthComponentRetained extends NodeComponentRetained { 35 | // depth component types 36 | static final int DEPTH_COMPONENT_TYPE_INT = 1; 37 | static final int DEPTH_COMPONENT_TYPE_FLOAT = 2; 38 | static final int DEPTH_COMPONENT_TYPE_NATIVE = DEPTH_COMPONENT_TYPE_INT; 39 | 40 | 41 | // Width and height of DepthComponent---set by subclasses 42 | int width; 43 | int height; 44 | int type; 45 | 46 | /** 47 | * Retrieves the width of this depth component object 48 | * @return the width of the array of depth values 49 | */ 50 | int getWidth() { 51 | return width; 52 | } 53 | 54 | /** 55 | * Retrieves the height of this depth component object 56 | * @return the height of the array of depth values 57 | */ 58 | int getHeight() { 59 | return height; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/Drawable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Tagging interface for drawable (window) objects. The rendering pipelines 31 | * will define concrete classes that implement this interface. All code that 32 | * uses the tagged objects will be in the pipelines. 33 | */ 34 | interface Drawable { 35 | // No methods or constants defined at this time 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/DrawingSurfaceObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * The DrawingSurfaceObject class is used to manage native drawing surface 31 | */ 32 | 33 | abstract class DrawingSurfaceObject extends Object { 34 | 35 | Canvas3D canvas; 36 | boolean gotDsiLock = false; 37 | boolean onScreen; 38 | 39 | abstract boolean renderLock(); 40 | abstract void unLock(); 41 | abstract void getDrawingSurfaceObjectInfo(); 42 | abstract void invalidate(); 43 | 44 | DrawingSurfaceObject(Canvas3D cv) { 45 | canvas = cv; 46 | onScreen = !cv.offScreen; 47 | } 48 | 49 | synchronized boolean isLocked() { 50 | return gotDsiLock; 51 | } 52 | 53 | synchronized void contextValidated() { 54 | canvas.validCtx = true; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/FreeListManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | 30 | class FreeListManager { 31 | 32 | private static final boolean DEBUG = false; 33 | 34 | // constants that represent the freelists managed by the Manager 35 | static final int DISPLAYLIST = 0; 36 | 37 | private static int maxFreeListNum = 0; 38 | 39 | // what list we are going to shrink next 40 | private static int currlist = 0; 41 | 42 | static MemoryFreeList[] freelist = null; 43 | 44 | static void createFreeLists() { 45 | maxFreeListNum = 0; 46 | freelist = new MemoryFreeList[maxFreeListNum+1]; 47 | freelist[DISPLAYLIST] = new IntegerFreeList(); 48 | } 49 | 50 | // see if the current list can be shrunk 51 | static void manageLists() { 52 | // System.err.println("manageLists"); 53 | if (freelist[currlist] != null) { 54 | freelist[currlist].shrink(); 55 | } 56 | 57 | currlist++; 58 | if (currlist > maxFreeListNum) currlist = 0; 59 | } 60 | 61 | // return the freelist specified by the list param 62 | static MemoryFreeList getFreeList(int list) { 63 | if (list < 0 || list > maxFreeListNum) { 64 | if (DEBUG) System.err.println("illegal list"); 65 | return null; 66 | } 67 | else { 68 | return freelist[list]; 69 | } 70 | } 71 | 72 | static Object getObject(int listId) { 73 | return freelist[listId].getObject(); 74 | } 75 | 76 | static void freeObject(int listId, Object obj) { 77 | freelist[listId].add(obj); 78 | } 79 | 80 | static void clearList(int listId) { 81 | freelist[listId].clear(); 82 | } 83 | 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/GeneralizedStripFlags.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * A class which implements GeneralizedStripFlags provides the means to access 31 | * the vertex replace code flags associated with each vertex of a generalized 32 | * strip. This allows a flexible representation of generalized strips for 33 | * various classes and makes it possible to provide a common subset of static 34 | * methods which operate only on their topology. 35 | * 36 | * @see GeneralizedStrip 37 | * @see GeneralizedVertexList 38 | */ 39 | @Deprecated 40 | interface GeneralizedStripFlags { 41 | 42 | /** 43 | * This flag indicates that a vertex starts a new strip with clockwise 44 | * winding. 45 | */ 46 | static final int RESTART_CW = 0 ; 47 | 48 | /** 49 | * This flag indicates that a vertex starts a new strip with 50 | * counter-clockwise winding. 51 | */ 52 | static final int RESTART_CCW = 1 ; 53 | 54 | /** 55 | * This flag indicates that the next triangle in the strip is defined by 56 | * replacing the middle vertex of the previous triangle in the strip. 57 | */ 58 | static final int REPLACE_MIDDLE = 2 ; 59 | 60 | /** 61 | * This flag indicates that the next triangle in the strip is defined by 62 | * replacing the oldest vertex of the previous triangle in the strip. 63 | */ 64 | static final int REPLACE_OLDEST = 3 ; 65 | 66 | /** 67 | * This constant is used to indicate that triangles with clockwise vertex 68 | * winding are front facing. 69 | */ 70 | static final int FRONTFACE_CW = 0 ; 71 | 72 | /** 73 | * This constant is used to indicate that triangles with counter-clockwise 74 | * vertex winding are front facing. 75 | */ 76 | static final int FRONTFACE_CCW = 1 ; 77 | 78 | /** 79 | * Return the number of flags. This should be the same as the number of 80 | * vertices in the generalized strip. 81 | */ 82 | int getFlagCount() ; 83 | 84 | /** 85 | * Return the flag associated with the vertex at the specified index. 86 | */ 87 | int getFlag(int index) ; 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/Geometry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Geometry is an abstract class that specifies the geometry 31 | * component information required by a Shape3D node. Geometry objects 32 | * describe both the geometry and topology of the Shape3D nodes that 33 | * reference them. Geometry objects consist of four generic geometric 34 | * types:

35 | *

  • Compressed Geometry
  • 36 | *
  • GeometryArray
  • 37 | *
  • Raster
  • 38 | *
  • Text3D
  • 39 | *

40 | * Each of these geometric types defines a visible object or set of 41 | * objects. A Geometry object is used as a component object of a Shape3D 42 | * leaf node. 43 | * 44 | */ 45 | 46 | public abstract class Geometry extends NodeComponent { 47 | 48 | /** 49 | * Specifies that this Geometry allows intersect operation. This 50 | * capability bit is set (true) by default for all Geometry objects. 51 | */ 52 | public static final int 53 | ALLOW_INTERSECT = CapabilityBits.GEOMETRY_ALLOW_INTERSECT; 54 | 55 | // Array for setting default read capabilities 56 | private static final int[] readCapabilities = { 57 | ALLOW_INTERSECT 58 | }; 59 | 60 | /** 61 | * Constructs a new Geometry object. 62 | */ 63 | public Geometry() { 64 | // set default read capabilities 65 | setDefaultReadCapabilities(readCapabilities); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/GeometryLock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | 30 | class GeometryLock { 31 | 32 | // Current thread holding the lock 33 | Thread threadId = null; 34 | 35 | // Whether the lock is currently owned 36 | boolean lockOwned = false; 37 | 38 | // Count > 1 , if there is nested lock by the same thread 39 | int count = 0; 40 | 41 | // Number of outstanding threads waiting for the lock 42 | int waiting = 0; 43 | 44 | 45 | synchronized void getLock() { 46 | Thread curThread = Thread.currentThread(); 47 | // If the thread already has the lock, incr 48 | // a count and return 49 | if (threadId == curThread) { 50 | count++; 51 | return; 52 | } 53 | // Otherwise, wait until the lock is released 54 | while (lockOwned) { 55 | try { 56 | waiting++; 57 | wait(); 58 | } catch (InterruptedException e) { 59 | System.err.println(e); 60 | } 61 | waiting--; 62 | } 63 | count++; 64 | // Acquire the lock 65 | lockOwned = true; 66 | threadId = curThread; 67 | } 68 | 69 | synchronized void unLock() { 70 | Thread curThread = Thread.currentThread(); 71 | if (threadId == curThread) { 72 | // If the lock count > 0, then return 73 | if (--count > 0) { 74 | return; 75 | } 76 | lockOwned = false; 77 | threadId = null; 78 | if (waiting > 0) { 79 | notify(); 80 | } 81 | } 82 | 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/GeometryService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 JogAmp Community. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. The JogAmp Community designates 8 | * this particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * The views and conclusions contained in the software and documentation are those 18 | * of the authors and should not be interpreted as representing official policies, 19 | * either expressed or implied, of the JogAmp Community. 20 | * 21 | */ 22 | 23 | package org.jogamp.java3d; 24 | 25 | import java.util.ArrayList; 26 | 27 | import org.jogamp.vecmath.Point3f; 28 | 29 | /** 30 | * A service interface for certain geometric operations that are not available 31 | * in core Java 3D. 32 | *

33 | * In particular, the {@code j3d-core-utils} project provides additional 34 | * functionality under a different license, which is needed in some 35 | * circumstances by core Java 3D. Thus, historically, these two projects have 36 | * been co-dependent. This interface breaks the circular dependency by using 37 | * Java's service discovery mechanism: if {@code j3d-core-utils} is present on 38 | * the classpath, its {@code GeometryServiceImpl} will provide the functionality 39 | * defined here. Or if not (i.e., no suitable {@code GeometryService} 40 | * implementation can be discovered and instantiated}), then the Java3D core 41 | * will fail as gracefully as possible. 42 | *

43 | * 44 | * @see Font3D#triangulateGlyphs 45 | */ 46 | public interface GeometryService { 47 | 48 | /** 49 | * Loops through each island, calling triangulator once per island. Combines 50 | * triangle data for all islands together in one object. 51 | * 52 | * @param islandCounts TODO 53 | * @param outVerts TODO 54 | * @param contourCounts TODO 55 | * @param triangData TODO 56 | * @return total vertex count of the combined array 57 | */ 58 | int triangulateIslands(int[][] islandCounts, Point3f[][] outVerts, 59 | int[] contourCounts, ArrayList triangData); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/GeometryUpdater.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | 30 | /** 31 | * The GeometryUpdater interface is used in updating geometry data 32 | * that is accessed by reference from a live or compiled GeometryArray 33 | * object. Applications that wish to modify such data must define a 34 | * class that implements this interface. An instance of that class is 35 | * then passed to the updateData method of the 36 | * GeometryArray object to be modified. 37 | * 38 | * @since Java 3D 1.2 39 | */ 40 | 41 | public interface GeometryUpdater { 42 | /** 43 | * Updates geometry data that is accessed by reference. 44 | * This method is called by the updateData method of a 45 | * GeometryArray object to effect 46 | * safe updates to vertex data that 47 | * is referenced by that object. Applications that wish to modify 48 | * such data must implement this method and perform all updates 49 | * within it. 50 | *
51 | * NOTE: Applications should not call this method directly. 52 | * 53 | * @param geometry the Geometry object being updated. 54 | * @see GeometryArray#updateData 55 | */ 56 | public void updateData(Geometry geometry); 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/GraphStructureChangeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Listener interface for monitoring structural changes to live scene 31 | * graphs. BranchGroup additions, removals and moves are reported. 32 | * 33 | * @see VirtualUniverse#addGraphStructureChangeListener 34 | * 35 | * @since Java 3D 1.4 36 | */ 37 | public interface GraphStructureChangeListener { 38 | /** 39 | * Invoked when a branch group is added. 40 | * Called just before the child is added to the parent. 41 | * Parent can be either a BranchGroup or a Locale. 42 | * 43 | * @param parent the parent of the child being added 44 | * @param child the child being added 45 | */ 46 | public void branchGroupAdded(Object parent, BranchGroup child); 47 | 48 | /** 49 | * Invoked when a branch group is removed. 50 | * Called just after the child has been removed from the parent. 51 | * Parent can be either a BranchGroup or a Locale. 52 | * 53 | * @param parent the parent of the child being added 54 | * @param child the child being added 55 | */ 56 | public void branchGroupRemoved(Object parent, BranchGroup child); 57 | 58 | /** 59 | * Invoked when a branch group is moved. 60 | * Called after a child has been moved to it's new parent. This call differs 61 | * from the other methods in that the child is live when this method is called. 62 | * 63 | * @param oldParent the original parent of the child being moved 64 | * @param newParent the new parent of the child being moved 65 | * @param child the child being moved 66 | */ 67 | public void branchGroupMoved(Object oldParent, Object newParent, BranchGroup child); 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/GraphicsConfigInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Container for the GraphicsTemplate3D and other private data about a selected 31 | * GraphicsConfiguration. An instance of this class is created along with an 32 | * instance of GrahpicsConfiguration, whenever getBestConfiguration is called. 33 | */ 34 | class GraphicsConfigInfo { 35 | private GraphicsConfigTemplate3D graphicsConfigTemplate3D = null; 36 | private Object privateData = null; 37 | 38 | GraphicsConfigInfo(GraphicsConfigTemplate3D graphicsConfigTemplate3D) { 39 | setGraphicsConfigTemplate3D(graphicsConfigTemplate3D); 40 | } 41 | 42 | GraphicsConfigTemplate3D getGraphicsConfigTemplate3D() { 43 | return graphicsConfigTemplate3D; 44 | } 45 | 46 | void setGraphicsConfigTemplate3D(GraphicsConfigTemplate3D graphicsConfigTemplate3D) { 47 | this.graphicsConfigTemplate3D = graphicsConfigTemplate3D; 48 | } 49 | 50 | Object getPrivateData() { 51 | return privateData; 52 | } 53 | 54 | void setPrivateData(Object privateData) { 55 | this.privateData = privateData; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/IllegalRenderingStateException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Indicates an illegal state for rendering. This is typically some sort of 31 | * resource or graphics device error encountered during rendering. 32 | */ 33 | public class IllegalRenderingStateException extends IllegalStateException { 34 | 35 | /** 36 | * Create the exception object with default values. 37 | */ 38 | public IllegalRenderingStateException(){ 39 | } 40 | 41 | /** 42 | * Create the exception object that outputs message. 43 | * @param str the message string to be output. 44 | */ 45 | public IllegalRenderingStateException(String str){ 46 | super(str); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/IllegalSceneGraphException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Indicates an illegal Java 3D scene graph. 31 | * For example, the following is illegal: 32 | *
    33 | *
  • A ViewPlatform node under a ViewSpecificGroup
  • 34 | *
35 | * 36 | * @since Java 3D 1.3 37 | */ 38 | 39 | public class IllegalSceneGraphException extends RuntimeException { 40 | 41 | /** 42 | * Create the exception object with default values. 43 | */ 44 | public IllegalSceneGraphException() { 45 | } 46 | 47 | /** 48 | * Create the exception object that outputs message. 49 | * @param str the message string to be output. 50 | */ 51 | public IllegalSceneGraphException(String str) { 52 | super(str); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/IllegalSharingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Indicates an illegal attempt to share a scene graph object. For example, 31 | * the following are illegal: 32 | *
    33 | *
  • referencing a shared subgraph in more than one virtual universe
  • 34 | *
  • using the same node both in the scene graph and in an 35 | * immediate mode graphics context
  • 36 | *
  • including any of the following unsupported types of leaf node within a shared subgraph:
  • 37 | *
      38 | *
    • AlternateAppearance
    • 39 | *
    • Background
    • 40 | *
    • Behavior
    • 41 | *
    • BoundingLeaf
    • 42 | *
    • Clip
    • 43 | *
    • Fog
    • 44 | *
    • ModelClip
    • 45 | *
    • Soundscape
    • 46 | *
    • ViewPlatform
    • 47 | *
    48 | *
  • referencing a BranchGroup node in more than one of the following 49 | * ways:
  • 50 | *
      51 | *
    • attaching it to a (single) Locale
    • 52 | *
    • adding it as a child of a Group Node within the scene graph
    • 53 | *
    • referencing it from a (single) Background Leaf Node as 54 | * background geometry
    • 55 | *
    56 | *
57 | */ 58 | public class IllegalSharingException extends IllegalSceneGraphException { 59 | 60 | /** 61 | * Create the exception object with default values. 62 | */ 63 | public IllegalSharingException() { 64 | } 65 | 66 | /** 67 | * Create the exception object that outputs message. 68 | * @param str the message string to be output. 69 | */ 70 | public IllegalSharingException(String str) { 71 | super(str); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/ImageComponentUpdateInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Image Component update information for the users 31 | */ 32 | class ImageComponentUpdateInfo extends Object { 33 | 34 | int x = 0; 35 | int y = 0; 36 | int z = 0; 37 | int width = 0; 38 | int height = 0; 39 | int updateMask = 0; // which resources need to be updated 40 | // canvas or renderer 41 | boolean entireImage = false;// true if the entire image needs to be updated 42 | // then none of the dimension info is to be 43 | // applied. 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/IndexedObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Class used for IndexedUnorderedList 31 | */ 32 | 33 | abstract class IndexedObject extends Object { 34 | 35 | /** 36 | * A 2D array listIdx[3][len] is used. 37 | * The entry listIdx[0][], listIdx[0][1] is used for each VirtualUniverse. 38 | * The entry listIdx[2][0] is used for index to which one to use. 39 | * 40 | * This is used to handle the case the Node Object move from 41 | * one VirtualUniverse A to another VirtualUniverse B. 42 | * It is possible that another Structures in B may get the add 43 | * message first before the Structures in A get the remove 44 | * message to clear the entry. This cause MT problem. So a 45 | * 2D array is used to resolve it. 46 | */ 47 | int[][] listIdx; 48 | 49 | abstract VirtualUniverse getVirtualUniverse(); 50 | 51 | synchronized int getIdxUsed(VirtualUniverse u) { 52 | int idx = listIdx[2][0]; 53 | if (u == getVirtualUniverse()) { 54 | return idx; 55 | } 56 | return (idx == 0 ? 1 : 0); 57 | } 58 | 59 | void incIdxUsed() { 60 | if (listIdx[2][0] == 0) { 61 | listIdx[2][0] = 1; 62 | } else { 63 | listIdx[2][0] = 0; 64 | } 65 | } 66 | } 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/IntegerFreeList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | class IntegerFreeList extends MemoryFreeList { 30 | 31 | int count = 0; 32 | 33 | // default the initial count to 1 34 | IntegerFreeList() { 35 | super("java.lang.Integer"); 36 | } 37 | 38 | // sets up an initial count and an initial capacity for the freelist 39 | IntegerFreeList(int initialCount, int initCapacity) { 40 | super("java.lang.Integer", initCapacity); 41 | count = initialCount; 42 | } 43 | 44 | @Override 45 | synchronized Object getObject() { 46 | if (size > 0) return super.removeLastElement(); 47 | else return new Integer(++count); 48 | } 49 | 50 | @Override 51 | public synchronized void clear() { 52 | super.clear(); 53 | count = 0; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/J3dHash.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Harvey Harrison 3 | * 4 | * This code is free software; you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 2 only, as 6 | * published by the Free Software Foundation. Sun designates this 7 | * particular file as subject to the "Classpath" exception as provided 8 | * by Sun in the LICENSE file that accompanied this code. 9 | * 10 | * This code is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 | * version 2 for more details (a copy is included in the LICENSE file that 14 | * accompanied this code). 15 | */ 16 | package org.jogamp.java3d; 17 | 18 | /** 19 | * A Utility class wrapping the approach used to hash double values in Java3D 20 | */ 21 | class J3dHash { 22 | 23 | // prevent an instance from actually being created 24 | private J3dHash() {} 25 | 26 | /** 27 | * Mix the given double into the provided long hash. 28 | */ 29 | static final long mixDoubleBits(long hash, double d) { 30 | hash *= 31L; 31 | // Treat 0.0d and -0.0d the same (all zero bits) 32 | if (d == 0.0d) 33 | return hash; 34 | 35 | return hash + Double.doubleToLongBits(d); 36 | } 37 | 38 | /** 39 | * Return an integer hash from a long by mixing it with itself. 40 | */ 41 | static final int finish(long hash) { 42 | return (int)(hash ^ (hash >> 32)); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/J3dI18N.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | import java.util.MissingResourceException; 30 | import java.util.ResourceBundle; 31 | 32 | 33 | class J3dI18N { 34 | static String getString(String key) { 35 | String s; 36 | try { 37 | s = ResourceBundle.getBundle("org.jogamp.java3d.ExceptionStrings").getString(key); 38 | } 39 | catch (MissingResourceException e) { 40 | System.err.println("J3dI18N: Error looking up: " + key); 41 | s = key; 42 | } 43 | return s; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/J3dNotification.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * J3dNotification is used to hold data for asynchronous error notification. 31 | */ 32 | 33 | class J3dNotification extends Object { 34 | /** 35 | * The various notification types. 36 | */ 37 | static final int INVALID_TYPE = -1; 38 | static final int SHADER_ERROR = 0; 39 | static final int RENDERING_ERROR = 1; 40 | 41 | /** 42 | * This holds the type of this message 43 | */ 44 | int type = INVALID_TYPE; 45 | 46 | /** 47 | * The universe that this message originated from 48 | */ 49 | VirtualUniverse universe; 50 | 51 | /** 52 | * The arguements for a message, 6 for now 53 | */ 54 | static final int MAX_ARGS = 6; 55 | 56 | Object[] args = new Object[MAX_ARGS]; 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/J3dThreadData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * The J3dThreadData is the data wrapper for threads in Java 3D. 31 | */ 32 | 33 | class J3dThreadData extends Object { 34 | /** 35 | * Thread run options 36 | */ 37 | static final int WAIT_ALL_THREADS = 0x01; 38 | static final int CONT_THREAD = 0x02; 39 | static final int WAIT_THIS_THREAD = 0x04; 40 | static final int START_TIMER = 0x08; 41 | static final int STOP_TIMER = 0x10; 42 | static final int LAST_STOP_TIMER = 0x20; 43 | //static final int LOCK_RENDERBIN = 0x20; 44 | //static final int RELEASE_RENDERBIN = 0x40; 45 | 46 | /** 47 | * The thread for this data 48 | */ 49 | J3dThread thread = null; 50 | 51 | /** 52 | * The last time that a message was sent to this thread. 53 | */ 54 | long lastUpdateTime = -1; 55 | 56 | /** 57 | * The last time that this thread was run 58 | */ 59 | long lastRunTime = -1; 60 | 61 | /** 62 | * The thread type 63 | */ 64 | int threadType = 0; 65 | 66 | /** 67 | * The run options for this thread. 68 | */ 69 | int threadOpts = 0; 70 | 71 | /** 72 | * The arguments to be passed to this thread 73 | */ 74 | Object threadArgs = null; 75 | 76 | /** 77 | * This indicates whether or not this thread needs to run. 78 | */ 79 | boolean needsRun = false; 80 | 81 | /** 82 | * The following data is only used by the Render Thread 83 | */ 84 | 85 | /** 86 | * The type of the thread invocation. RENDER or SWAP 87 | */ 88 | int type = 0; 89 | 90 | /** 91 | * The view that this Render invocation belongs to. 92 | */ 93 | View view = null; 94 | 95 | /** 96 | * The Canvas3D that this Render invocation belongs to. 97 | * It is null for the SWAP invocation. 98 | */ 99 | Canvas3D canvas = null; 100 | 101 | /** 102 | * This constructor does nothing 103 | */ 104 | J3dThreadData() { 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/JoglDrawable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | import com.jogamp.nativewindow.NativeWindow; 30 | import com.jogamp.opengl.GLDrawable; 31 | 32 | /** 33 | * Drawable class for the Jogl rendering pipeline. 34 | */ 35 | class JoglDrawable implements Drawable { 36 | private GLDrawable drawable; 37 | private NativeWindow nativeWindow; 38 | 39 | JoglDrawable(GLDrawable drawable, NativeWindow nativeWindow) { 40 | this.drawable = drawable; 41 | this.nativeWindow = nativeWindow; 42 | } 43 | 44 | GLDrawable getGLDrawable() { 45 | return drawable; 46 | } 47 | 48 | void setGLDrawable(GLDrawable drawable) { 49 | this.drawable = drawable; 50 | } 51 | 52 | NativeWindow getNativeWindow() { 53 | return nativeWindow; 54 | } 55 | 56 | void destroyNativeWindow() { 57 | if (nativeWindow == null) 58 | return; 59 | 60 | nativeWindow.destroy(); 61 | nativeWindow = null; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/JoglDrawingSurfaceObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * The DrawingSurfaceObject class is used to manage native drawing surface 31 | */ 32 | class JoglDrawingSurfaceObject extends DrawingSurfaceObject { 33 | 34 | JoglDrawingSurfaceObject(Canvas3D cv) { 35 | super(cv); 36 | 37 | // System.err.println("JoglDrawingSurfaceObject constructed"); 38 | } 39 | 40 | @Override 41 | synchronized boolean renderLock() { 42 | // System.err.println("JoglDrawingSurfaceObject.renderLock()"); 43 | gotDsiLock = true; 44 | return true; 45 | } 46 | 47 | @Override 48 | synchronized void unLock() { 49 | // System.err.println("JoglDrawingSurfaceObject.unLock()"); 50 | gotDsiLock = false; 51 | } 52 | 53 | @Override 54 | synchronized void getDrawingSurfaceObjectInfo() { 55 | // FIXME: we don't have all of the information we need here to 56 | // create a GLDrawable for the Canvas3D, so for now, do nothing 57 | 58 | // FIXME: this mechanism is much too complicated 59 | 60 | /* 61 | System.err.println("JoglDrawingSurfaceObject.getDrawingSurfaceObjectInfo()"); 62 | 63 | if (canvas.drawable == null) { 64 | System.err.println( 65 | "JoglDrawingSurfaceObject.getDrawingSurfaceObjectInfo: window = " 66 | + canvas.drawable); 67 | 68 | // TODO: replace with a real JoglDrawable 69 | canvas.drawable = new JoglDrawable(); 70 | } 71 | */ 72 | } 73 | 74 | @Override 75 | synchronized void invalidate() { 76 | System.err.println("JoglDrawingSurfaceObject.invalidate()"); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/JoglShaderObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | class JoglShaderObject implements ShaderProgramId, ShaderId, ShaderAttrLoc { 30 | private int val; 31 | 32 | JoglShaderObject(int val) { 33 | this.val = val; 34 | } 35 | 36 | int getValue() { 37 | return val; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/Leaf.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * The Leaf node is an abstract class for all scene graph nodes that 31 | * have no children. 32 | * Leaf nodes specify lights, geometry, and sounds. They specify special 33 | * linking and instancing capabilities for sharing scene graphs and 34 | * provide a view platform for positioning and orienting a view in the 35 | * virtual world. 36 | *

37 | * NOTE: Applications should not extend this class directly. 38 | */ 39 | 40 | public abstract class Leaf extends Node { 41 | 42 | /** 43 | * Construct and initialize the Leaf object. 44 | */ 45 | public Leaf(){ 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/LeafRetained.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | import java.util.ArrayList; 29 | 30 | /** 31 | * LeafRetained node. 32 | */ 33 | abstract class LeafRetained extends NodeRetained { 34 | 35 | SwitchState switchState = null; 36 | 37 | // temporary variable used during bounds computation, since 38 | // multiple mirror shapes could be pointing to the same shape3D 39 | boolean boundsDirty = false; 40 | 41 | // Appicable only to the mirror object 42 | void updateBoundingLeaf() { 43 | 44 | } 45 | protected Object clone(boolean forceDuplicate) { 46 | return super.clone(); 47 | } 48 | 49 | void updateMirrorObject(Object[] args) { 50 | } 51 | 52 | void updateTransformChange() { 53 | } 54 | 55 | void updateBounds() { 56 | } 57 | 58 | void getMirrorObjects(ArrayList l, HashKey k) { 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/LightSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | 30 | class LightSet extends Object { 31 | /** 32 | * The Lights that make up this set 33 | */ 34 | LightRetained[] lights = null; 35 | 36 | // The number of lights in this lightset, may be less than lights.length 37 | int nlights = 0; 38 | 39 | // A reference to the next LightSet 40 | LightSet next = null; 41 | 42 | // A reference to the previous LightSet 43 | LightSet prev = null; 44 | 45 | // A flag that indicates that lighting is on 46 | boolean lightingOn = true; 47 | 48 | // A flag that indicates that this light set has changed. 49 | boolean isDirty = true; 50 | 51 | /** 52 | * Constructs a new LightSet 53 | */ 54 | LightSet(RenderBin rb, RenderAtom ra, LightRetained[] lights, 55 | int nlights, boolean lightOn) { 56 | this.reset(rb, ra, lights, nlights, lightOn); 57 | } 58 | 59 | void reset(RenderBin rb, RenderAtom ra, LightRetained[] lights, 60 | int nlights, boolean lightOn) { 61 | int i; 62 | 63 | this.isDirty = true; 64 | this.lightingOn = lightOn; 65 | if (this.lights == null || this.lights.length < nlights) { 66 | this.lights = new LightRetained[nlights]; 67 | } 68 | 69 | for (i=0; i 0)) { 54 | try { wait(); } catch(InterruptedException e){} 55 | } 56 | lockRequested--; 57 | readCount++; 58 | } 59 | 60 | synchronized final void readUnlock() { 61 | if(readCount>0) 62 | readCount--; 63 | else 64 | if(debug) System.err.println("ReadWriteLock.java : Problem! readCount is >= 0."); 65 | 66 | if(lockRequested>0) 67 | notifyAll(); 68 | } 69 | 70 | synchronized final void writeLock() { 71 | lockRequested++; 72 | writeRequested++; 73 | while((readCount>0)||(write == true)) { 74 | try { wait(); } catch(InterruptedException e){} 75 | } 76 | write = true; 77 | lockRequested--; 78 | writeRequested--; 79 | } 80 | 81 | synchronized final void writeUnlock() { 82 | write = false; 83 | 84 | if(lockRequested>0) 85 | notifyAll(); 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/MasterControlThread.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Master control thread. The MasterControlThread object and thread 31 | * are created dynamically whenever needed. Once created, the thread 32 | * runs until all other threads are terminated. Then the master 33 | * control thread terminates. There is never more than one 34 | * MasterControl object or thread in existence at any one time. 35 | */ 36 | class MasterControlThread extends Thread { 37 | 38 | private static int numInstances = 0; 39 | private int instanceNum = -1; 40 | 41 | private static synchronized int newInstanceNum() { 42 | return (++numInstances); 43 | } 44 | 45 | private int getInstanceNum() { 46 | if (instanceNum == -1) 47 | instanceNum = newInstanceNum(); 48 | return instanceNum; 49 | } 50 | 51 | MasterControlThread(ThreadGroup threadGroup) { 52 | super(threadGroup, ""); 53 | setDaemon(true); 54 | setName("J3D-MasterControl-" + getInstanceNum()); 55 | VirtualUniverse.mc.createMCThreads(); 56 | this.start(); 57 | } 58 | 59 | @Override 60 | public void run() { 61 | 62 | do { 63 | while (VirtualUniverse.mc.running) { 64 | VirtualUniverse.mc.doWork(); 65 | 66 | // NOTE: no need to call Thread.yield(), since we will 67 | // call wait() if there is no work to do (yield seems 68 | // to be a no-op on Windows anyway) 69 | } 70 | } while (!VirtualUniverse.mc.mcThreadDone()); 71 | 72 | if(J3dDebug.devPhase) { 73 | J3dDebug.doDebug(J3dDebug.masterControl, J3dDebug.LEVEL_1, 74 | "MC: MasterControl Thread Terminate"); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/MultipleParentException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Indicates 31 | * an attempt to add a node that is already a child of one 32 | * group node, into another group node. 33 | */ 34 | public class MultipleParentException extends IllegalSharingException { 35 | 36 | /** 37 | * Create the exception object with default values. 38 | */ 39 | public MultipleParentException(){ 40 | } 41 | 42 | /** 43 | * Create the exception object that outputs message. 44 | * @param str the message string to be output. 45 | */ 46 | public MultipleParentException(String str){ 47 | 48 | super(str); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/NnuId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Defines a "not necessarily unique ID" 31 | */ 32 | 33 | interface NnuId { 34 | 35 | abstract int equal(NnuId obj); 36 | 37 | abstract int getId(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/NodeComponentUpdate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * A Node Component Update interface. Any object that can be put in the 31 | * node component updateCheck list must implement this interface. 32 | */ 33 | 34 | interface NodeComponentUpdate { 35 | 36 | /** 37 | * The actual update function. 38 | */ 39 | abstract void updateNodeComponentCheck(); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/NodeData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | 30 | class NodeData { 31 | // per path node data 32 | // XXXX: replace per path mirror objects with node data 33 | // XXXX: move other basic node's data here 34 | SwitchState switchState = null; 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/NoopDrawingSurfaceObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * The DrawingSurfaceObject class is used to manage native drawing surface 31 | */ 32 | class NoopDrawingSurfaceObject extends DrawingSurfaceObject { 33 | 34 | NoopDrawingSurfaceObject(Canvas3D cv) { 35 | super(cv); 36 | 37 | System.err.println("NoopDrawingSurfaceObject constructed"); 38 | } 39 | 40 | @Override 41 | synchronized boolean renderLock() { 42 | // System.err.println("NoopDrawingSurfaceObject.renderLock()"); 43 | gotDsiLock = true; 44 | return true; 45 | } 46 | 47 | @Override 48 | synchronized void unLock() { 49 | // System.err.println("NoopDrawingSurfaceObject.unLock()"); 50 | gotDsiLock = false; 51 | } 52 | 53 | @Override 54 | synchronized void getDrawingSurfaceObjectInfo() { 55 | if (canvas.drawable == null) { 56 | System.err.println( 57 | "NoopDrawingSurfaceObject.getDrawingSurfaceObjectInfo: window = " 58 | + canvas.drawable); 59 | 60 | canvas.drawable = new NoopDrawable(); 61 | } 62 | } 63 | 64 | @Override 65 | synchronized void invalidate() { 66 | System.err.println("NoopDrawingSurfaceObject.invalidate()"); 67 | } 68 | 69 | /** 70 | * Dummy drawable for noop pipeline 71 | */ 72 | static class NoopDrawable implements Drawable { 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/ObjectUpdate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /* 30 | * A Object Update interface. Any object that can be put in the ObjectUpdate list 31 | * must implement this interface. 32 | */ 33 | 34 | interface ObjectUpdate { 35 | 36 | /** 37 | * The actual update function. 38 | */ 39 | abstract void updateObject(); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/OrderedChildInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * List of orderedGroup children that needs to be added/removed for 31 | * the next frame. Note that the order in which they are removed and 32 | * added should be maintained after the renderer is done to get the 33 | * correct order of rendering. 34 | */ 35 | class OrderedChildInfo extends Object { 36 | 37 | static int ADD = 0x1; 38 | static int REMOVE = 0x2; 39 | 40 | 41 | /** 42 | * Type of operation, could be add/remove or set 43 | */ 44 | int type; 45 | 46 | /** 47 | * Ordered index at which this operation takes place 48 | */ 49 | int orderedId; 50 | 51 | /** 52 | * Child index at which this operation takes place 53 | */ 54 | int childId; 55 | 56 | /** 57 | * Value of the orderedCollection, only relavent for 58 | * add and set 59 | */ 60 | OrderedCollection value; 61 | 62 | 63 | // Maintains the order in which the ordered children 64 | // were added and removed 65 | OrderedChildInfo next; 66 | OrderedChildInfo prev; 67 | 68 | OrderedChildInfo(int t, int cid, int oid, OrderedCollection val) { 69 | type = t; 70 | orderedId = oid; 71 | childId = cid; 72 | value = val; 73 | prev = null; 74 | next = null; 75 | 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/OrderedCollection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | import java.util.ArrayList; 30 | 31 | 32 | /** 33 | * An OrderCollections contains a LightBin and an ArrayList of 34 | * of all top level OrderedGroups under this OrderCollection 35 | */ 36 | class OrderedCollection extends Object implements ObjectUpdate{ 37 | 38 | LightBin lightBin = null; 39 | 40 | // a list of top level orderedBins under this orderedCollection 41 | ArrayList childOrderedBins = new ArrayList(); 42 | 43 | // LightBin used for next frame 44 | LightBin nextFrameLightBin = null; 45 | 46 | // LightBins to be added for this frame 47 | LightBin addLightBins = null; 48 | 49 | boolean onUpdateList = false; 50 | 51 | @Override 52 | public void updateObject() { 53 | int i; 54 | LightBin lb; 55 | lightBin = nextFrameLightBin; 56 | if (addLightBins != null) { 57 | if (lightBin != null) { 58 | addLightBins.prev = lightBin; 59 | lightBin.next = addLightBins; 60 | } 61 | else { 62 | lightBin = addLightBins; 63 | nextFrameLightBin = lightBin; 64 | } 65 | } 66 | addLightBins = null; 67 | onUpdateList = false; 68 | } 69 | 70 | 71 | 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/OrderedPath.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | import java.util.ArrayList; 30 | 31 | class OrderedPath { 32 | ArrayList pathElements = new ArrayList(1); 33 | 34 | void addElementToPath(OrderedGroupRetained og, Integer orderedId) { 35 | pathElements.add(new OrderedPathElement(og, orderedId)); 36 | } 37 | 38 | OrderedPath clonePath() { 39 | OrderedPath path = new OrderedPath(); 40 | path.pathElements = new ArrayList(pathElements); 41 | return path; 42 | } 43 | 44 | void printPath() { 45 | System.err.println("orderedPath: ["); 46 | for (int i = 0; i < pathElements.size(); i++) { 47 | OrderedPathElement ope = pathElements.get(i); 48 | System.err.println("(" + ope.orderedGroup + "," + ope.childId); 49 | } 50 | System.err.println("]"); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/OrderedPathElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | 30 | class OrderedPathElement extends Object { 31 | OrderedGroupRetained orderedGroup; 32 | Integer childId; 33 | 34 | OrderedPathElement(OrderedGroupRetained og, Integer orderedId) { 35 | orderedGroup = og; 36 | childId = orderedId; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/PickShape.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | import org.jogamp.vecmath.Point3d; 29 | import org.jogamp.vecmath.Point4d; 30 | 31 | /** 32 | * An abstract class for describing a pick shape that can be used with 33 | * the BranchGroup and Locale picking methods. 34 | * 35 | * @see BranchGroup#pickAll 36 | * @see Locale#pickAll 37 | */ 38 | public abstract class PickShape { 39 | 40 | // Use for picking 41 | static final int PICKRAY = 1; 42 | static final int PICKSEGMENT = 2; 43 | static final int PICKPOINT = 3; 44 | static final int PICKCYLINDER = 4; 45 | static final int PICKCONE = 5; 46 | static final int PICKBOUNDINGBOX = 6; 47 | static final int PICKBOUNDINGSPHERE = 7; 48 | static final int PICKBOUNDINGPOLYTOPE = 8; 49 | static final int PICKUNKNOWN = 9; 50 | 51 | /** 52 | * Constructs a PickShape object. 53 | */ 54 | public PickShape() { 55 | } 56 | 57 | /** 58 | * Return true if shape intersect with bounds. 59 | * The point of intersection is stored in pickPos. 60 | */ 61 | abstract boolean intersect(Bounds bounds, Point4d pickPos); 62 | 63 | // Only use within J3D. 64 | // Return a new PickShape that is the transformed (t3d) of this pickShape. 65 | abstract PickShape transform(Transform3D t3d); 66 | 67 | // Get the start point use to compute the distance 68 | // with intersect point for this shape. 69 | abstract Point3d getStartPoint(); 70 | 71 | // Return the distance between the original of this 72 | // pickShape and iPnt 73 | double distance(Point3d iPnt) { 74 | Point3d p = getStartPoint(); 75 | double x = iPnt.x - p.x; 76 | double y = iPnt.y - p.y; 77 | double z = iPnt.z - p.z; 78 | return Math.sqrt(x*x + y*y + z*z); 79 | } 80 | 81 | // Return one of PickShape type constant define above 82 | abstract int getPickType(); 83 | 84 | } 85 | 86 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/RenderAtomListInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | /** 29 | * Information per geometry in the renderAtom, there are several 30 | * of these per RenderAtom, one per geometry in GeometryAtom 31 | */ 32 | class RenderAtomListInfo extends Object { 33 | 34 | final RenderAtom renderAtom; // RenderAtom that its a part of 35 | 36 | // Specific geometry index in the GeometryAtom geometryArr list that 37 | // corresponds to this RenderAtomListInfo 38 | final int index; 39 | 40 | // Prev and next pointer 41 | RenderAtomListInfo next = null; 42 | RenderAtomListInfo prev = null; 43 | 44 | // Which bucket in the renderMolecule that it falls info 45 | int groupType = 0; 46 | 47 | // Used only for Text3D 48 | // background geometry rendering 49 | Transform3D infLocalToVworld = null; 50 | Transform3D localToVworld = null; 51 | 52 | RenderAtomListInfo(RenderAtom ra, int idx) { 53 | renderAtom = ra; 54 | index = idx; 55 | } 56 | 57 | GeometryRetained geometry() { 58 | return renderAtom.geometryAtom.geometryArray[index]; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/RenderMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * The RenderMethod interface is used to create various ways to render 31 | * different geometries. 32 | */ 33 | 34 | interface RenderMethod { 35 | 36 | /** 37 | * The actual rendering code for this RenderMethod 38 | */ 39 | abstract boolean render(RenderMolecule rm, Canvas3D cv, 40 | RenderAtomListInfo ra, int dirtyBits); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/RendererStructure.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | 30 | /** 31 | * A renderer structure is an object that organizes messages 32 | * to the renderer thread. 33 | */ 34 | class RendererStructure extends J3dStructure{ 35 | 36 | /** 37 | * This constructor does nothing 38 | */ 39 | RendererStructure() { 40 | super(null, J3dThread.RENDER_THREAD); 41 | } 42 | 43 | /** 44 | * Returns all messages in the queue. 45 | */ 46 | J3dMessage[] getMessages() { 47 | int sz; 48 | 49 | synchronized (messageList) { 50 | if ((sz = messageList.size()) > 0) { 51 | if (msgList.length < sz) { 52 | msgList = new J3dMessage[sz]; 53 | } 54 | messageList.toArrayAndClear(msgList); 55 | } 56 | } 57 | 58 | nMessage = sz; 59 | return msgList; 60 | } 61 | 62 | 63 | @Override 64 | void processMessages(long referenceTime) {} 65 | 66 | @Override 67 | void removeNodes(J3dMessage m) {} 68 | 69 | @Override 70 | void cleanup() {} 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/RenderingErrorListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Listener interface for monitoring Java 3D rendering errors. 31 | * 32 | * @see VirtualUniverse#addRenderingErrorListener 33 | * 34 | * @since Java 3D 1.5 35 | */ 36 | public interface RenderingErrorListener { 37 | /** 38 | * Invoked when an error occurs in the Java 3D rendering system. 39 | * 40 | * @param error object that contains the details of the error. 41 | */ 42 | public void errorOccurred(RenderingError error); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/RestrictedAccessException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Indicates an attempt to access or modify a state variable 31 | * without permission to do so. For example, invoking a set 32 | * method for a state variable that is currently read-only. 33 | */ 34 | public class RestrictedAccessException extends RuntimeException { 35 | 36 | /** 37 | * Create the exception object with default values. 38 | */ 39 | public RestrictedAccessException(){ 40 | } 41 | 42 | /** 43 | * Create the exception object that outputs a message. 44 | * @param str the message string to be output. 45 | */ 46 | public RestrictedAccessException(String str) { 47 | 48 | super(str); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/SceneGraphCycleException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Indicates a graph that contains a cycle. 31 | * Java 3D scene graphs are directed acyclic graphs and, as such, do not 32 | * permit cycles. 33 | * This exception is thrown when a graph containing a cycle: 34 | *

    35 | *
  • is made live 36 | *
  • is compiled 37 | *
  • is cloned 38 | *
  • has getBounds() called on it. 39 | *
40 | */ 41 | public class SceneGraphCycleException extends IllegalSceneGraphException{ 42 | 43 | /** 44 | * Create the exception object with default values. 45 | */ 46 | public SceneGraphCycleException(){ 47 | } 48 | 49 | /** 50 | * Create the exception object that outputs message. 51 | * @param str the message string to be output. 52 | */ 53 | public SceneGraphCycleException(String str){ 54 | 55 | super(str); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/ShaderAttrLoc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Tagging interface for shader attribute location objects. The rendering 31 | * pipelines will define concrete classes that implement this interface. All 32 | * code that uses the tagged objects will be in the pipelines. 33 | */ 34 | interface ShaderAttrLoc { 35 | // No methods or constants defined at this time 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/ShaderAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | 30 | /** 31 | * The ShaderAttribute object encapsulates a uniform attribute for a 32 | * shader programs. Uniform attributes (variables) are those 33 | * attributes whose values are constant during the rendering of a 34 | * primitive. Their values may change from primitive to primitive, but 35 | * are constant for each vertex (for vertex shaders) or fragment (for 36 | * fragment shaders) of a single primitive. Examples of uniform 37 | * attributes include a transformation matrix, a texture map, lights, 38 | * lookup tables, etc. 39 | * 40 | *

41 | * There are two ways in which values can be specified for uniform 42 | * attributes: explicitly, by providing a value; and implicitly, by 43 | * defining a binding between a Java 3D system attribute and a uniform 44 | * attribute. This functionality is provided by two subclasses of 45 | * ShaderAttribute as follows: 46 | * 47 | *

    48 | *
  • ShaderAttributeObject, in which attributes are expressed as 49 | * (attrName, value) pairs, is used for explicitly 50 | * defined attributes
  • 51 | *
  • ShaderAttributeBinding, in which attributes are expressed as 52 | * (attrName, j3dAttrName) pairs, is used for 53 | * implicitly defined, automatically tracked attributes
  • 54 | *
55 | * 56 | * @see ShaderAttributeSet 57 | * @see ShaderProgram 58 | * 59 | * @since Java 3D 1.4 60 | */ 61 | 62 | public abstract class ShaderAttribute extends NodeComponent { 63 | /** 64 | * Name of the shader attribute (immutable) 65 | */ 66 | 67 | /** 68 | * Package scope constructor 69 | * 70 | */ 71 | ShaderAttribute(String attrName) { 72 | if (attrName == null) { 73 | throw new NullPointerException(); 74 | } 75 | 76 | ((ShaderAttributeRetained)this.retained).initializeAttrName(attrName); 77 | } 78 | 79 | /** 80 | * Retrieves the name of this shader attribute. 81 | * 82 | * @return the name of this shader attribute 83 | */ 84 | public String getAttributeName() { 85 | 86 | return ((ShaderAttributeRetained)this.retained).getAttributeName(); 87 | 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/ShaderAttributeBindingRetained.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | 30 | /** 31 | * The ShaderAttributeBinding object encapsulates a uniform attribute 32 | * whose value is bound to a Java 3D system attribute. The 33 | * shader variable attrName is implicitly set to the 34 | * value of the corresponding Java 3D system attribute 35 | * j3dAttrName during rendering. attrName 36 | * must be the name of a valid uniform attribute in the shader in 37 | * which it is used. Otherwise, the attribute name will be ignored and 38 | * a runtime error may be generated. j3dAttrName must be 39 | * the name of a predefined Java 3D system attribute. An 40 | * IllegalArgumentException will be thrown if the specified 41 | * j3dAttrName is not one of the predefined system 42 | * attributes. Further, the type of the j3dAttrName 43 | * attribute must match the type of the corresponding 44 | * attrName variable in the shader in which it is 45 | * used. Otherwise, the shader will not be able to use the attribute 46 | * and a runtime error may be generated. 47 | */ 48 | 49 | class ShaderAttributeBindingRetained extends ShaderAttributeRetained { 50 | String j3dAttrName; 51 | 52 | ShaderAttributeBindingRetained() { 53 | } 54 | 55 | void initJ3dAttrName(String j3dAttrName) { 56 | this.j3dAttrName = j3dAttrName; 57 | } 58 | 59 | /** 60 | * Retrieves the name of the Java 3D system attribute that is bound to this 61 | * shader attribute. 62 | * 63 | * @return the name of the Java 3D system attribute that is bound to this 64 | * shader attribute 65 | */ 66 | String getJ3DAttributeName() { 67 | return j3dAttrName; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/ShaderAttributeRetained.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | 30 | /** 31 | * The ShaderAttributeRetained object encapsulates a uniform attribute for a 32 | * shader programs. 33 | */ 34 | 35 | abstract class ShaderAttributeRetained extends NodeComponentRetained { 36 | 37 | /** 38 | * Name of the shader attribute (immutable) 39 | */ 40 | String attrName; 41 | 42 | /** 43 | * Package scope constructor 44 | */ 45 | ShaderAttributeRetained() { 46 | } 47 | 48 | void initializeAttrName(String attrName) { 49 | this.attrName = attrName; 50 | } 51 | 52 | /** 53 | * Retrieves the name of this shader attribute. 54 | * 55 | * @return the name of this shader attribute 56 | */ 57 | String getAttributeName() { 58 | return attrName; 59 | } 60 | 61 | @Override 62 | void initMirrorObject() { 63 | ((ShaderAttributeObjectRetained)mirror).initializeAttrName(this.attrName); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/ShaderConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * The ShaderConstants class contains internal constants used by other 31 | * Shader classes. 32 | */ 33 | class ShaderConstants extends Object { 34 | 35 | // 36 | // The following bits are used in the messages for various Shader objects. 37 | // 38 | 39 | // ShaderAttributeSet bits -- indicates which attribute 40 | // operation in this ShaderAttributeSet object is needed. 41 | static final int ATTRIBUTE_SET_PUT = 0x0001; 42 | static final int ATTRIBUTE_SET_REMOVE = 0x0002; 43 | static final int ATTRIBUTE_SET_CLEAR = 0x0004; 44 | 45 | // ShaderAttribute bits 46 | static final int ATTRIBUTE_VALUE_UPDATE = 0x0008; 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/ShaderErrorListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Listener interface for monitoring errors in Shader Programs. 31 | * Compile and link errors are reported by the shader compiler, as are 32 | * runtime errors, such as those resulting from shader attributes that 33 | * aren't found or are of the wrong type. 34 | * 35 | * @see VirtualUniverse#addShaderErrorListener 36 | * 37 | * @since Java 3D 1.4 38 | */ 39 | public interface ShaderErrorListener { 40 | /** 41 | * Invoked when an error occurs while compiling, linking or 42 | * executing a programmable shader. 43 | * 44 | * @param error object that contains the details of the error. 45 | */ 46 | public void errorOccurred(ShaderError error); 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/ShaderId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Tagging interface for shader objects. The rendering pipelines 31 | * will define concrete classes that implement this interface. All code that 32 | * uses the tagged objects will be in the pipelines. 33 | */ 34 | interface ShaderId { 35 | // No methods or constants defined at this time 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/ShaderProgramId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Tagging interface for shader program objects. The rendering pipelines 31 | * will define concrete classes that implement this interface. All code that 32 | * uses the tagged objects will be in the pipelines. 33 | */ 34 | interface ShaderProgramId { 35 | // No methods or constants defined at this time 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/SoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Indicates a problem in loading or playing a sound sample. 31 | */ 32 | public class SoundException extends RuntimeException{ 33 | 34 | /** 35 | * Create the exception object with default values. 36 | */ 37 | public SoundException(){ 38 | } 39 | 40 | /** 41 | * Create the exception object that outputs message. 42 | * @param str the message string to be output. 43 | */ 44 | public SoundException(String str){ 45 | 46 | super(str); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/TargetsInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | import java.util.ArrayList; 29 | 30 | 31 | interface TargetsInterface { 32 | 33 | static final int TRANSFORM_TARGETS = 0; 34 | static final int SWITCH_TARGETS = 1; 35 | 36 | // used by Switch, TransformGroup and SharedGroup 37 | abstract CachedTargets getCachedTargets(int type, int index, int child); 38 | abstract void resetCachedTargets(int type, CachedTargets[] newCt, int child); 39 | // used by TransformGroup and SharedGroup 40 | abstract int getTargetThreads(int type); 41 | abstract void updateCachedTargets(int type, CachedTargets[] newCt); 42 | abstract void computeTargetThreads(int type, CachedTargets[] newCt); 43 | abstract void updateTargetThreads(int type, CachedTargets[] newCt); 44 | abstract void propagateTargetThreads(int type, int childTargetThreads); 45 | abstract void copyCachedTargets(int type, CachedTargets[] newCt); 46 | 47 | // used by Switch and SharedGroup 48 | abstract ArrayList getTargetsData(int type, int index); 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/TransformGroupData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | class TransformGroupData extends NodeData { 30 | // per path node data 31 | // XXXX: replace per path mirror objects with node data 32 | // XXXX: move other TransfromGroup related data here 33 | boolean switchDirty = false; 34 | 35 | // use for eliminate multiple updates and generate unique targets 36 | boolean markedDirty = false; 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/TransparencySortGeom.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Harvey Harrison 3 | * 4 | * This code is free software; you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 2 only, as 6 | * published by the Free Software Foundation. Sun designates this 7 | * particular file as subject to the "Classpath" exception as provided 8 | * by Sun in the LICENSE file that accompanied this code. 9 | * 10 | * This code is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 | * version 2 for more details (a copy is included in the LICENSE file that 14 | * accompanied this code). 15 | */ 16 | package org.jogamp.java3d; 17 | 18 | /** 19 | * An interface that allows sorting the rendering order of transparent geometry. 20 | * 21 | * @since Java 3D 1.6 22 | */ 23 | public interface TransparencySortGeom { 24 | 25 | /** 26 | * Returns the Geometry for this object. 27 | * @return geometry for this object 28 | */ 29 | public Geometry getGeometry(); 30 | 31 | /** 32 | * Returns the distance squared of this object to the viewer. 33 | * @return distancesquared to viewer 34 | */ 35 | public double getDistanceSquared(); 36 | 37 | /** 38 | * Returns the LocalToVWorld transform for this object 39 | * @param localToVW variable in which transform will be returned 40 | */ 41 | public void getLocalToVWorld(Transform3D localToVW); 42 | 43 | /** 44 | * Returns the Shape3D being rendered using this geometry. 45 | * @return the Shape3D being rendered using this geometry 46 | */ 47 | public Shape3D getShape3D(); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/TransparencySortMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Harvey Harrison 3 | * 4 | * This code is free software; you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 2 only, as 6 | * published by the Free Software Foundation. Sun designates this 7 | * particular file as subject to the "Classpath" exception as provided 8 | * by Sun in the LICENSE file that accompanied this code. 9 | * 10 | * This code is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 | * version 2 for more details (a copy is included in the LICENSE file that 14 | * accompanied this code). 15 | */ 16 | package org.jogamp.java3d; 17 | 18 | import java.util.Comparator; 19 | import java.util.WeakHashMap; 20 | 21 | /** 22 | * A class mapping Views to a TransparencySortGeom object. 23 | */ 24 | public class TransparencySortMap { 25 | 26 | private static final WeakHashMap> comparators = new WeakHashMap>(); 27 | 28 | // prevent an instance from being created. 29 | private TransparencySortMap() {} 30 | 31 | /** 32 | * Set the comparator for the specified view. 33 | * @param view the view to which the comparator applies 34 | * @param comparator the comparator to call 35 | */ 36 | public static void setComparator(View view, Comparator comparator) { 37 | comparators.put(view, comparator); 38 | } 39 | 40 | /** 41 | * Returns the comparator for the specified view 42 | * @return the comparator for the specified view, or null if there is no 43 | * comparator for the view or the view is unknown. 44 | */ 45 | public static Comparator getComparator(View view) { 46 | return comparators.get(view); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/VertexArrayRenderMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * The RenderMethod interface is used to create various ways to render 31 | * different geometries. 32 | */ 33 | 34 | class VertexArrayRenderMethod implements RenderMethod { 35 | 36 | 37 | @Override 38 | public boolean render(RenderMolecule rm, Canvas3D cv, 39 | RenderAtomListInfo ra, int dirtyBits) { 40 | 41 | GeometryArrayRetained geo = (GeometryArrayRetained)ra.geometry(); 42 | geo.setVertexFormat((rm.useAlpha && ((geo.vertexFormat & 43 | GeometryArray.COLOR) != 0)), 44 | rm.textureBin.attributeBin.ignoreVertexColors, cv.ctx); 45 | 46 | if (rm.doInfinite) { 47 | cv.updateState(dirtyBits); 48 | while (ra != null) { 49 | renderGeo(ra, rm, cv); 50 | ra = ra.next; 51 | } 52 | return true; 53 | } 54 | 55 | boolean isVisible = false; // True if any of the RAs is visible. 56 | while (ra != null) { 57 | if (cv.ra == ra.renderAtom) { 58 | if (cv.raIsVisible) { 59 | cv.updateState(dirtyBits); 60 | renderGeo(ra, rm, cv); 61 | isVisible = true; 62 | } 63 | } 64 | else { 65 | if (!VirtualUniverse.mc.viewFrustumCulling || 66 | ra.renderAtom.localeVwcBounds.intersect(cv.viewFrustum)) { 67 | cv.updateState(dirtyBits); 68 | cv.raIsVisible = true; 69 | renderGeo(ra, rm, cv); 70 | isVisible = true; 71 | } 72 | else { 73 | cv.raIsVisible = false; 74 | } 75 | cv.ra = ra.renderAtom; 76 | } 77 | 78 | ra = ra.next; 79 | } 80 | return isVisible; 81 | } 82 | 83 | void renderGeo(RenderAtomListInfo ra, RenderMolecule rm, Canvas3D cv) { 84 | GeometryArrayRetained geo; 85 | boolean useAlpha; 86 | 87 | useAlpha = rm.useAlpha; 88 | 89 | geo = (GeometryArrayRetained)ra.geometry(); 90 | 91 | 92 | geo.execute(cv, ra.renderAtom, rm.isNonUniformScale, 93 | (useAlpha && ((geo.vertexFormat & GeometryArray.COLOR) != 0)) , 94 | rm.alpha, 95 | cv.screen.screen, 96 | rm.textureBin.attributeBin.ignoreVertexColors); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/WakeupOnActivation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Class specifying a wakeup the first time an active Viewplatform's 31 | * activation 32 | * volume intersects with this object's scheduling region. 33 | * This gives the behavior an explicit means of executing code when 34 | * it is activated. 35 | */ 36 | public final class WakeupOnActivation extends WakeupCriterion { 37 | 38 | // different types of WakeupIndexedList that use in BehaviorStructure 39 | static final int COND_IN_BS_LIST = 0; 40 | 41 | // total number of different IndexedUnorderedSet types 42 | static final int TOTAL_INDEXED_UNORDER_SET_TYPES = 1; 43 | 44 | /** 45 | * Constructs a new WakeupOnActivation criterion. 46 | */ 47 | public WakeupOnActivation() { 48 | WakeupIndexedList.init(this, TOTAL_INDEXED_UNORDER_SET_TYPES); 49 | } 50 | 51 | /** 52 | * This is a callback from BehaviorStructure. It is 53 | * used to add wakeupCondition to behavior structure. 54 | */ 55 | @Override 56 | void addBehaviorCondition(BehaviorStructure bs) { 57 | behav.wakeupArray[BehaviorRetained.WAKEUP_ACTIVATE_INDEX]++; 58 | behav.wakeupMask |= BehaviorRetained.WAKEUP_ACTIVATE; 59 | bs.wakeupOnActivation.add(this); 60 | } 61 | 62 | 63 | /** 64 | * This is a callback from BehaviorStructure. It is 65 | * used to remove wakeupCondition from behavior structure. 66 | */ 67 | @Override 68 | void removeBehaviorCondition(BehaviorStructure bs) { 69 | behav.wakeupArray[BehaviorRetained.WAKEUP_ACTIVATE_INDEX]--; 70 | if (behav.wakeupArray[BehaviorRetained.WAKEUP_ACTIVATE_INDEX] == 0) { 71 | behav.wakeupMask &= ~BehaviorRetained.WAKEUP_ACTIVATE; 72 | } 73 | bs.wakeupOnActivation.remove(this); 74 | } 75 | 76 | /** 77 | * Perform task in addBehaviorCondition() that has to be 78 | * set every time the condition met. 79 | */ 80 | @Override 81 | void resetBehaviorCondition(BehaviorStructure bs) {} 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/WakeupOnTransformChange.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | /** 30 | * Class specifying a wakeup when the transform within a specified 31 | * TransformGroup changes 32 | */ 33 | public final class WakeupOnTransformChange extends WakeupCriterion { 34 | 35 | // different types of WakeupIndexedList that use in BehaviorStructure 36 | static final int COND_IN_BS_LIST = 0; 37 | 38 | // total number of different IndexedUnorderedSet types 39 | static final int TOTAL_INDEXED_UNORDER_SET_TYPES = 1; 40 | 41 | TransformGroupRetained transform; 42 | 43 | /** 44 | * Constructs a new WakeupOnTransformChange criterion. 45 | * 46 | * @param node the TransformGroup node that will trigger a wakeup if 47 | * its transform is modified 48 | */ 49 | public WakeupOnTransformChange(TransformGroup node) { 50 | this.transform = (TransformGroupRetained)node.retained; 51 | synchronized (transform) { 52 | if (transform.transformChange == null) { 53 | transform.transformChange = new WakeupIndexedList(1, 54 | WakeupOnTransformChange.class, 55 | WakeupOnTransformChange.COND_IN_BS_LIST, 56 | transform.universe); 57 | } 58 | } 59 | WakeupIndexedList.init(this, TOTAL_INDEXED_UNORDER_SET_TYPES); 60 | } 61 | 62 | /** 63 | * Returns the TransformGroup node used in creating this WakeupCriterion 64 | * @return the TransformGroup used in this criterion's construction 65 | */ 66 | public TransformGroup getTransformGroup(){ 67 | return (TransformGroup)this.transform.source; 68 | } 69 | 70 | /** 71 | * This is a callback from BehaviorStructure. It is 72 | * used to add wakeupCondition to behavior structure. 73 | */ 74 | @Override 75 | void addBehaviorCondition(BehaviorStructure bs) { 76 | transform.addCondition(this); 77 | } 78 | 79 | 80 | /** 81 | * This is a callback from BehaviorStructure. It is 82 | * used to remove wakeupCondition from behavior structure. 83 | */ 84 | @Override 85 | void removeBehaviorCondition(BehaviorStructure bs) { 86 | transform.removeCondition(this); 87 | } 88 | 89 | 90 | /** 91 | * Perform task in addBehaviorCondition() that has to be 92 | * set every time the condition met. 93 | */ 94 | @Override 95 | void resetBehaviorCondition(BehaviorStructure bs) {} 96 | } 97 | -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors1.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors2.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors3.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors4.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors5.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors6.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors7.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/Behaviors8.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/Concepts1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/Concepts1.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/Concepts2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/Concepts2.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/DAG.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/DAG.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/HelloUniverse.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | HelloUniverse 7 | 8 | 9 |

HelloUniverse: A Sample Java 10 | 3D Program

11 |

Here are code fragments from a simple program, HelloUniverse.java, 12 | that creates a cube and a RotationInterpolator behavior object that 13 | rotates the cube at a constant rate of pi/2 radians per second. The 14 | HelloUniverse class creates the branch graph 15 | that includes the cube and the RotationInterpolator behavior. It then 16 | adds this branch graph to the Locale object generated by the 17 | SimpleUniverse utility. 18 |

19 |


public class HelloUniverse ... {
public BranchGroup createSceneGraph() {
// Create the root of the branch graph
BranchGroup objRoot = new BranchGroup();

// Create the TransformGroup node and initialize it to the
// identity. Enable the TRANSFORM_WRITE capability so that
// our behavior code can modify it at run time. Add it to
// the root of the subgraph.
TransformGroup objTrans = new TransformGroup();
objTrans.setCapability(
TransformGroup.ALLOW_TRANSFORM_WRITE);
objRoot.addChild(objTrans);

// Create a simple Shape3D node; add it to the scene graph.
objTrans.addChild(new ColorCube(0.4));

// Create a new Behavior object that will perform the
// desired operation on the specified transform and add
// it into the scene graph.
Transform3D yAxis = new Transform3D();
Alpha rotationAlpha = new Alpha(-1, 4000);
RotationInterpolator rotator = new RotationInterpolator(
rotationAlpha, objTrans, yAxis,
0.0f, (float) Math.PI*2.0f);
BoundingSphere bounds =
new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
rotator.setSchedulingBounds(bounds);
objRoot.addChild(rotator);

// Have Java 3D perform optimizations on this scene graph.
objRoot.compile();

return objRoot;
}

public HelloUniverse() {
<set layout of container, construct canvas3d, add canvas3d>

// Create the scene; attach it to the virtual universe
BranchGroup scene = createSceneGraph();
SimpleUniverse u = new SimpleUniverse(canvas3d);
u.getViewingPlatform().setNominalViewingTransform();
u.addBranchGraph(scene);
}
}
20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/Immediate1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/Immediate1.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing1.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing2.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing3.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing4.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing5.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/ViewBranch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewBranch.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel1.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel10.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel11.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel12.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel13.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel14.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel2.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel3.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel4.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel5.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel6.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel7.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel8.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel9.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/VirtualUniverse.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/VirtualUniverse.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/doc-files/intro.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/intro.gif -------------------------------------------------------------------------------- /src/main/javadoc/org/jogamp/java3d/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | org.jogamp.java3d 7 | 8 | 9 | 10 |

Provides the core set of classes for the 11 | 3D graphics API for the Java platform; click here for more information, 13 | including explanatory material that was formerly found in the guide. 14 |

15 | 16 |

The 3D API is an application 17 | programming interface used for writing three-dimensional graphics 18 | applications and applets. It gives developers high-level constructs for 19 | creating and manipulating 3D geometry and for constructing the 20 | structures used in rendering that geometry. Application developers can 21 | describe very large virtual worlds using these constructs, which 22 | provide the runtime system with enough information to render these worlds 23 | efficiently. 24 |

25 | 26 | 38 | 39 | 40 | 41 | --------------------------------------------------------------------------------