var c = new function () {
this.cameraY = 7.2;
this.cameraZ = 6.3;
this.LookatY = 0;
this.LookatZ = 0;
this.zoom = 1;
this.disdanceHalf = 5
this.forceFactor = 100
this.ballRad = 2/2
this.canRad = 2/2
this.canHeight = 2*2
this.massBall = 5,
this.massCan = 10;
this.go = function() {
initScene()
console.log('c=', c)
}
};
var gui = new dat.GUI();
gui.add(c, 'cameraY', 0, 100).onChange(function(y){
camera.position.y = y;
camera.updateProjectionMatrix ()
});
gui.add(c, 'cameraZ', 0, 100).onChange(function(z){
camera.position.z = z;
camera.updateProjectionMatrix ()
});
gui.add(c, 'LookatY', 0, 100).onChange(function(y){
camera.lookAt(0, y, c.LookatZ)
camera.updateMatrixWorld();
console.log('y z',c.LookatY, c.LookatZ)
});
gui.add(c, 'LookatZ', 0, 100).onChange(function(z){
camera.lookAt(0, c.LookatY, z)
camera.updateMatrixWorld();
console.log('y z',c.LookatY, c.LookatZ)
});
gui.add(c, 'zoom', 0, 10).onChange(function(z){
camera.zoom = z
camera.updateProjectionMatrix();
});
gui.add(c, 'disdanceHalf', 5, 50);
gui.add(c, 'forceFactor', 50, 200);
gui.add(c, 'ballRad', 0, 20);
gui.add(c, 'canRad', 0, 20);
gui.add(c, 'canHeight', 0, 20);
gui.add(c, 'massBall', 0, 20);
gui.add(c, 'massCan', 0, 20);
gui.add(c, 'go');