Mercurial > mm7
diff VectorTypes.h @ 1512:af57b3b76fe4
Clean and decouple. (1)
author | yoctozepto |
---|---|
date | Mon, 02 Sep 2013 15:23:09 +0200 |
parents | ff1867836af5 |
children | 4055b09160ae |
line wrap: on
line diff
--- a/VectorTypes.h Mon Sep 02 17:39:31 2013 +0600 +++ b/VectorTypes.h Mon Sep 02 15:23:09 2013 +0200 @@ -1,7 +1,5 @@ #pragma once -typedef unsigned __int32 uint; - #pragma pack(push, 1) struct Vec2_short_ { @@ -11,34 +9,6 @@ #pragma pack(pop) #pragma pack(push, 1) -struct Vec3_float_ -{ - void Normalize(); - - -//----- (0049B32D) -------------------------------------------------------- -static Vec3_float_ *Vec3_float_::Cross(Vec3_float_ *v1, Vec3_float_ *pOut, float x, float y, float z) -{ - pOut->x = z * v1->y - y * v1->z; - pOut->y = x * v1->z - z * v1->x; - pOut->z = y * v1->x - x * v1->y; - return pOut; -} - - //----- (0049B02E) -------------------------------------------------------- - inline static float NegDot(Vec3_float_ *a1, Vec3_float_ *a2, float *a3) - { - return *a3 = -(a1->z * a2->z + a1->y * a2->y + a1->x * a2->x); - } - - float x; - float y; - float z; -}; -#pragma pack(pop) - - -#pragma pack(push, 1) struct Vec2_int_ { int x; @@ -54,7 +24,6 @@ }; #pragma pack(pop) - #pragma pack(push, 1) struct Vec3_short_ { @@ -67,10 +36,7 @@ #pragma pack(push, 1) struct Vec3_int_ { - inline Vec3_int_(): - x(0), y(0), z(0) - {} - inline Vec3_int_(int a, int b = 0, int c = 0): + inline Vec3_int_(int a = 0, int b = 0, int c = 0): x(a), y(b), z(c) {} @@ -86,6 +52,32 @@ #pragma pack(pop) #pragma pack(push, 1) +struct Vec3_float_ +{ + void Normalize(); + + //----- (0049B32D) -------------------------------------------------------- + static Vec3_float_ *Vec3_float_::Cross(Vec3_float_ *v1, Vec3_float_ *pOut, float x, float y, float z) + { + pOut->x = z * v1->y - y * v1->z; + pOut->y = x * v1->z - z * v1->x; + pOut->z = y * v1->x - x * v1->y; + return pOut; + } + + //----- (0049B02E) -------------------------------------------------------- + inline static float NegDot(Vec3_float_ *a1, Vec3_float_ *a2, float *a3) + { + return *a3 = -(a1->z * a2->z + a1->y * a2->y + a1->x * a2->x); + } + + float x; + float y; + float z; +}; +#pragma pack(pop) + +#pragma pack(push, 1) struct Vec4_int_ { int x; @@ -95,11 +87,6 @@ }; #pragma pack(pop) - - - - - /* 82 */ #pragma pack(push, 1) struct Plane_int_ @@ -109,7 +96,6 @@ }; #pragma pack(pop) - #pragma pack(push, 1) struct BBox_short_ { @@ -142,9 +128,6 @@ }; #pragma pack(pop) - - - /* 196 */ #pragma pack(push, 1) struct Matrix3x3_float_ @@ -161,4 +144,3 @@ }; }; #pragma pack(pop) -