初步修复
This commit is contained in:
parent
8fc4357cc6
commit
e4714f3f0e
46705 changed files with 12004901 additions and 0 deletions
37
Common/EngineUtil/EngineUtil.cpp
Normal file
37
Common/EngineUtil/EngineUtil.cpp
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#include "StdAfx.h"
|
||||
#include "EngineUtil.h"
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new new(_NORMAL_BLOCK,__FILE__,__LINE__)
|
||||
#endif
|
||||
|
||||
EtVector2 EtVec3toVec2( EtVector3 &vVec )
|
||||
{
|
||||
return EtVector2( vVec.x, vVec.z );
|
||||
}
|
||||
|
||||
EtVector3 EtVec2toVec3( EtVector2 &vVec )
|
||||
{
|
||||
return EtVector3( vVec.x, 0.f, vVec.y );
|
||||
}
|
||||
|
||||
|
||||
bool CheckRect( float x, float y, EtVector2 &VecMin, EtVector2 &VecMax )
|
||||
{
|
||||
if( x >= VecMin.x && x <= VecMax.x && y >= VecMin.y && y <= VecMax.y ) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
float RandomNumberInRange( float fMin, float fMax )
|
||||
{
|
||||
float fRange, fRandom;
|
||||
|
||||
fRandom = float( ::rand() ) / float( RAND_MAX );
|
||||
fRange = fMax - fMin;
|
||||
fRandom *= fRange;
|
||||
fRandom += fMin;
|
||||
|
||||
return fRandom;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue