Ammo Character Collider

https://playground.babylonjs.com/#79HPX7#5

So what would be the best way to ensure that there is less “slide” with the sphere imposter that the camera is attached to?

Im using Ammo. I thought there was some specific way ammo calculates its rolling friction. Maybe I can dampen that? wsad controls

Any chance for a SIMPLE playground, P8? (good to see u btw, hope ur well)

Top of head… change to box for more surface area for friction to work better, or search forum for “leather” to find @RaananW’s Leather Boot professional damping system. :wink:

1 Like

The only part you need to worry about is lines 35-45.

:slight_smile: nice to see you too bud! been good. been busy.

But my coffee got cold… while waiting for load to finish. :slight_smile:

That’s odd, it shouldn’t. Might of been a PG loading thing not the scene.

The scene should compile really fast.

I was hoping setDamping would work, but its not seeming to do the trick.

About 25 seconds, even 2nd load without any cache-clear in-between. PBR = pig.

What kinda rig you got? Im interested now, cause I have a toaster and it loads in like fractions of a second for me.

So maybe there is something in my code.

ohh is it the reflectionTexture, I could prolly programmatically generate that too. to save that from loading.

1 Like

Are you sure cameraRoot.body.physicsBody.setDamping(0.0,1) is working? Tested well?

(oh, you already commented on that, sorry)

umm… I have 12 year old Dell Inspiron… win 7… pretty good internet. This unit plays GTA 5 nicely, podracer, mudrunner, fsx with no scenery extras. Dunno how else to describe.

I think its the reflectionTexture bogging on the load.

So when we say we have ammo js as a physics plugin… how much of it do we really have?

Because I am looking at the classes from bullet which ammo is supposed to be a direct port of it, and I have a bunch of methods that seem to not work on the btRigidBody, maybe Im just doing things wrong.

You are… hehe. (j/k) Don’t confuse AmmoPlugin with Ammo PE. AmmoPlugin was designed to sort-of “mirror” the power and features of the other 2 plugins. As far as “added value” on Ammo plugin… not sure there is any (such as soft Body). Look at docs… JohnK and the boys DID write some stuff for softbody and rope impostors… did it well… but MAYBE not seen on the plugin. Maybe need to go native to operate. But ammo PE… is exact full-featured native engine, afaik.

Also, BJS physics IMPOSTOR class and physics ENGINE class… are the same for all three PE’s, I believe. By doing that, we might lose some features from Ammo, because… BJS impostor class is a bit too “dumb” to handle all of Ammo’s power. I don’t think anyone wrote a special PI class just for Ammo… and thus… our current PI class doesn’t do softbodies, I believe. Must go native to use… not activate-able at BJS plugin, PI, or PE class layers.

Add lots of Ammo power to BJS plugin, PI, or PE layers, and those objects no longer mirror the plugin, PI, or PE API’s of the earlier PE’s (Oimo and Cannon). That’s my take on it all. :slight_smile:

but you can access those methods if you pass the right values it looks like

cameraRoot.body.physicsBody.applyCentralImpulse(new physicsPlugin.bjsAMMO.btVector3(0, 10, 0))

Yeah, that’s native-level talk… not experienced with that. Sorry. Certainly doesn’t look-like Cannon or Oimo native, but that’s expected.

Not sure that bs is needed.

Maybe just new bjsAMMO.btVector3(0, 10, 0) or new AMMO.btVector3(0, 10, 0)

Like I’d know. Done playground in-code searches for pertinent keywords? Wise.

Wingnut was well-wrong on that. I did some touring of the AmmoJS plugin this morning, and it has many features specifically designed-for AmmoJS. Sorry for misleading on that. Wingnut not paying proper attention. :confused:

I’m sniffing your bug report, P8.

Wingy’s test PG: https://www.babylonjs-playground.com/#9NMQVY#8 Hit any key to drop the cover. Adjusters in lines 27-30 - for setting differing amounts of x/y subdivs.

Studying the issue, trying to determine what the story is. Lightly pondering… Babylon.js/ammoJSPlugin.ts at master · BabylonJS/Babylon.js · GitHub (two segments params - perhaps should be xSegments and ySegments?) (wild speculating) :slight_smile:

Adding @Cedric just in case he can shine some lights on the issue.

First parameter for setDamping is for velocity, second is for torque.
I replaced the 0 for velocity with 0.999, increased the maxspeed and it gives less momentum movements:
https://playground.babylonjs.com/#79HPX7#59
drawback is it fells way slower now.
Another way is to increase the friction value, decrease the restitution.
You’ll have to tweak the velocity but it shouldn’t be too hard:
https://playground.babylonjs.com/#79HPX7#60

I ended up figuring it out. Did some experiments with ammos Kinematic controller which sucks horribly… Ended up going with my own controller.

Ill post a cooler version once I am done with my work for the week hopefully. but here is a “working” prototype.
https://playground.babylonjs.com/#79HPX7#55

@Cedric helped me out a little and it made me realize that sometimes you just gotta do yourself.