BLOG main image



d^2 으로 계산하나 2*d^2 으로 계산하나 결과는 유사한데


 2*d^2 의 파동이 좀 더 빨리 줄어들게된다


....



float v=D3DXVec2Length(&_waveInfo._velocity);

float dragF=dampingForce;

float ut=dragF*_waveInfo._curTime;

float dd=distance*distance;

float tt=time*time;


float denominator = (ut+2.0f);




.......


//#define _DD 1


#if _DD

//d^2

maxVelocity=(_waveInfo._distance/(2.0f*_waveInfo._curTime))*sqrt(denominator) ;

if( v >= maxVelocity)

v=maxVelocity-0.01;

#else

//2d^2

maxVelocity=sqrt( (2.0f*dd*ut+2)/tt )/2.0f;

if( v >= maxVelocity)

v=maxVelocity-0.01;

#endif

vv=v*v;

float c1=0.0f;

float c2=0.0f;

float c3=0.0f;


#if _DD

//d^2

c1= (4.0f - 8.0f*vv*tt/dd)/denominator;

c3= (2.0f*vv*tt/dd)/denominator;

#else

//2d^2

c1= (4.0f - 8.0f*vv*tt/(2.0f*dd))/denominator;

c3= (2.0f*vv*tt/(2.0f*dd))/denominator;

#endif


c2= (ut-2.0f)/denominator;




.....





#if _DD

//d^2

maxTime= (dragF +sqrt( dragdragF + 32.0f*vv/dd  ) )/(8.0f*vv/dd);

#else

//2d^2

maxTime= (vv*sqrt(dd*(16.0f*vv+dd*dragdragF)/(vv*vv)) + dd*dragF)/(4.0f*vv);


#endif

if( maxTime> _waveInfo._curTime+tick )

_waveInfo._curTime+=tick;




반응형

+ Recent posts