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
This commit is contained in:
parent
9bd9e1dc08
commit
0316bec713
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user