mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
Merge remote branch 'kromgart/master' into next
This commit is contained in:
commit
4a2ade2372
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
|
||||
|
|
|
@ -55,10 +55,26 @@ struct Matrix
|
|||
|
||||
struct Transformation
|
||||
{
|
||||
Vector pos;
|
||||
Matrix rotation;
|
||||
float scale;
|
||||
Vector velocity;
|
||||
Vector pos;
|
||||
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