Hi.
I’m using ammoJSPlugin.
I can get contact events between objects, but I can’t get contact points.
It seems that the contact point can be obtained via _tmpAmmoConcreteContactResultCallback.addSingleResult by calling contactPairTest in _isImpostorPairInContact, but the current implementation is as follows, and it is not an implementation that can take the contact point.
I’m having an issue using Ammo with ES6+WebPack. I’ve gotten everything working normally and great and such, but when I get a physics collision fired, an exception is thrown.
For ease of reference, the error is “Ammo is not defined”, and the line/statement that throws this is in the ammoJSPlugin.ts, ln 94: contactPoint = this.bjsAMMO.wrapPointer(contactPoint, Ammo.btManifoldPoint);
Abridged Exception Text:
ammoJSPlugin.ts:94 Uncaught ReferenceError: Ammo is not defined
at OB.AmmoJSPlugin._tmpAmmoConcreteContactResultCallback.addSingleResult (ammoJSPlugin.ts:94)
Not sure why, I’ve verified that the ammo promise has been resolved before calling any physics methods, and I’m injecting the ammo reference in the plugin ctor as usual: let plugin = new AmmoJSPlugin(true, ammoModule);. As well, there doesn’t seem to be any other issues using the physics methods, like applyImpulse and such.
Is this something more likely I’m doing wrong, or is it a potential defect with the code?
ed: here are the relevant imports in the file where I’m seeing this issue, just in case it’s useful:
import { PhysicsHelper } from "@babylonjs/core/Physics/physicsHelper";
import { PhysicsImpostor } from "@babylonjs/core/Physics/physicsImpostor";
import { AmmoJSPlugin } from "@babylonjs/core/Physics/Plugins/ammoJSPlugin";
import "@babylonjs/core/Physics/physicsEngineComponent";
import { ammoModule, ammoReadyPromise } from "../externals/ammoWrapper";
Of course! This doesn’t happen in the PG AFAICT, so here’s the deployed staging site, which is composed from this code repo.
To trigger the repro (in the repos, heh) select play from the main menu. In the next screen, press CTRL to launch the Cargo, DEL or Backspace to reset the simulation. The exception is thrown the moment of contact between the cargo and any of the planets or star.