Heya,
I’m kinda new to JMonkey and i need to ask you the first question about JME. I hope someone can help me
So here’s the problem: I have loaded player model made in Blender, where I set my model pivot point (0,0,0 in Blend) would be the space between ankles. Then I loaded it to JME, and everything works fine. But when I add CapsuleCollisionShape to its CharacterController, this physics shape has center in 0,0,0, which does not fit! I want to ask you if there is any other possibility to change collisionshape location than changing pivot point in blender.
Problem Screen:
http://desmond.imageshack.us/Himg521/scaled.php?server=521&filename=shapeproblem.jpg&res=medium
Thanks for any kind of help.
Alternatively you can edit the model in blender and move it downwards, remember to apply using Ctrl-A
I wanted it to work programmatically, and normen advice works. But thanks to both of you
I have some other problem with making this working, here is the thing:
I have modelHandler Node to which connected is CharacterController. A child of modelHander is my spatial. I use Control class to make my player work, and when i try to move him:
[java]@Override
protected void controlUpdate( float tpf )
{
Vector3f walkDir = new Vector3f(0,0,0);
if( up )
{
Vector3f forward = new Vector3f( 0,0,-1*tpf );
modelHandler.localToWorld(forward, forward);
walkDir.addLocal(forward);
}
charControl.setWalkDirection(walkDir);
}[/java]
The direction is working good i think, but it seems like each frame the movement speed is multiplied (i don’t know), but for sure it is not constant. Maybe I’ am doing something wrong. My floor is a RigidBody (MeshShape) with mass 0.0F, and my player CharacterController (CapsuleShape) with mass 0.4F.
Each time it is even not facing the same direction …
This is what i mean:
http://youtu.be/FmiAtCDAtaI
walkDirection is not framerate dependent, none of the physics parameters are.
Any solution advice?
don’t make it framerate dependent… take out the tpf
It’s still working like the speed is adding each frame and it’s faster each frame, and why each time I execute this it is facing other direction… Hmm
why you do that localToWorld thing? I guess its not faster each frame but faster the further it is away from the center.
I figured it out, but thanks normen for help.