2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-22 09:56:22 +01:00

public: make vec3_origin and identity matrix inlined

This commit is contained in:
Alibek Omarov 2024-09-30 00:15:04 +03:00
parent 13a0afef06
commit 35c9323de6
3 changed files with 15 additions and 21 deletions

View File

@ -19,13 +19,6 @@ GNU General Public License for more details.
#include "com_model.h"
#include "xash3d_mathlib.h"
const matrix3x4 m_matrix3x4_identity =
{
{ 1, 0, 0, 0 }, // PITCH [forward], org[0]
{ 0, 1, 0, 0 }, // YAW [right] , org[1]
{ 0, 0, 1, 0 }, // ROLL [up] , org[2]
};
/*
========================================================================
@ -225,14 +218,6 @@ void Matrix3x4_TransformAABB( const matrix3x4 world, const vec3_t mins, const ve
VectorAdd( worldCenter, worldExtents, absmax );
}
const matrix4x4 m_matrix4x4_identity =
{
{ 1, 0, 0, 0 }, // PITCH
{ 0, 1, 0, 0 }, // YAW
{ 0, 0, 1, 0 }, // ROLL
{ 0, 0, 0, 1 }, // ORIGIN
};
/*
========================================================================

View File

@ -25,7 +25,6 @@ GNU General Public License for more details.
static const word hull_table[] = { 2, 4, 6, 8, 12, 16, 18, 24, 28, 32, 36, 40, 48, 54, 56, 60, 64, 72, 80, 112, 120, 128, 140, 176 };
const vec3_t vec3_origin = { 0, 0, 0 };
const int boxpnt[6][4] =
{
{ 0, 4, 6, 2 }, // +X

View File

@ -139,10 +139,20 @@ CONSTANTS GLOBALS
===========================
*/
extern const vec3_t vec3_origin;
// a1ba: we never return pointers to these globals
// so help compiler optimize constants away
#define vec3_origin ((vec3_t){ 0.0f, 0.0f, 0.0f })
#define m_matrix3x4_identity ((matrix3x4) { \
{ 1.0f, 0.0f, 0.0f, 0.0f }, \
{ 0.0f, 1.0f, 0.0f, 0.0f }, \
{ 0.0f, 0.0f, 1.0f, 0.0f }} )
#define m_matrix4x4_identity ((matrix4x4) { \
{ 1.0f, 0.0f, 0.0f, 0.0f }, \
{ 0.0f, 1.0f, 0.0f, 0.0f }, \
{ 0.0f, 0.0f, 1.0f, 0.0f }, \
{ 0.0f, 0.0f, 0.0f, 1.0f }} )
extern const int boxpnt[6][4];
extern const matrix3x4 m_matrix3x4_identity;
extern const matrix4x4 m_matrix4x4_identity;
extern const float m_bytenormals[NUMVERTEXNORMALS][3];