From mixed convetion (_, and camel case) to all camel case

This commit is contained in:
Thomas FORGIONE
2015-08-28 21:34:29 +02:00
parent f136ce833f
commit 74cad3824b
40 changed files with 323 additions and 312 deletions

View File

@@ -1,7 +1,7 @@
var BouncingCube = function(size, style) {
L3D.Cube.call(this, size, style);
this.fixed_center = new THREE.Vector3();
this.fixedCenter = new THREE.Vector3();
this.center = new THREE.Vector3();
this.speed = new THREE.Vector3(0,0,300);
@@ -11,13 +11,13 @@ BouncingCube.prototype.constructor = BouncingCube;
BouncingCube.prototype.update = function() {
// Compute new center
var speed_clone = this.speed.clone();
speed_clone.multiply(BouncingCube.DT);
var speedClone = this.speed.clone();
speedClone.multiply(BouncingCube.DT);
this.speed.add(BouncingCube.G);
if (this.speed.dot(this.speed) > 100) {
this.center.add(speed_clone);
this.center.add(speedClone);
}
if (this.center.z < 0) {

View File

@@ -1,10 +1,10 @@
var renderer, scene, camera, controls, cube, container, plane, mouse= {x:0, y:0};
var raycaster;
var objects = [];
var container_size = {};
var containerSize = {};
var previousTime;
container_size.width = 1067;
container_size.height = 600;
containerSize.width = 1067;
containerSize.height = 600;
init();
animate();
@@ -12,10 +12,10 @@ animate();
function init() {
// on initialise le moteur de rendu
container = document.getElementById('container');
container.style.height = container_size.height + 'px';
container.style.width = container_size.width + 'px';
container.style.height = containerSize.height + 'px';
container.style.width = containerSize.width + 'px';
renderer = new THREE.WebGLRenderer({alpha:"true"});
renderer.setSize(container_size.width, container_size.height);
renderer.setSize(containerSize.width, containerSize.height);
renderer.shadowMapEnabled = true;
document.getElementById('container').appendChild(renderer.domElement);
@@ -24,16 +24,16 @@ function init() {
raycaster = new THREE.Raycaster();
// init light
var directional_light = new THREE.DirectionalLight(0xffffff);
directional_light.position.set(1, 0.5, 1).normalize();
directional_light.castShadow = true;
scene.add(directional_light);
var directionalLight = new THREE.DirectionalLight(0xffffff);
directionalLight.position.set(1, 0.5, 1).normalize();
directionalLight.castShadow = true;
scene.add(directionalLight);
var ambient_light = new THREE.AmbientLight(0x444444);
scene.add(ambient_light);
var ambientLight = new THREE.AmbientLight(0x444444);
scene.add(ambientLight);
// on initialise la camera que lon place ensuite sur la scène
camera = new L3D.Camera(50, container_size.width / container_size.height, 1, 10000);
camera = new L3D.Camera(50, containerSize.width / containerSize.height, 1, 10000);
scene.add(camera);
window.addEventListener('resize', onWindowResize, false);