Merge pull request #440 from Fire-Head/master

CWeapon done, fixes
This commit is contained in:
Nikolay Korolev 2020-04-15 23:28:09 +03:00 committed by GitHub
commit 5cb7e2e42a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 2331 additions and 60 deletions

View file

@ -46,6 +46,13 @@ public:
y *= invsqrt;
z *= invsqrt;
}
void Normalise2D(void) {
float sq = MagnitudeSqr2D();
float invsqrt = RecipSqrt(sq);
x *= invsqrt;
y *= invsqrt;
}
const CVector &operator+=(CVector const &right) {
x += right.x;

View file

@ -13,13 +13,14 @@ public:
void Normalise(void){
float sq = MagnitudeSqr();
if(sq > 0.0f){
//if(sq > 0.0f){
float invsqrt = RecipSqrt(sq);
x *= invsqrt;
y *= invsqrt;
}else
x = 1.0f;
//}else
// x = 1.0f;
}
const CVector2D &operator+=(CVector2D const &right) {
x += right.x;
y += right.y;