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

how to move a object in cannon.js ?? #473

Closed Padmanabh82 closed 2 years ago

Padmanabh82 commented 2 years ago

and is it ok to change quaternion directly ???

world.step(1 / 60);

  car.cannon.quaternion.z = target.car.quaternion.setFromEuler(new THREE.Euler(0, 0, angle)).z
  car.cannon.quaternion.w = target.car.quaternion.setFromEuler(new THREE.Euler(0, 0, angle)).w