I tried to create a sample using OimoJSPlugin.
However, the following error occurred.
Uncaught TypeError: impostor.physicsBody.linearVelocity.init is not a function
at OimoJSPlugin.setLinearVelocity (babylon.max.js:85118)
at PhysicsImpostor.setLinearVelocity (babylon.max.js:83249)
at IVHj:264
at Array.forEach (<anonymous>)
at Observer.callback (IVHj:260)
at Observable.notifyObservers (babylon.max.js:8294)
at Scene.render (babylon.max.js:27859)
at IVHj:78
at Engine._renderLoop (babylon.max.js:12784)
Perhaps linearVelocity and angularVelocity should use the set function, not the init function.
public setLinearVelocity(impostor: PhysicsImpostor, velocity: Vector3) {
//impostor.physicsBody.linearVelocity.init(velocity.x, velocity.y, velocity.z); // init() is undefined
impostor.physicsBody.linearVelocity.set(velocity.x, velocity.y, velocity.z);
}
public setAngularVelocity(impostor: PhysicsImpostor, velocity: Vector3) {
//impostor.physicsBody.angularVelocity.init(velocity.x, velocity.y, velocity.z); // init() is undefined
impostor.physicsBody.angularVelocity.set(velocity.x, velocity.y, velocity.z);
}