forked from teamnwah/openmw-tes3coop
Merge branch 'next' into occlusionquery
This commit is contained in:
commit
3e0d14bd70
2 changed files with 29 additions and 4 deletions
|
@ -162,6 +162,15 @@ void NIFFile::parse()
|
|||
r->recName = rec;
|
||||
records[i] = r;
|
||||
r->read(this);
|
||||
|
||||
// Discard tranformations for the root node, otherwise some meshes
|
||||
// occasionally get wrong orientation. Only for NiNode-s for now, but
|
||||
// can be expanded if needed.
|
||||
// This should be rewritten when the method is cleaned up.
|
||||
if (0 == i && rec == "NiNode")
|
||||
{
|
||||
static_cast<Nif::Node*>(r)->trafo = Nif::Transformation::getIdentity();
|
||||
}
|
||||
}
|
||||
|
||||
/* After the data, the nif contains an int N and then a list of N
|
||||
|
|
|
@ -59,6 +59,22 @@ struct Transformation
|
|||
Matrix rotation;
|
||||
float scale;
|
||||
Vector velocity;
|
||||
|
||||
static const Transformation* getIdentity()
|
||||
{
|
||||
static Transformation identity;
|
||||
static bool iset = false;
|
||||
if (!iset)
|
||||
{
|
||||
identity.scale = 1.0f;
|
||||
identity.rotation.v[0].array[0] = 1.0f;
|
||||
identity.rotation.v[1].array[1] = 1.0f;
|
||||
identity.rotation.v[2].array[2] = 1.0f;
|
||||
iset = true;
|
||||
}
|
||||
|
||||
return &identity;
|
||||
}
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
|
|
Loading…
Reference in a new issue