-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
Speaking of which, I am curious if we could pass vertex and index typed arrays/buffers directly to avoid copying data. I know that wasm_bindgen supports it, but not sure about Emscripten. |
Beta Was this translation helpful? Give feedback.
-
There are a number of things wrong with this line:
This just seems to work for me (but maybe you can give me a full example that I can just load directly to repro).
That's fine. In C++ you inherit from PhysicsMaterial to add additional custom properties, but in JavaScript you can add any property you like so no need for inheritance.
Yes, this is an unfortunate side effect of the way WebIDL/Emscripten works. In C++ you can create different overloads for the same function as long as the types are clear, but in JavaScript you have to differentiate between the number of parameters. So if I make both functions have an optional PhysicsMaterialList then the 2nd function complains:
On the C++ side this class uses a move operation, so it normally doesn't copy the data. How that works with JavaScript I'm not sure. What I can do is to expose the default constructor and expose the internal members so you can directly add the data there. |
Beta Was this translation helpful? Give feedback.


There are a number of things wrong with this line:
new Jolt.MeshShapeSettings(tList)should benew Jolt.MeshShapeSettings(tList).Create().Get()new Jolt.Vec3()creates an uninitialized vector, you need to useJolt.Vec3.prototype.sZero()ornew Jolt.Vec3(0, 0, 0)new Jolt.Quat(), you need to useJolt.Quat.prototype.sIdentity()ornew Jolt.Quat(0, 0, 0, 1)