Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r2346 - in trunk: Engine/Control Interface


Chronological Thread 
  • From:
  • To:
  • Subject: [Manta] r2346 - in trunk: Engine/Control Interface
  • Date: Mon, 10 Nov 2008 19:44:20 -0700 (MST)

Author: abe
Date: Mon Nov 10 19:44:19 2008
New Revision: 2346

Modified:
   trunk/Engine/Control/RTRT.cc
   trunk/Engine/Control/RTRT.h
   trunk/Interface/MantaInterface.h
Log:

Added a setTime method to allow the engine to be started at a specific
animation time. Also modified the frame state update so that the time
offset and scale are applied in both real time and fixed rate modes.

M    Interface/MantaInterface.h
M    Engine/Control/RTRT.h
M    Engine/Control/RTRT.cc


Modified: trunk/Engine/Control/RTRT.cc
==============================================================================
--- trunk/Engine/Control/RTRT.cc        (original)
+++ trunk/Engine/Control/RTRT.cc        Mon Nov 10 19:44:19 2008
@@ -401,6 +401,20 @@
 
///////////////////////////////////////////////////////////////////////////////
 
///////////////////////////////////////////////////////////////////////////////
 
+void RTRT::setTime( double time_ )
+{
+  bool was_stopped = time_is_stopped;
+
+  // Reset the stopped time.
+  stopTime();
+  stoptime = time_;
+  startTime();
+  
+  if (was_stopped) {
+    stopTime();
+  }
+}
+
 void RTRT::setTimeMode(TimeMode tm, double ts)
 {
   // If this gets used often, we may need to add a lock to avoid shear if 
part
@@ -717,7 +731,7 @@
           break;
         case FixedRate:
           animFrameState.shutter_open = animFrameState.shutter_close;
-          animFrameState.frameTime = 
static_cast<double>(animFrameState.animationFrameNumber) / frameRate;
+          animFrameState.frameTime = 
((static_cast<double>(animFrameState.animationFrameNumber) / frameRate) - 
timeOffset) * timeScale;
           animFrameState.shutter_close = animFrameState.frameTime;
           break;
         case Static:

Modified: trunk/Engine/Control/RTRT.h
==============================================================================
--- trunk/Engine/Control/RTRT.h (original)
+++ trunk/Engine/Control/RTRT.h Mon Nov 10 19:44:19 2008
@@ -126,6 +126,7 @@
     
///////////////////////////////////////////////////////////////////////////
 
     // Control of time/animation
+    virtual void setTime( double time_ );
     virtual void setTimeMode(TimeMode tm, double rate);
     virtual void startTime();
     virtual void stopTime();

Modified: trunk/Interface/MantaInterface.h
==============================================================================
--- trunk/Interface/MantaInterface.h    (original)
+++ trunk/Interface/MantaInterface.h    Mon Nov 10 19:44:19 2008
@@ -150,6 +150,7 @@
       FixedRate,
       Static
     };
+    virtual void setTime( double time_ ) = 0;
     virtual void setTimeMode(TimeMode tm, double rate) = 0;
     virtual void startTime() = 0;
     virtual void stopTime() = 0;


  • [Manta] r2346 - in trunk: Engine/Control Interface, abe, 11/10/2008

Archive powered by MHonArc 2.6.16.

Top of page