schteppe / cannon.js

A lightweight 3D physics engine written in JavaScript.
http://schteppe.github.com/cannon.js
MIT License
4.63k stars 700 forks source link

Please update those example with new three.js, please #344

Open x1911 opened 6 years ago

x1911 commented 6 years ago

@schteppe i like you cannon.js and try to learn it and want to use it in my project,

but it has error message with the three.js new version, which is r87

i just new in cannon.js, and still learn from the examples,

can you please update those examples, so we can use it

thank you thank you very much.

BTW: i tried to use Three.JSONLoader for THREE.SkinnedMesh,

but i dosent work, and get diffrent error message with diffrent version of threejs

x1911 commented 6 years ago
        var projector = new THREE.Projector();
        function getShootDir(targetVec){
            var vector = targetVec;
            targetVec.set(0,0,1);
            projector.unprojectVector(vector, camera);
            var ray = new THREE.Ray(sphereBody.position, vector.sub(sphereBody.position).normalize() );
            targetVec.copy(ray.direction);

in console it shows 'THREE.Projector has been moved to /examples/js/renderers/Projector.js.'

how can we change here for right?

x1911 commented 6 years ago

use Three.JSONLoader to load THREE.SkinnedMesh, get the error

Uncaught TypeError: Cannot read property 'center' of undefined

this error would't show in three js page

soalribeiro commented 5 years ago

Did you manage to correct this error? I'm having it now