Move the velocity out of the transformation object

actorid
Chris Robinson 13 years ago
parent b292665de9
commit 86b37c6c11

@ -179,7 +179,6 @@ public:
t.pos = getVector3();
t.rotation = getMatrix3();
t.scale = getFloat();
t.velocity = getVector3();
return t;
}

@ -37,12 +37,11 @@ struct Transformation
Ogre::Vector3 pos;
Ogre::Matrix3 rotation;
float scale;
Ogre::Vector3 velocity;
static const Transformation& getIdentity()
{
static const Transformation identity = {
Ogre::Vector3::ZERO, Ogre::Matrix3::IDENTITY, 1.0f, Ogre::Vector3::ZERO
Ogre::Vector3::ZERO, Ogre::Matrix3::IDENTITY, 1.0f
};
return identity;
}

@ -43,6 +43,7 @@ public:
// Node flags. Interpretation depends somewhat on the type of node.
int flags;
Transformation trafo;
Ogre::Vector3 velocity; // Unused? Might be a run-time game state
PropertyList props;
// Bounding box info
@ -57,6 +58,7 @@ public:
flags = nif->getUShort();
trafo = nif->getTrafo();
velocity = nif->getVector3();
props.read(nif);
hasBounds = !!nif->getInt();

@ -204,7 +204,6 @@ void ManualBulletShapeLoader::handleNode(Nif::Node *node, int flags,
// For both position and rotation we have that:
// final_vector = old_vector + old_rotation*new_vector*old_scale
final.pos = trafo->pos + trafo->rotation*final.pos*trafo->scale;
final.velocity = trafo->velocity + trafo->rotation*final.velocity*trafo->scale;
// Merge the rotations together
final.rotation = trafo->rotation * final.rotation;

@ -1121,7 +1121,6 @@ void NIFLoader::handleNode(Nif::Node *node, int flags,
// For both position and rotation we have that:
// final_vector = old_vector + old_rotation*new_vector*old_scale
final.pos = trafo->pos + trafo->rotation*final.pos*trafo->scale;
final.velocity = trafo->velocity + trafo->rotation*final.velocity*trafo->scale;
// Merge the rotations together
final.rotation = trafo->rotation * final.rotation;

Loading…
Cancel
Save