Skip to content

Commit

Permalink
Update build + small fix when switching between camera pivot mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephomi committed Sep 12, 2013
1 parent 47273fb commit 5ae8d6e
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 46 deletions.
2 changes: 1 addition & 1 deletion build/cache.manifest
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CACHE MANIFEST
# 16-08-2013 04:50
# 12-09-2013 08:05

index.html

Expand Down
2 changes: 1 addition & 1 deletion build/sculptgl/cache.manifest
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CACHE MANIFEST
# 16-08-2013 04:50
# 12-09-2013 08:00

index.html

Expand Down
74 changes: 38 additions & 36 deletions build/sculptgl/sculptgl.min.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions gui/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ Gui.prototype = {
var ctrlPivot = cameraFold.add(main.camera_, 'usePivot_').name('Picking pivot');
ctrlPivot.onChange(function ()
{
main.camera_.center_ = [0, 0, 0];
main.camera_.transX_ = 0;
main.camera_.transY_ = 0;
if (main.mesh_)
main.camera_.reset(main.mesh_);
main.render();
});
cameraFold.open();
Expand Down
5 changes: 4 additions & 1 deletion math3d/camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,16 @@ Camera.prototype = {
},

/** Reset camera */
reset: function ()
reset: function (mesh)
{
this.rot_ = quat.create();
this.zoom_ = 0;
this.center_ = [0, 0, 0];
this.transX_ = 0;
this.transY_ = 0;
var length = vec3.dist(mesh.octree_.aabbLoose_.max_, mesh.octree_.aabbLoose_.min_);
this.speed_ = length;
this.zoom(-0.4);
},

/** Reset view front */
Expand Down
5 changes: 1 addition & 4 deletions sculptgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,10 +582,7 @@ SculptGL.prototype = {

mesh.initMesh(this.textures_, this.shaders_);
mesh.moveTo([0, 0, 0]);
var length = vec3.dist(mesh.octree_.aabbLoose_.max_, mesh.octree_.aabbLoose_.min_);
this.camera_.reset();
this.camera_.speed_ = length;
this.camera_.zoom(-0.4);
this.camera_.reset(mesh);
this.gui_.updateMesh(mesh);
this.render();
},
Expand Down

0 comments on commit 5ae8d6e

Please sign in to comment.