fix NaN on normalize for ticket #4247

This commit is contained in:
hsu 2010-07-12 22:04:37 +00:00
parent 1b30be26e6
commit 89be14e58b
1 changed files with 14 additions and 4 deletions

View File

@ -168,10 +168,20 @@ public:
this->y * this->y +
this->z * this->z +
this->w * this->w);
this->x /= s;
this->y /= s;
this->z /= s;
this->w /= s;
if (s == 0.0)
{
this->x = 0.0;
this->y = 0.0;
this->z = 0.0;
this->w = 1.0;
}
else
{
this->x /= s;
this->y /= s;
this->z /= s;
this->w /= s;
}
};
};