Getting btKinematicCharacterController to work in Ammo.js
I think the last issue was closed and btKinematicCharacterController was supposed to work...
Can you please show me how to use in btKinematicCharacterController in Ammo.js
I tried attaching to the the collision shape and it looks like i t works ... but i got no movement or jumping if i call jump or setWalkDirection.
Here is how i am attaching the chracter controller using babylon.js collision shape:
const worldMin:any = Ammo.btVector3(-1000,-1000,-1000);
const worldMax:any = Ammo.btVector3(1000,1000,1000);
this.m_overlappingPairCache = new Ammo.btAxisSweep3(worldMin, worldMax);
console.log(this.m_overlappingPairCache);
const collisionShape:any = this._abstractMesh.physicsImpostor.physicsBody.getCollisionShape();
console.log(collisionShape);
const startTransform:any = new Ammo.btTransform();
console.log(startTransform);
startTransform.setIdentity();
startTransform.setOrigin(new Ammo.btVector3(0.0, 0.0, 0.0));
this.m_ghostObject = new Ammo.btPairCachingGhostObject();
this.m_ghostObject.setWorldTransform(startTransform);
this.m_overlappingPairCache.getOverlappingPairCache().setInternalGhostPairCallback(new Ammo.btGhostPairCallback());
this.m_ghostObject.setCollisionShape(collisionShape);
this.m_ghostObject.setCollisionFlags(BABYLON.CollisionFlags.CF_CHARACTER_OBJECT);
console.log(this.m_ghostObject);
const stepHeight:number = 0.35;
this.m_character = new Ammo.btKinematicCharacterController(this.m_ghostObject, collisionShape, stepHeight);
console.log(this.m_character);
(<any>window).player = this.m_character;
console.warn("player check");
console.log((<any>window).player);
Now errors... just does not move by me simply calling setWalkDirection... Am i support to tick the character controller some how or what ???
Yo @kripken ... Please help a brotha out :)
Sorry, I actually don't know the Bullet API well myself. I just port it...
I figured it out ... but we need the get getOverlappingPairCache function added to ammo. Idl for both the btBroadfaceInterface and btAxisSweep3
I figured it out ... but we need the get getOverlappingPairCache function added to ammo. Idl for both the btBroadfaceInterface and btAxisSweep3
Do you mind spilling the beans on how you got it working? Would be a lot of help for me