Hello,
i can’t see the CapsuleCollisionShape which should be at position (0,0,0), although i enabled the Debug-view of the Phyiscs Space.
[java]
import com.jme3.app.SimpleApplication;
import com.jme3.bullet.BulletAppState;
import com.jme3.bullet.PhysicsSpace;
import com.jme3.bullet.collision.shapes.CapsuleCollisionShape;
import com.jme3.bullet.control.CharacterControl;
import com.jme3.math.Vector3f;
public class Post4 extends SimpleApplication{
BulletAppState bulletAppState;
PhysicsSpace phySpace;
CapsuleCollisionShape p1CapsuleShape;
CharacterControl p1char;
@Override
public void simpleInitApp() {
//init physics
bulletAppState = new BulletAppState();
stateManager.attach(bulletAppState);
phySpace = bulletAppState.getPhysicsSpace();
phySpace.enableDebug(assetManager);
phySpace.setGravity(Vector3f.ZERO);
//init CapsuleShape
p1CapsuleShape = new CapsuleCollisionShape(3f, 3f, 1);
p1char = new CharacterControl(p1CapsuleShape, 0);
p1char.setPhysicsLocation(new Vector3f(0, 0, 0));
phySpace.add(p1char);
}
public static void main(String[] args) {
Post4 p = new Post4();
p.start();
}
}
[/java]
What is wrong here ?
No spatial, no view.
Ok so, for CharacterControl Objects it is not possible to see their Debug-View. Thanks
Wrong, just attach it to a spatial.
attachChild is undefined for object CharacterControl
[java]
Spatial p1node = new Node();
p1node.attachChild(p1char);
[/java]
Did you read the manual at all? Controls are attached to spatials, not the other way round.
[java]
p1node.addControl(p1char);
rootNode.attachChild(p1node);
[/java]
Why is this thing falling? i set the gravity to Zero. Setting Fallspeed to 0 does the trick, but gravity is 0.
Because of reasons.
ok anyways
@kaaltek said:
ok anyways
The manual explains it. The character doesn't use the gravity of the physics space.
youre the best man thank you