CharacterControl There is no “setMaxSlope(float)” How steep the slopes and steps are that the character can climb without considering them an obstacle. Higher obstacles need to be jumped. Vertical height in world units.
I see 2 ghosts in the screenshot. Which is the one you tried to position?
What convinced you that the setPhysicsLocation() methods did not work correctly?
Did you try printing the results of getPhysicsLocation() after each setPhysicsLocation()?
Please provide the text of a physics-space dump to help me understand what your app is doing:
import jme3utilities.minie.PhysicsDumper;
//...
new PhysicsDumper().dump(physicsSpace);
My understanding is that SetPhysicsLocation is used to adjust the origin position Maybe I misunderstood
You can see that neither CharacterControl nor ghostControl has properly wrapped the model
I need to adjust the CharacterControl and ghostControl origin positions
ghost AABB
Learn about the restrictions on ghosts from Wiki Workaround: + Please use PhysicsSpace.sweepTest() instead, or kinematic physics objects with collision listeners.
Prepare to try this scenario
Either create a new Node and attach your character to that node and offset it inside the node then add CharacterControl to that node.
for example:
Node node = new Node();
node.attachChild(character);
character.move(0, -1, 0);
node.addControl(characterControl);
or, instead use a CompoundCollisionShape and add your collision shape into it with offset:
something like this:
CompoundCollisionShape compoundShape = new CompoundCollisionShape();
compoundShape.addChildShape(new CapsuleCollisionShape(), new Vector3f(0, -1, 0));
CharacterControl control = new CharacterControl(compoundShape, slope);
It’s true that a compound shape doesn’t qualify as a convex shape. However, you can create an offset capsule shape using a two-sphere MultiSphere, and that does qualify as a convex shape.
For instance:
List<Vector3f> centers = new ArrayList<>(2);
centers.add(new Vector3f(0f, 0.5f, 0f));
centers.add(new Vector3f(0f, 1.5f, 0f));
List<Float> radii = new ArrayList<>(2);
radii.add(0.5f);
radii.add(0.5f);
MultiSphere shape = new MultiSphere(centers, radii);