I created this scene last night, and whilst it was working well, today the objects do not display well. Any help please?
[java]
/*
- To change this template, choose Tools | Templates
- and open the template in the editor.
*/
package mygame;
import com.jme3.bullet.collision.shapes.CollisionShape;
import com.jme3.asset.AssetManager;
import com.jme3.bullet.BulletAppState;
import com.jme3.bullet.collision.shapes.SphereCollisionShape;
import com.jme3.bullet.control.CharacterControl;
import com.jme3.bullet.control.RigidBodyControl;
import com.jme3.bullet.util.CollisionShapeFactory;
import com.jme3.input.ChaseCamera;
import com.jme3.light.AmbientLight;
import com.jme3.light.DirectionalLight;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.Camera;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Box;
/**
*
-
@author Mamo
*/
public class Setup {
Spatial playerSpatial;
Geometry playerGeom;
CharacterControl player;
RigidBodyControl rigidBodyControl;
ChaseCamera chaseCam;
public void createPlayer(AssetManager assetManager, Node rootNode){
playerSpatial= assetManager.loadModel(“Models/Box001/Box001.j3o”);
Box playerB = new Box(new Vector3f(0,0,0), 1, 1, 1);
playerGeom = new Geometry(“Player”, playerB);
playerGeom.setMaterial(assetManager.loadMaterial(“Materials/Player.j3m”));
rootNode.attachChild(playerGeom);
rootNode.attachChild(playerSpatial);
}
public void physics(BulletAppState bulletAppState){
SphereCollisionShape capsuleShape = new SphereCollisionShape(1f);
player = new CharacterControl(capsuleShape, 0.1f);
player.setPhysicsLocation(new Vector3f(0, 0, 0f));
bulletAppState.getPhysicsSpace().add(player);
CollisionShape sceneShapeG = CollisionShapeFactory.createMeshShape(playerSpatial);
rigidBodyControl = new RigidBodyControl(sceneShapeG, 0);
playerSpatial.addControl(rigidBodyControl);
bulletAppState.getPhysicsSpace().add(player);
player.setGravity(0);
player.setFallSpeed(40);
}
public void light(Node rootNode){
AmbientLight al = new AmbientLight();
al.setColor(ColorRGBA.White.mult(4f));
rootNode.addLight(al);
DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f).normalizeLocal());
rootNode.addLight(dl);
}
public void camera(Camera cam){
chaseCam = new ChaseCamera(cam, playerGeom);
chaseCam.setDefaultHorizontalRotation(0);
chaseCam.setDefaultVerticalRotation(1.5f);
chaseCam.setLookAtOffset(new Vector3f(0, 0, 0));
chaseCam.setChasingSensitivity(0f);
chaseCam.setDefaultDistance(75);
}
}
[/java]
It’s also worth noting that the statistics do not show.
The following is the full log:
init:
Deleting: C:UsersMamoDocumentsjMonkeyProjectsStealthbuildbuilt-jar.properties
deps-jar:
Updating property file: C:UsersMamoDocumentsjMonkeyProjectsStealthbuildbuilt-jar.properties
Compiling 1 source file to C:UsersMamoDocumentsjMonkeyProjectsStealthbuildclasses
compile:
run:
Dec 1, 2011 5:19:47 PM com.jme3.system.JmeSystem initialize
INFO: Running on jMonkeyEngine 3.0.0 Beta
Dec 1, 2011 5:19:47 PM com.jme3.system.Natives extractNativeLibs
INFO: Extraction Directory: C:UsersMamoDocumentsjMonkeyProjectsStealth
Dec 1, 2011 5:19:47 PM com.jme3.system.lwjgl.LwjglAbstractDisplay run
INFO: Using LWJGL 2.8.2
Dec 1, 2011 5:19:47 PM com.jme3.system.lwjgl.LwjglDisplay createContext
INFO: Selected display mode: 640 x 480 x 0 @0Hz
Dec 1, 2011 5:19:47 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Adapter: nvd3dumx,nvwgf2umx,nvwgf2umx
Dec 1, 2011 5:19:47 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Driver Version: 8.17.12.8562
Dec 1, 2011 5:19:47 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Vendor: NVIDIA Corporation
Dec 1, 2011 5:19:47 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: OpenGL Version: 3.3.0
Dec 1, 2011 5:19:47 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: Renderer: GeForce 9800 GT/PCI/SSE2
Dec 1, 2011 5:19:47 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: GLSL Ver: 3.30 NVIDIA via Cg compiler
Dec 1, 2011 5:19:47 PM com.jme3.system.lwjgl.LwjglTimer
INFO: Timer resolution: 1,000 ticks per second
Dec 1, 2011 5:19:47 PM com.jme3.renderer.lwjgl.LwjglRenderer initialize
INFO: Caps: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample, TextureMultisample, OpenGL20, OpenGL21, OpenGL30, OpenGL31, OpenGL32, ARBprogram, GLSL100, GLSL110, GLSL120, GLSL130, GLSL140, GLSL150, VertexTextureFetch, TextureArray, TextureBuffer, FloatTexture, FloatColorBuffer, FloatDepthBuffer, PackedFloatTexture, SharedExponentTexture, PackedFloatColorBuffer, TextureCompressionLATC, NonPowerOfTwoTextures, MeshInstancing, VertexBufferArray]
Dec 1, 2011 5:19:47 PM com.jme3.asset.DesktopAssetManager
INFO: DesktopAssetManager created.
Dec 1, 2011 5:19:47 PM com.jme3.renderer.Camera
INFO: Camera created (W: 640, H: 480)
Dec 1, 2011 5:19:47 PM com.jme3.renderer.Camera
INFO: Camera created (W: 640, H: 480)
Dec 1, 2011 5:19:47 PM com.jme3.input.lwjgl.LwjglMouseInput initialize
INFO: Mouse created.
Dec 1, 2011 5:19:47 PM com.jme3.input.lwjgl.LwjglKeyInput initialize
INFO: Keyboard created.
Dec 1, 2011 5:19:47 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: AudioRenderer supports 64 channels
Dec 1, 2011 5:19:47 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio effect extension version: 1.0
Dec 1, 2011 5:19:47 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio max auxilary sends: 4
Dec 1, 2011 5:19:47 PM com.jme3.material.MaterialDef
INFO: Loaded material definition: Unshaded
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Gui Node)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (BitmapFont) attached to this node (null)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (null) attached to this node (Statistics View)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (Statistics View) attached to this node (Gui Node)
Dec 1, 2011 5:19:47 PM com.jme3.scene.Node attachChild
INFO: Child (Box) attached to this node (Root Node)
Dec 1, 2011 5:19:48 PM com.jme3.material.MaterialDef
INFO: Loaded material definition: Phong Lighting
Dec 1, 2011 5:19:48 PM com.jme3.scene.Node attachChild
INFO: Child (Player) attached to this node (Root Node)
Dec 1, 2011 5:19:48 PM com.jme3.scene.Node attachChild
INFO: Child (Box001-ogremesh) attached to this node (Root Node)
Dec 1, 2011 5:19:48 PM com.jme3.bullet.PhysicsSpace addCharacter
INFO: Adding character com.bulletphysics.collision.dispatch.PairCachingGhostObject@7d858aa0 to physics space.
Dec 1, 2011 5:19:48 PM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation
INFO: Uniform m_VertexColor is not declared in shader [ShaderSource[name=Common/MatDefs/Misc/Unshaded.vert, defines, type=Vertex], ShaderSource[name=Common/MatDefs/Misc/Unshaded.frag, defines, type=Fragment]].
Dec 1, 2011 5:19:55 PM com.jme3.renderer.lwjgl.LwjglRenderer cleanup
INFO: Deleting objects and invalidating state
Dec 1, 2011 5:19:55 PM com.jme3.input.lwjgl.LwjglMouseInput destroy
INFO: Mouse destroyed.
Dec 1, 2011 5:19:55 PM com.jme3.input.lwjgl.LwjglKeyInput destroy
INFO: Keyboard destroyed.
Dec 1, 2011 5:19:55 PM com.jme3.system.lwjgl.LwjglAbstractDisplay deinitInThread
INFO: Display destroyed.
BUILD SUCCESSFUL (total time: 11 seconds)