I'm trying to create a heightfield in a class using the official example as a reference.
For some reason though I'm getting a Memory access out of bounds Error:
I created a super simple version with no field creation and it's still throwing the error:
public addHeightfield() {
const position = new Jolt.Vec3(0, -20, 0); // The image tends towards 'white', so offset it down closer to zero
const quaternion = new Jolt.Quat(0, 0, 0, 1);
const shapeSettings = new Jolt.HeightFieldShapeSettings();
const shape = shapeSettings.Create().Get();
const creationSettings = new Jolt.BodyCreationSettings(
shape,
position,
quaternion,
Jolt.EMotionType_Static,
Layer.NON_MOVING,
);
const body = this.bodyInterface.CreateBody(creationSettings);
Jolt.destroy(shapeSettings);
return body;
}
It only fires on the const body = this.bodyInterface.CreateBody(creationSettings); line.
However, if I replace the shape with a simple BoxShape I get no errors.
I can't see anything obvious.. My quick guess is that I'm missing something required for the heightfield and something is/should be throwing inside jolt and this memory error is just what I can see in js land.
I'm on jolt-physics 0.19 and the WASM embedded with import Jolt from 'jolt-physics';
I'm trying to create a heightfield in a class using the official example as a reference.
For some reason though I'm getting a
Memory access out of bounds
Error:I created a super simple version with no field creation and it's still throwing the error:
It only fires on the
const body = this.bodyInterface.CreateBody(creationSettings);
line. However, if I replace the shape with a simpleBoxShape
I get no errors.I can't see anything obvious.. My quick guess is that I'm missing something required for the heightfield and something is/should be throwing inside jolt and this memory error is just what I can see in js land.
I'm on
jolt-physics 0.19
and the WASM embedded withimport Jolt from 'jolt-physics';