Quantcast
Channel: Bugs Latest Topics
Viewing all articles
Browse latest Browse all 760

OimoJSPlugin's setLinearVelocity is incorrect

$
0
0

I tried to create a sample using OimoJSPlugin.

http://jsdo.it/cx20/IVHj

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);
        }

 


Viewing all articles
Browse latest Browse all 760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>