Skip to end of metadata
Go to start of metadata
You are here: Common > Math > Math Macros
Math Macros
COS2DEG Macro
C++
#define COS2DEG( a ) ( acos_tpl(a)*(180.0f/gf_PI)  )
File

Cry_Math.h

DEFAULT_FAR Macro
C++
#define DEFAULT_FAR 1024.0f
File

Cry_Camera.h

DEFAULT_FOV Macro
C++
#define DEFAULT_FOV (75.0f*gf_PI/180.0f)
File

Cry_Camera.h

DEFAULT_NEAR Macro
C++
#define DEFAULT_NEAR 0.25f
File

Cry_Camera.h

DEG2COS Macro
C++
#define DEG2COS( a ) ( cos_tpl( (a)*(gf_PI/180.0f) ) )
File

Cry_Math.h

DEG2HCOS Macro
C++
#define DEG2HCOS( a ) ( cos_tpl( (a*0.5f)*(gf_PI/180.0f) ) )
File

Cry_Math.h

DEG2RAD Macro
C++
#define DEG2RAD( a ) ( (a) * (gf_PI/180.0f) )
File

Cry_Math.h

DoubleU64 Macro
C++
#define DoubleU64(x) (*( (uint64*) &(x) ))
File

Cry_ValidNumber.h

DoubleU64ExpMask Macro
C++
#define DoubleU64ExpMask ((uint64)255 << 55)
File

Cry_ValidNumber.h

DoubleU64FracMask Macro
C++
#define DoubleU64FracMask (((uint64)1 << 55) - (uint64)1)
File

Cry_ValidNumber.h

DoubleU64SignMask Macro
C++
#define DoubleU64SignMask ((uint64)1 << 63)
File

Cry_ValidNumber.h

F32NAN Macro
C++
#define F32NAN (0x7F800001)                    // Produces rock solid fp-exceptions.
File

Cry_ValidNumber.h

Description

Produces rock solid fp-exceptions.

F32NAN_SAFE Macro
C++
#define F32NAN_SAFE (FloatU32ExpMask | FloatU32FracMask) // This one is not triggering an fp-exception.
File

Cry_ValidNumber.h

Description

This one is not triggering an fp-exception.

F64NAN Macro
C++
#define F64NAN (0x7FF0000000000001)    // Produces rock solid fp-exceptions.
File

Cry_ValidNumber.h

Description

Produces rock solid fp-exceptions.

F64NAN_SAFE Macro
C++
#define F64NAN_SAFE (DoubleU64ExpMask | DoubleU64FracMask)  // This one is not triggering an fp-exception.
File

Cry_ValidNumber.h

Description

This one is not triggering an fp-exception.

FloatU32 Macro
C++
#define FloatU32(x) (alias_cast<uint32, float>(x))
File

Cry_ValidNumber.h

FloatU32ExpMask Macro
C++
#define FloatU32ExpMask (0xFF << 23)
File

Cry_ValidNumber.h

FloatU32FracMask Macro
C++
#define FloatU32FracMask ((1 << 23) - 1)
File

Cry_ValidNumber.h

FloatU32SignMask Macro
C++
#define FloatU32SignMask (1 << 31)
File

Cry_ValidNumber.h

HCOS2DEG Macro
C++
#define HCOS2DEG( a ) ( acos_tpl(a)*2.0f*(180.0f/gf_PI)  )
File

Cry_Math.h

HCOS2RAD Macro
C++
#define HCOS2RAD( a ) ( acos_tpl(a)*2.0f  )
File

Cry_Math.h

LN2 Macro
C++
#define LN2 0.69314718055994530941723212145818f // ln(2)
File

Cry_Math.h

Description

ln(2)

mathMatrixRotationX Macro
C++
#define mathMatrixRotationX(pOut, angle) (*(Matrix44*)pOut) = GetTransposed44( Matrix44(Matrix34::CreateRotationX(angle)) )
File

Cry_XOptimise.h

