I started using JME a while back (I wanted to create a game that could be run on most platforms, with as little porting as possible, plus I wanted accessibility), after moving from Irrlicht in C++. 'Nuff history.
Anyway, recently (last night in fact) I updated my jMP to use the nightly SVN builds (in hopes of fixing a previous problem, which still is not fixed), and after said upgrade and converting my code to use the new CharacterControl instead of PhysicsCharacterNode (or something to that effect, i can’t remember offhand), my model starts doing some strange distortion.
Pre-CharacterControl, it all animated and worked fine, but Post-CharacterControl (after switching everything to the new one), the model distorts when any animation is attempted (I deduced this by commenting out the animations on movement and the stand animation, and the model comes up perfect).
The top image is the model without any animation applied, the bottom is what happens when any animation is applied
I can’t find any reason why this happens (I’ve checked the scaling in 3DS max, I’ve checked all the scaling and channels in the code, nothing is anomalous, and it worked before, so i don’t see why it should pop up now).
Additionally, the model is not taking it’s texture. Thats why it’s all black, I’ve tried using a regular material, created in the code, but that textured the image without it’s UV mapping. I read a topic that advised me to create a custom material and manually edit the mesh.xml to use this material, which i did. After doing this, the model appears all black, no matter the settings of the material (Diffusemaps, Glowmaps, ambient colors etc, everything turns up black).
There is a directional light in the scene, and i’m using the PssMShadowRenderer, which additionally, is not casting shadows after the update (though it was before).
Thanks for any help.
The Character Creation code:
[java]private void createCharacter()
CapsuleCollisionShape capsule = new CapsuleCollisionShape(0.25f,0.25f);
Texture playerSkin = assetManager.loadTexture(“Textures/models/BodyCompleteMap.tga”);
Material TestMat = assetManager.loadMaterial(“Materials/playerMaterial.j3m”);
matPlayer1 = new Material(assetManager, “Common/MatDefs/Misc/ColoredTextured.j3md”);
character = new CharacterControl(capsule,0.1f);
m_char = (Node) assetManager.loadModel(“Models/Body.mesh.xml”);
Light Creation code -
[java]private void createLight()
Vector3f dir = new Vector3f(-0.1f, -0.7f, -1).normalizeLocal();
DirectionalLight dl = new DirectionalLight();
dl.setColor(new ColorRGBA(-1f, -1f, -1f, 1f));
Init Code -
public void simpleInitApp()
niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort);
nifty = niftyDisplay.getNifty();
bulletAppState = new BulletAppState();
invChild = new Node(“invchild”);
c_health = 100;
c_power = 100;
inventory = new int;
items = new String;
bsr = new PssmShadowRenderer(assetManager,1024,4,PssmShadowRenderer.EDGE_FILTERING_DITHER);
Quad mousetrack = new Quad(10,10);
mouseLoc = new Geometry(“mousetracker”,mousetrack);
Material tempMat = new Material(assetManager, “Common/MatDefs/Misc/SolidColor.j3md”);
tempMat.setColor(“m_Color”,new ColorRGBA(0,0,0, (float) 0.75));
Anim controller -
[java]private void setupAnimationController()
animationControl = m_char.getControl(AnimControl.class);
animationChannel = animationControl.createChannel();
Anims in SimpleUpdate -
[java]if(walkDirection.length() == 0)
if(airTime > .6f)