|
From: <tre...@us...> - 2007-11-17 16:36:37
|
Revision: 588
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=588&view=rev
Author: trevorolio
Date: 2007-11-17 08:36:42 -0800 (Sat, 17 Nov 2007)
Log Message:
-----------
Tweaked the Java3D setup to fall back to aliased, single buffered if the graphics board doesn't support it, which makes us run on lesser machines and also on the Parallels emulator on OS X Intel machines, making life much easier for Macish developers who want to maintain support WinIE.
Used this fact to fix IE+Java quirks (e.g. no String[] passing over liveconnect) so that the majority of browser installations can once again use Ogoglio.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-11-17 16:36:31 UTC (rev 587)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-11-17 16:36:42 UTC (rev 588)
@@ -126,7 +126,11 @@
setCapabilities(sceneRoot);
setCapabilities(usersGroup);
setCapabilities(worldGroup);
- canvas = new J3DCanvas(getGraphicsConfiguration(), offScreen);
+ GraphicsConfiguration graphicsConfig = getGraphicsConfiguration();
+ if (graphicsConfig == null) {
+ throw new IllegalStateException("Cannot create a 3D graphics configuration.");
+ }
+ canvas = new J3DCanvas(graphicsConfig, offScreen);
camera = new J3DCamera();
}
@@ -614,8 +618,8 @@
if (renderable.getUser().getSeat() == null) {
usersGroup.removeChild((J3DUserRenderable) renderable);
} else {
- J3DThingRenderable thingRenderable = (J3DThingRenderable)getThingRenderable(renderable.getUser().getSeat().getThingID());
- thingRenderable.removeSitter((J3DUserRenderable)renderable);
+ J3DThingRenderable thingRenderable = (J3DThingRenderable) getThingRenderable(renderable.getUser().getSeat().getThingID());
+ thingRenderable.removeSitter((J3DUserRenderable) renderable);
}
((J3DUserRenderable) renderable).cleanup();
}
@@ -679,7 +683,7 @@
}
BufferedImage customSkin = null;
- if(!offScreen && !user.getUsername().startsWith(WebConstants.GUEST_COOKIE_PREFIX)){
+ if (!offScreen && !user.getUsername().startsWith(WebConstants.GUEST_COOKIE_PREFIX)) {
customSkin = dataManager.getBodyTexture(user.getUsername(), bodyConfig.getBodyConfigurationID());
}
@@ -733,26 +737,19 @@
return renderable;
}
- private static GraphicsConfiguration getGraphicsConfiguration() {
+ public static GraphicsConfiguration getGraphicsConfiguration() {
GraphicsConfigTemplate3D configTemplate = new GraphicsConfigTemplate3D();
- GraphicsEnvironment graphicsEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
- GraphicsDevice device = graphicsEnv.getDefaultScreenDevice();
- configTemplate.setSceneAntialiasing(GraphicsConfigTemplate.REQUIRED);
- configTemplate.setDoubleBuffer(GraphicsConfigTemplate.REQUIRED);
- return device.getBestConfiguration(configTemplate);
- }
+ configTemplate.setSceneAntialiasing(GraphicsConfigTemplate.PREFERRED);
+ configTemplate.setDoubleBuffer(GraphicsConfigTemplate.PREFERRED);
+ GraphicsConfiguration config = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getBestConfiguration(configTemplate);
+ if (config != null) {
+ return config;
+ }
- /*
- private void setBackgroundColor(Color4f color) {
- background.setColor(color.x, color.y, color.z);
+ GraphicsConfigTemplate3D weakConfigTemplate = new GraphicsConfigTemplate3D();
+ return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
}
- private void addDirectionalLight(Color3f color, Vector3f direction) {
- DirectionalLight lightD1 = new DirectionalLight(color, direction);
- lightD1.setInfluencingBounds(DEFAULT_SPACE_BOUNDS);
- sceneRoot.addChild(lightD1);
- }
- */
public Canvas getCanvas() {
return canvas;
}
@@ -795,10 +792,10 @@
return worldGroup;
}
- public J3DPicker getPicker(){
+ public J3DPicker getPicker() {
return picker;
}
-
+
private final static Vector3d DOWN_VEC = new Vector3d(0.0, -1.0, 0.0);
public class LandHeightMonitor {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|