Add a reference time to the velocity stuff.
Modified Files: simgear/scene/model/ModelRegistry.cxx simgear/scene/model/placement.cxx simgear/scene/model/placement.hxx simgear/scene/util/SGSceneUserData.hxx
This commit is contained in:
@@ -135,6 +135,15 @@ SGModelPlacement::setOrientation (const SGQuatd& orientation)
|
|||||||
orientation.getEulerDeg(_heading_deg, _pitch_deg, _roll_deg);
|
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
|
void
|
||||||
SGModelPlacement::setBodyLinearVelocity(const SGVec3d& linear)
|
SGModelPlacement::setBodyLinearVelocity(const SGVec3d& linear)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ public:
|
|||||||
double heading_deg);
|
double heading_deg);
|
||||||
void setOrientation(const SGQuatd& orientation);
|
void setOrientation(const SGQuatd& orientation);
|
||||||
|
|
||||||
|
void setReferenceTime(const double& referenceTime);
|
||||||
void setBodyLinearVelocity(const SGVec3d& velocity);
|
void setBodyLinearVelocity(const SGVec3d& velocity);
|
||||||
void setBodyAngularVelocity(const SGVec3d& velocity);
|
void setBodyAngularVelocity(const SGVec3d& velocity);
|
||||||
|
|
||||||
|
|||||||
@@ -51,10 +51,12 @@ public:
|
|||||||
Velocity() :
|
Velocity() :
|
||||||
linear(SGVec3d::zeros()),
|
linear(SGVec3d::zeros()),
|
||||||
angular(SGVec3d::zeros()),
|
angular(SGVec3d::zeros()),
|
||||||
|
referenceTime(0),
|
||||||
id(simgear::BVHNode::getNewId())
|
id(simgear::BVHNode::getNewId())
|
||||||
{}
|
{}
|
||||||
SGVec3d linear;
|
SGVec3d linear;
|
||||||
SGVec3d angular;
|
SGVec3d angular;
|
||||||
|
double referenceTime;
|
||||||
simgear::BVHNode::Id id;
|
simgear::BVHNode::Id id;
|
||||||
};
|
};
|
||||||
const Velocity* getVelocity() const
|
const Velocity* getVelocity() const
|
||||||
|
|||||||
Reference in New Issue
Block a user