RopeImpostor with ExtrudeShape error

I’m using the Ammo.js Physics Engine with a RopeImpostor, on an ExtrudeShape. The shape by default is given a cap of NO_CAP, but when I try to cap the ExtrudeShape with CAP_START, CAP_END, or CAP_ALL I get the following error.

TypeError: colShape.get_m_cfg is not a function. (In 'colShape.get_m_cfg()', 'colShape.get_m_cfg' is undefined)


  415 | var mass = impostor.getParam("mass");
  416 | impostor._pluginData.mass = mass;
  417 | if (impostor.soft) {
> 418 |     colShape.get_m_cfg().set_collisions(0x11);
^ 419 |     colShape.get_m_cfg().set_kDP(impostor.getParam("damping"));
  420 |     this.bjsAMMO.castObject(colShape, this.bjsAMMO.btCollisionObject).getCollisionShape().setMargin(impostor.getParam("margin"));
  421 |     colShape.setActivationState(AmmoJSPlugin.DISABLE_DEACTIVATION_FLAG);

The documentation says only “path” and “shape” are supported, but I would expect that instead of throwing an error, that the cap parameter would always be set to 0 (regardless of how the user sets the value).

Ideally, I’d like to use RopeImpostor with a capped extrude, even if the caps were ignored by the imposter.

1 Like

I have been fiddling for a time with ‘the Rope’:wink: I’m still not sure of how much ‘the Rope’ is really useable as a Rope. But I found it nice to simply use as an impostor because of its properties. But the visual aspect and also physics behavior of ‘Rope’ did not entirely convince me. And I don’t think there’s a way to add caps, except for creating an anchor both ends and attaching a cap shape to it. I didn’t want to try this since it sounds a bit odd… I coped without the caps for just my purpose (of simply attaching two ropes to a flag).

Adding @Cedric and @RaananW our Physics Masters to double check :slight_smile:

@mawa can you provide a PG for your use case?
It seems Config has been exposed differently in ammojs

And we didn’t update the plugin.

Totally possible following the upgrade last time. Would be great if you can have a look @Cedric :frowning:

I put that on my todo list

1 Like

what do you mean with ‘*my case’? As I said, I did without the caps.
I only found it hard to have my rope behave correctly with my hooks and anchors (and mass, collision with my soft body flag… I was actually just implementing ‘the rope’ the night before the update was done (bloody me, I always kick in where I shouldn’t :wink:

1 Like

PR is live: [physics]Removed irrelevant check on shape extrusion by CedricGuillemet · Pull Request #9829 · BabylonJS/Babylon.js · GitHub

1 Like