jrouwe / JoltPhysics.js

Port of JoltPhysics to JavaScript using emscripten
MIT License
270 stars 21 forks source link

Add BodyInterface::CreateBodyWithID and Quat::operator* #185

Closed Kazey974 closed 2 weeks ago

Kazey974 commented 4 months ago

Hello, I need CreateBodyWithID to be able to sync my server with my clients :

interface BodyInterface {
    Body CreateBodyWithID([Const, Ref] BodyID inBodyID, BodyCreationSettings inSettings);
}

Also Quat.Mul(Vec3) to rotate a Vec3 would be useful.

jrouwe commented 4 months ago

I've added CreateBodyWith ID in abec58411cd4c840ed82ffc119e04b5e7586da37 (do you build your own version or do you need a release?)

W.r.t. Quat.Mul: Unfortunately webidl only exposes the =, +=, -=, *= operators. I haven't yet found a way to expose the * operator in JS.

Kazey974 commented 4 months ago

Thanks a lot, I will try building it, doesn't sound too complicated.

jrouwe commented 2 weeks ago

I've created a PR in emscripten that allows me to expose Quat::operator *: https://github.com/emscripten-core/emscripten/pull/22770. Let's hope they accept it.