Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r2293 - trunk/Model/Instances


Chronological Thread 
  • From: "Thiago Ize" < >
  • To:
  • Subject: [Manta] r2293 - trunk/Model/Instances
  • Date: Wed, 25 Jun 2008 21:46:12 -0600 (MDT)

Author: thiago
Date: Wed Jun 25 21:46:12 2008
New Revision: 2293

Modified:
   trunk/Model/Instances/Instance.cc
Log:
Object being instanced wasn't being interpolated (only the affine
transform was being interpolated). Now interpolation on instances
is applied to both the transform and the underlying instance.

Modified: trunk/Model/Instances/Instance.cc
==============================================================================
--- trunk/Model/Instances/Instance.cc   (original)
+++ trunk/Model/Instances/Instance.cc   Wed Jun 25 21:46:12 2008
@@ -84,12 +84,12 @@
 
 Interpolable::InterpErr Instance::serialInterpolate(const 
std::vector<keyframe_t> &keyframes)
 {
-  instance->serialInterpolate(keyframes);
-
   for (int r=0; r<3; ++r)
     for (int c=0; c<4; ++c)
       transform.mat[r][c] = 0;
 
+  vector<keyframe_t> instance_keyframes(keyframes);
+
   for (size_t i=0; i < keyframes.size(); ++i) {
     Interpolable::keyframe_t kt = keyframes[i];
     Instance *instance = dynamic_cast<Instance*>(keyframes[i].keyframe);
@@ -102,9 +102,13 @@
     for (int r=0; r<3; ++r)
       for (int c=0; c<4; ++c)
         transform.mat[r][c] += instance->transform.mat[r][c]*keyframes[i].t;
+
+    instance_keyframes[i].keyframe = instance->instance;
   }
 
   transform_inv = transform.inverse();
+
+  instance->serialInterpolate(instance_keyframes);
 
   return success;
 }


  • [Manta] r2293 - trunk/Model/Instances, Thiago Ize, 06/25/2008

Archive powered by MHonArc 2.6.16.

Top of page