Little stuff

This commit is contained in:
Thomas FORGIONE 2015-06-15 11:53:53 +02:00
parent f7490e00b0
commit bae2910216
3 changed files with 30 additions and 30 deletions

View File

@ -1,6 +1,6 @@
var fs = require('fs'); var fs = require('fs');
var geo = geo || {}; var geo = {};
geo.MeshStreamer = function(path, callback) { geo.MeshStreamer = function(path, callback) {
this.vertices = []; this.vertices = [];

View File

@ -241,15 +241,15 @@ PointerCamera.prototype.moveHermite = function(otherCamera, toSave) {
} }
PointerCamera.prototype.isColliding = function(direction) { PointerCamera.prototype.isColliding = function(direction) {
this.raycaster.set(this.position, direction.clone().normalize()); // this.raycaster.set(this.position, direction.clone().normalize());
var intersects = this.raycaster.intersectObjects(this.collidableObjects, true); // var intersects = this.raycaster.intersectObjects(this.collidableObjects, true);
for (var i in intersects) { /// for (var i in intersects) {
if (intersects[i].distance < Tools.norm(direction) + this.speed * 300 && /// if (intersects[i].distance < Tools.norm(direction) + this.speed * 300 &&
intersects[i].object.raycastable) { /// intersects[i].object.raycastable) {
return true; /// return true;
} /// }
} /// }
return false; return false;
} }

42
js/prototype/main.js vendored
View File

@ -116,22 +116,22 @@ function initListeners() {
} }
function render() { function render() {
cameraSelecter.update(); // cameraSelecter.update();
// Update recommendations (set raycastable if shown) // // Update recommendations (set raycastable if shown)
var transform = buttonManager.showArrows ? show : hide; // var transform = buttonManager.showArrows ? show : hide;
cameras.map(function(camera) { // cameras.map(function(camera) {
if (camera instanceof RecommendedCamera) { // if (camera instanceof RecommendedCamera) {
transform(camera); // transform(camera);
camera.traverse(function(elt) { // camera.traverse(function(elt) {
elt.raycastable = buttonManager.showArrows; // elt.raycastable = buttonManager.showArrows;
}); // });
} // }
}); // });
// Update coins // Update coins
coins.forEach(function(coin) { coin.update(); }); // coins.forEach(function(coin) { coin.update(); });
// Update main camera // Update main camera
var currentTime = Date.now() - previousTime; var currentTime = Date.now() - previousTime;
@ -139,29 +139,29 @@ function render() {
previousTime = Date.now(); previousTime = Date.now();
// Update the recommendations // Update the recommendations
cameras.update(cameras.mainCamera()); // cameras.update(cameras.mainCamera());
// Set current position of camera // Set current position of camera
cameras.look(); // cameras.look();
var left = 0, bottom = 0, width = container_size.width(), height = container_size.height(); // var left = 0, bottom = 0, width = container_size.width(), height = container_size.height();
renderer.setScissor(left, bottom, width, height); // renderer.setScissor(left, bottom, width, height);
renderer.enableScissorTest(true); // renderer.enableScissorTest(true);
renderer.setViewport(left, bottom, width, height); // renderer.setViewport(left, bottom, width, height);
renderer.render(scene, cameras.mainCamera()); renderer.render(scene, cameras.mainCamera());
// Remove borders of preview // Remove borders of preview
previewer.clear(); // previewer.clear();
// Hide arrows in recommendation // Hide arrows in recommendation
cameras.map(function(camera) { if (camera instanceof RecommendedCamera) hide(camera); }); // cameras.map(function(camera) { if (camera instanceof RecommendedCamera) hide(camera); });
// Update transparent elements // Update transparent elements
// THREEx.Transparency.update(cameras.mainCamera()); // THREEx.Transparency.update(cameras.mainCamera());
// Render preview // Render preview
previewer.render(cameraSelecter.prev, container_size.width(), container_size.height()); // previewer.render(cameraSelecter.prev, container_size.width(), container_size.height());
} }
function animate() { function animate() {