#include <simgear/compiler.h>
-#include <string.h> // for strcmp()
-
-#include <plib/ul.h>
+#include <simgear/scene/util/SGSceneUserData.hxx>
#include "location.hxx"
#include "placementtrans.hxx"
_position->addChild(model);
}
_selector->addChild(_position.get());
-// _selector->setNodeMask(_selector->getNodeMask() & ~SG_HOT_TRAVERSAL_BIT);
_selector->setValue(0, 1);
}
orientation.getEulerDeg(_heading_deg, _pitch_deg, _roll_deg);
}
+void
+SGModelPlacement::setBodyLinearVelocity(const SGVec3d& linear)
+{
+ SGSceneUserData* userData;
+ userData = SGSceneUserData::getOrCreateSceneUserData(_position);
+ SGSceneUserData::Velocity* vel = userData->getOrCreateVelocity();
+ SGQuatd orientation = SGQuatd::fromAngleAxisDeg(180, SGVec3d(0, 1, 0));
+ vel->linear = orientation.backTransform(linear);
+}
+
+void
+SGModelPlacement::setBodyAngularVelocity(const SGVec3d& angular)
+{
+ SGSceneUserData* userData;
+ userData = SGSceneUserData::getOrCreateSceneUserData(_position);
+ SGSceneUserData::Velocity* vel = userData->getOrCreateVelocity();
+ SGQuatd orientation = SGQuatd::fromAngleAxisDeg(180, SGVec3d(0, 1, 0));
+ vel->angular = orientation.backTransform(angular);
+}
+
// end of model.cxx
virtual void setOrientation (double roll_deg, double pitch_deg,
double heading_deg);
void setOrientation(const SGQuatd& orientation);
+
+ void setBodyLinearVelocity(const SGVec3d& velocity);
+ void setBodyAngularVelocity(const SGVec3d& velocity);
private: