////////////////////////////////////////////////////////////////////////// // update ////////////////////////////////////////////////////////////////////////// void RCharCloth::update( bool bGame,rmatrix* pWorldMat_, float fDist_ ) { updateCO(); updatePosition( pWorldMat_ ); DWORD currTime = timeGetTime(); if( currTime - mTime < 10 ) { return; } mTime = currTime; if( mUpdateStatus == CHARACTER_DIE_STATE ) { mUpdateStatus |= NOT_COLLISION; } else { mUpdateStatus = ALL; if( fDist_ > COLLISION_DISTANCE ) mUpdateStatus |= NOT_COLLISION; if( fDist_ > VALET_DISTANCE ) mUpdateStatus |= NOT_VALET; if( fDist_ > CAL_LENGTH_DISTANCE ) mUpdateStatus |= NOT_CAL_LENGTH; } accumulateForces(bGame); valet(); satisfyConstraints(); }
////////////////////////////////////////////////////////////////////////// // update ////////////////////////////////////////////////////////////////////////// void ZClothEmblem::update() { if( !isInViewFrustum( &mAABB, RGetViewFrustum() ) || !m_pWorld->GetBsp()->IsVisible(mAABB) ) { mbIsInFrustrum = false; return; } DWORD currTime = timeGetTime(); if ( currTime - mMyTime < 17 ) return; // 초당 60번으로 제한 mMyTime = timeGetTime(); accumulateForces(); varlet(); memset( m_pForce, 0, sizeof(rvector)*m_nCntP ); //memset( mpWind, 0, sizeof(rvector) ); if(mpWind!=NULL) { mpWind->x = 0.f; mpWind->y = 0.f; mpWind->z = 0.f; } satisfyConstraints(); mWndGenerator.Update( timeGetTime() ); mbIsInFrustrum = true; // 다음 루프에서 시뮬레이션 대상에 추가한다 }
void VerletParticleSystem::timeStep() { satisfyConstraints(); }