forked from mirror/openmw-tes3mp
Move the velocity out of the transformation object
This commit is contained in:
parent
b292665de9
commit
86b37c6c11
5 changed files with 3 additions and 5 deletions
|
@ -179,7 +179,6 @@ public:
|
||||||
t.pos = getVector3();
|
t.pos = getVector3();
|
||||||
t.rotation = getMatrix3();
|
t.rotation = getMatrix3();
|
||||||
t.scale = getFloat();
|
t.scale = getFloat();
|
||||||
t.velocity = getVector3();
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,12 +37,11 @@ struct Transformation
|
||||||
Ogre::Vector3 pos;
|
Ogre::Vector3 pos;
|
||||||
Ogre::Matrix3 rotation;
|
Ogre::Matrix3 rotation;
|
||||||
float scale;
|
float scale;
|
||||||
Ogre::Vector3 velocity;
|
|
||||||
|
|
||||||
static const Transformation& getIdentity()
|
static const Transformation& getIdentity()
|
||||||
{
|
{
|
||||||
static const Transformation identity = {
|
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;
|
return identity;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ public:
|
||||||
// Node flags. Interpretation depends somewhat on the type of node.
|
// Node flags. Interpretation depends somewhat on the type of node.
|
||||||
int flags;
|
int flags;
|
||||||
Transformation trafo;
|
Transformation trafo;
|
||||||
|
Ogre::Vector3 velocity; // Unused? Might be a run-time game state
|
||||||
PropertyList props;
|
PropertyList props;
|
||||||
|
|
||||||
// Bounding box info
|
// Bounding box info
|
||||||
|
@ -57,6 +58,7 @@ public:
|
||||||
|
|
||||||
flags = nif->getUShort();
|
flags = nif->getUShort();
|
||||||
trafo = nif->getTrafo();
|
trafo = nif->getTrafo();
|
||||||
|
velocity = nif->getVector3();
|
||||||
props.read(nif);
|
props.read(nif);
|
||||||
|
|
||||||
hasBounds = !!nif->getInt();
|
hasBounds = !!nif->getInt();
|
||||||
|
|
|
@ -204,7 +204,6 @@ void ManualBulletShapeLoader::handleNode(Nif::Node *node, int flags,
|
||||||
// For both position and rotation we have that:
|
// For both position and rotation we have that:
|
||||||
// final_vector = old_vector + old_rotation*new_vector*old_scale
|
// final_vector = old_vector + old_rotation*new_vector*old_scale
|
||||||
final.pos = trafo->pos + trafo->rotation*final.pos*trafo->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
|
// Merge the rotations together
|
||||||
final.rotation = trafo->rotation * final.rotation;
|
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:
|
// For both position and rotation we have that:
|
||||||
// final_vector = old_vector + old_rotation*new_vector*old_scale
|
// final_vector = old_vector + old_rotation*new_vector*old_scale
|
||||||
final.pos = trafo->pos + trafo->rotation*final.pos*trafo->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
|
// Merge the rotations together
|
||||||
final.rotation = trafo->rotation * final.rotation;
|
final.rotation = trafo->rotation * final.rotation;
|
||||||
|
|
Loading…
Reference in a new issue