]> git.mxchange.org Git - simgear.git/commitdiff
Add a reference time to the velocity stuff.
authorfrohlich <frohlich>
Sat, 14 Mar 2009 12:26:30 +0000 (12:26 +0000)
committerTim Moore <timoore@redhat.com>
Wed, 18 Mar 2009 06:53:50 +0000 (07:53 +0100)
Modified Files:
simgear/scene/model/ModelRegistry.cxx
simgear/scene/model/placement.cxx
simgear/scene/model/placement.hxx
simgear/scene/util/SGSceneUserData.hxx

simgear/scene/model/placement.cxx
simgear/scene/model/placement.hxx
simgear/scene/util/SGSceneUserData.hxx

index f781ab3e2b343922e2cd8c1f8d4c9a81ddec9dac..f46243d3f0929c1a69f2f7d66f8945e4bd3d1868 100644 (file)
@@ -135,6 +135,15 @@ SGModelPlacement::setOrientation (const SGQuatd& orientation)
   orientation.getEulerDeg(_heading_deg, _pitch_deg, _roll_deg);
 }
 
+void
+SGModelPlacement::setReferenceTime(const double& referenceTime)
+{
+  SGSceneUserData* userData;
+  userData = SGSceneUserData::getOrCreateSceneUserData(_transform);
+  SGSceneUserData::Velocity* vel = userData->getOrCreateVelocity();
+  vel->referenceTime = referenceTime;
+}
+
 void
 SGModelPlacement::setBodyLinearVelocity(const SGVec3d& linear)
 {
index 343952238f555b9f5e1dea6d4292d30764e2e13c..9a7236609753dcc00a8bda0cd83abdda29e4ac62 100644 (file)
@@ -73,6 +73,7 @@ public:
                                double heading_deg);
   void setOrientation(const SGQuatd& orientation);
 
+  void setReferenceTime(const double& referenceTime);
   void setBodyLinearVelocity(const SGVec3d& velocity);
   void setBodyAngularVelocity(const SGVec3d& velocity);
   
index e47703b9e358f7417ebdb6e3681db8637b263635..4f3f38fc6d2aa48ee413e83cbec541cb9ebfaf3b 100644 (file)
@@ -51,10 +51,12 @@ public:
     Velocity() :
         linear(SGVec3d::zeros()),
         angular(SGVec3d::zeros()),
+        referenceTime(0),
         id(simgear::BVHNode::getNewId())
     {}
     SGVec3d linear;
     SGVec3d angular;
+    double referenceTime;
     simgear::BVHNode::Id id;
   };
   const Velocity* getVelocity() const