From 0316bec713294ae39496c682f52b065af4cf89aa Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Tue, 16 Aug 2011 19:08:57 +0000 Subject: [PATCH] SkyFactory : you can now specify the sky sphere radius when creating a sky to avoid near plane clipping when it's set too close to the radius value. see this post http://jmonkeyengine.org/groups/graphics/forum/topic/why-is-the-skybox-culling-when-i-adjust-my-camera-frustum/#post-139378 git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8023 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/util/SkyFactory.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/engine/src/core/com/jme3/util/SkyFactory.java b/engine/src/core/com/jme3/util/SkyFactory.java index 0f577b412..15e99903b 100644 --- a/engine/src/core/com/jme3/util/SkyFactory.java +++ b/engine/src/core/com/jme3/util/SkyFactory.java @@ -16,11 +16,14 @@ import com.jme3.texture.TextureCubeMap; public class SkyFactory { - private static final Sphere sphereMesh = new Sphere(10, 10, 10, false, true); - - public static Spatial createSky(AssetManager assetManager, Texture texture, Vector3f normalScale, boolean sphereMap){ + + public static Spatial createSky(AssetManager assetManager, Texture texture, Vector3f normalScale, boolean sphereMap){ + return createSky(assetManager, texture, normalScale, sphereMap, 10); + } + public static Spatial createSky(AssetManager assetManager, Texture texture, Vector3f normalScale, boolean sphereMap, int sphereRadius){ if (texture == null) throw new IllegalArgumentException("texture cannot be null"); + final Sphere sphereMesh = new Sphere(10, 10, sphereRadius, false, true); Geometry sky = new Geometry("Sky", sphereMesh); sky.setQueueBucket(Bucket.Sky); @@ -74,6 +77,11 @@ public class SkyFactory { } public static Spatial createSky(AssetManager assetManager, Texture west, Texture east, Texture north, Texture south, Texture up, Texture down, Vector3f normalScale){ + return createSky(assetManager, west, east, north, south, up, down, normalScale, 10); + } + + public static Spatial createSky(AssetManager assetManager, Texture west, Texture east, Texture north, Texture south, Texture up, Texture down, Vector3f normalScale, int sphereRadius){ + final Sphere sphereMesh = new Sphere(10, 10, sphereRadius, false, true); Geometry sky = new Geometry("Sky", sphereMesh); sky.setQueueBucket(Bucket.Sky); sky.setCullHint(Spatial.CullHint.Never);