From the Babylon.js source shown below:
static readToRef(buffer: any, offset: number, eventOut: CollisionEvent) {
const intBuf = new Int32Array(buffer, offset);
const floatBuf = new Float32Array(buffer, offset);
const offA = 2;
eventOut.contactOnA.bodyId = BigInt(intBuf[offA]); //<todo Need to get the high+low words!
eventOut.contactOnA.position.set(floatBuf[offA + 8], floatBuf[offA + 9], floatBuf[offA + 10]);
eventOut.contactOnA.normal.set(floatBuf[offA + 11], floatBuf[offA + 12], floatBuf[offA + 13]);
const offB = 18;
eventOut.contactOnB.bodyId = BigInt(intBuf[offB]);
eventOut.contactOnB.position.set(floatBuf[offB + 8], floatBuf[offB + 9], floatBuf[offB + 10]);
eventOut.contactOnB.normal.set(floatBuf[offB + 11], floatBuf[offB + 12], floatBuf[offB + 13]);
eventOut.impulseApplied = floatBuf[offB + 13 + 3];
eventOut.type = intBuf[0];
}
we can see that the contact point
- world position is located at floats # 8 - 10
- normal is located at floats # 11 - 13
Would anyone know what data is located at floats # 2 - 7, # 13 - 15?
I’m looking for the local position of the contact point (different from the world position). Ammo
provides both types of positions in its contact points, so I thought that some of these unknown floats may be the local position
@eoin @Cedric Apologies for the ping, I believe you have the expertise here
Also, I was really curious about the comment //<todo Need to get the high+low words!
. If you could please share, what is the meaning of these high+low words?