capsule tilts and falls! how to disable tilt if you move?
var merged = new THREE.Geometry();
var cyl = new THREE.CylinderGeometry(2, 2, 6);
var top = new THREE.SphereGeometry(2);
var bot = new THREE.SphereGeometry(2);
var matrix = new THREE.Matrix4();
matrix.makeTranslation(0, 3, 0);
top.applyMatrix(matrix);
var matrix = new THREE.Matrix4();
matrix.makeTranslation(0, -3, 0);
bot.applyMatrix(matrix);
merged.merge(top);
merged.merge(bot);
merged.merge(cyl);
var capsule = new Physijs.CapsuleMesh(
merged,
new THREE.MeshBasicMaterial({color: Math.random() * 0xffffff }),
0.1
);
capsule.position.set(100, 220, 0 );
capsule.scale.set(10, 10, 10);
objectToEdit = capsule;
scene.add(capsule);
capsule tilts and falls! how to disable tilt if you move?
Move: objectToEdit.setLinearVelocity({x: objectToEdit.getLinearVelocity().x, y: objectToEdit.getLinearVelocity().y, z: objectToEdit.getLinearVelocity().z + 25}) `
the capsule tilts and falls! how to disable tilt if you move?