|
From: <ma...@us...> - 2012-05-01 11:35:38
|
Revision: 776
http://openautomation.svn.sourceforge.net/openautomation/?rev=776&view=rev
Author: mayerch
Date: 2012-05-01 11:35:32 +0000 (Tue, 01 May 2012)
Log Message:
-----------
Added ability to call a callback function during each animation step
Modified Paths:
--------------
JSFloorPlan/trunk/src/jsfloorplan.js
JSFloorPlan/trunk/src/jsfloorplan_example_helper.js
Modified: JSFloorPlan/trunk/src/jsfloorplan.js
===================================================================
--- JSFloorPlan/trunk/src/jsfloorplan.js 2012-04-30 21:05:40 UTC (rev 775)
+++ JSFloorPlan/trunk/src/jsfloorplan.js 2012-05-01 11:35:32 UTC (rev 776)
@@ -1250,11 +1250,12 @@
* @param {THREE.Vector3} target The point to look at (only <code>x</code>
* and <code>y</code> are used the <code>z</code>
* is taken from the parameter <code>floor</code>
+ * @param {Function} animateFn (optional) Function to call during each animation step
* @param {Function} delayedFn (optional) Function to call after animation is
* finished
* @param {Bool} animate Animate unless set to false
*/
- this.moveTo = function( floor, azimut, elevation, distance, target, delayedFn, animate )
+ this.moveTo = function( floor, azimut, elevation, distance, target, animateFn, delayedFn, animate )
{
if( noSetup ) setup3D( this.buildingProperties.Object3D );
@@ -1328,6 +1329,7 @@
setupCamera( showStates.currentAzimut, showStates.currentElevation, showStates.currentDistance, showStates.currentTarget );
renderer.render( scene, camera );
+ if( animateFn ) animateFn();
if( !done )
window.requestAnimationFrame( doMove );
@@ -1382,7 +1384,7 @@
var f = self.buildingProperties.floor.length-1;
for( ; f >= 0; f-- ) self.hideFloor( f, minFloor <= f && f <= maxFloor );
}
- this.moveTo( floor, showStates.currentAzimut, showStates.currentElevation, dist, target,
+ this.moveTo( floor, showStates.currentAzimut, showStates.currentElevation, dist, target, undefined,
function(){
if( hideOtherFloors )
{
Modified: JSFloorPlan/trunk/src/jsfloorplan_example_helper.js
===================================================================
--- JSFloorPlan/trunk/src/jsfloorplan_example_helper.js 2012-04-30 21:05:40 UTC (rev 775)
+++ JSFloorPlan/trunk/src/jsfloorplan_example_helper.js 2012-05-01 11:35:32 UTC (rev 776)
@@ -29,7 +29,7 @@
function handleMouseClickEvent( event )
{
- target = j.moveToRoom( j.getState('showFloor'), event.room.room );
+ target = j.moveToRoom( j.getState('showFloor'), event.room.room, true );
updateSlider();
}
/////////////////////////////////////////////////////////////////////////////
@@ -129,12 +129,12 @@
});
target.z = j.buildingProperties.floor[ j.getState( 'showFloor' ) ].heightOfGround +
j.buildingProperties.floor[ j.getState( 'showFloor' ) ].height / 2;
- j.moveTo( j.getState( 'showFloor' ), roll, tilt, dist, target, function(){
+ j.moveTo( j.getState( 'showFloor' ), roll, tilt, dist, target, undefined, function(){
$( j.buildingProperties.floor ).each( function( number ){
j.hideFloor( number, j.getState( 'showFloor' ) == number );
});
j.show3D( roll, tilt, dist, target );
- });
+ }, true );
return false;
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|