mathMatrixRotationY Macro
C++
#define mathMatrixRotationY(pOut, angle) (*(Matrix44*)pOut) = GetTransposed44( Matrix44(Matrix34::CreateRotationY(angle)) )
File

Cry_XOptimise.h

mathMatrixRotationZ Macro
C++
#define mathMatrixRotationZ(pOut, angle) (*(Matrix44*)pOut) = GetTransposed44( Matrix44(Matrix34::CreateRotationZ(angle)) )
File

Cry_XOptimise.h

mathMatrixScaling Macro
C++
#define mathMatrixScaling(pOut, sx, sy, sz) (*(Matrix44*)pOut) = GetTransposed44( Matrix44(Matrix34::CreateScale(Vec3(sx,sy,sz))) )
File

Cry_XOptimise.h

mathMatrixTranslation Macro
C++
#define mathMatrixTranslation(pOut, x, y, z) (*(Matrix44*)pOut) = GetTransposed44( Matrix44(Matrix34::CreateTranslationMat(Vec3(x,y,z))) )
File

Cry_XOptimise.h

mathVec2NormalizeF Macro
C++
#define mathVec2NormalizeF(pOut, pV) (*(Vec2*)pOut) = (((Vec2*)pV)->GetNormalizedSafe())
File

Cry_XOptimise.h

mathVec3NormalizeF Macro
C++
#define mathVec3NormalizeF(pOut, pV) (*(Vec3*)pOut) = (((Vec3*)pV)->GetNormalizedSafe())
File

Cry_XOptimise.h

mathVec3TransformCoordArrayF Macro
C++
#define mathVec3TransformCoordArrayF(pOut, OutStride, pV, VStride, pM, n) mathVec3TransformCoordArray((Vec3*)pOut, OutStride, (Vec3*)pV, VStride, (Matrix44*)pM, n)
File

Cry_XOptimise.h

mathVec3TransformF Macro
C++
#define mathVec3TransformF(pOut, pV, pM) mathVec3Transform( (f32*)pOut, (const f32*)pM, (f32*)pV )
File

Cry_XOptimise.h

mathVec4TransformF Macro
C++
#define mathVec4TransformF(pOut, pV, pM) mathVec4Transform( (f32*)pOut, (const f32*)pM, (f32*)pV )
File

Cry_XOptimise.h

PLANE_NON_AXIAL Macro
C++
#define PLANE_NON_AXIAL 3
File

Cry_GeoOverlap.h

PLANE_X Macro
C++
#define PLANE_X 0
File

Cry_GeoOverlap.h

PLANE_Y Macro
C++
#define PLANE_Y 1
File

Cry_GeoOverlap.h

PLANE_Z Macro
C++
#define PLANE_Z 2
File

Cry_GeoOverlap.h

RAD_EPSILON Macro
C++
#define RAD_EPSILON ( 0.01f )
File

Cry_Math.h

RAD2DEG Macro
C++
#define RAD2DEG( a ) ( (a) * (180.0f/gf_PI) )
File

Cry_Math.h

RAD2HCOS Macro
C++
#define RAD2HCOS( a ) ( cos_tpl( (a*0.5f) ) )
File

Cry_Math.h

SIGN_MASK Macro
C++
#define SIGN_MASK(x) ((intptr_t)(x) >> ((sizeof(size_t)*8)-1))
File

Cry_Math.h

TANGENT30 Macro
C++
#define TANGENT30 0.57735026918962576450914878050196f // tan(30)
File

Cry_Math.h

Description

tan(30)

TANGENT30_2 Macro
C++
#define TANGENT30_2 0.57735026918962576450914878050196f*2 // 2*tan(30)
File

Cry_Math.h

Description

2*tan(30)

VEC_EPSILON Macro
C++
#define VEC_EPSILON ( 0.05f )
File

Cry_Math.h

rnd Macro
C++
#define rnd (((float)cry_rand())/CRY_RAND_MAX)  // Floating point random number generator ( 0 -> 1)
File

Cry_XOptimise.h

Description

Floating point random number generator ( 0 -> 1)

In This Topic

  • No labels