freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

動(dòng)物集群運(yùn)動(dòng)行為模型系列之一-資料下載頁

2025-05-27 22:30本頁面
  

【正文】 else if (m_dist_to_nearest_flockmate SeparationDist) {ifdef BOID_DEBUG myprintf( too far away!\n)。endif // too far away...move towards our neighbor (ratio)。 } else {ifdef BOID_DEBUG myprintf( just right!\n)。endif // in the UNLIKELY event we39。re exactly the right distance away, do nothing ()。 } // return change vectorifdef BOID_DEBUG myprintf( final change vector from KeepDistance = %f %f %f\n, , )。endif return (change)。}與最近的同類保持一致// MatchHeading.// Generates a vector for a flock boid to try// to match the heading of its nearest flockmate.vector CBoid::MatchHeading (void){ // copy the heading of our nearest buddy vector change = m_nearest_flockmatem_vel。ifdef BOID_DEBUG myprintf(\nInside MatchHeading\n)。endif // normalize and then scale our vector change a bit...after // all we can39。t instantly snap to a new heading, can we? (MinUrgency)。 // return change vectorifdef BOID_DEBUG myprintf( final change vector from MatchHeading = %f %f %f\n, , )。endif return (change)。}遇到天敵// SeeEnemies.// Determines which enemy flock boids a given flock boid can see.int CBoid::SeeEnemies (int flock_id){ float dist。 CBoid *enemy。ifdef BOID_DEBUG myprintf(\nInside SeeEnemies\n)。endif // initialize enemy data m_num_enemies_seen = 0。 m_nearest_enemy = NULL。 m_dist_to_nearest_enemy = INFINITY。遇到天敵翻滾 // loop over each flock and determine the closest one we can see for (int i = 0。 i CFlock::FlockCount。 i++) { // test: if this is OUR flock, skip it if (i == flock_id) continue。在一個(gè)群落中遇到天敵的反應(yīng)ifdef VISIBILITY_DEBUG myprintf( Testing to see if %x can see anybody in flock %d\n,this,i)。endif // not our flock, so check it out enemy = CFlock::ListOfFlocks[i]GetFirstMember()。 while (enemy != NULL) { ifdef VISIBILITY_DEBUG myprintf( looking at %x\n,enemy)。endif // if this enemy is visible... if ((dist = CanISee(enemy)) != INFINITY) { // I can see it..increment counter m_num_enemies_seen++。 // Test: Closest enemy? if (dist m_dist_to_nearest_enemy) { // yes...save it off m_dist_to_nearest_enemy = dist。 m_nearest_enemy = enemy。 } } // get next enemy in flock enemy = enemyGetNext()。 } }ifdef VISIBILITY_DEBUG myprintf(\n)。 myprintf( total enemies seen = %d\n,m_num_enemies_seen)。 myprintf( nearest enemy is %x at %f\n,m_nearest_enemy,m_dist_to_nearest_enemy)。endif return (m_num_enemies_seen)。}// SeeFriends.看到同類如何反應(yīng)// Determines which flockmates a given flock boid can see.int CBoid::SeeFriends (CBoid *first_boid){ float dist。 CBoid *flockmate = first_boid。ifdef BOID_DEBUG myprintf(\nInside SeeFriends\n)。endififdef VISIBILITY_DEBUG myprintf( Building visibilty list for %x...\n,this)。endif // clear the existing visibility list of any holdover from last round ClearVisibleList()。 // now figure out who we can see while (flockmate != NULL) { // Test: Within sight of this boid?ifdef VISIBILITY_DEBUG myprintf( looking at %x\n,flockmate)。endif if ((dist = CanISee(flockmate)) != INFINITY) { // add it to the list AddToVisibleList(flockmate)。 // Test: If this guy is closer than the current // closest, make him the current closest if (dist m_dist_to_nearest_flockmate) { m_dist_to_nearest_flockmate = dist。 m_nearest_flockmate = flockmate。 } } // next flockmate flockmate = flockmateGetNext()。 }ifdef VISIBILITY_DEBUG myprintf(\n)。 myprintf( total flockmates seen = %d\n,m_num_flockmates_seen)。 myprintf( nearest flockmate is %x at %f\n, m_nearest_flockmate, m_dist_to_nearest_flockmate)。endif return (m_num_flockmates_seen)。}// SteerToCenter.// Generates a vector to guide a flock boid towards// the center of mass of the flockmates he can see.vector CBoid::SteerToCenter (void){ vector center, change。ifdef BOID_DEBUG myprintf(\nInside SteerToCenter\n)。endif // walk down the visibility list and sum up their position vectors for (int i = 0。 i m_num_flockmates_seen。 i++) { if (VisibleFriendsList[i] != NULL) center += VisibleFriendsList[i]m_pos。 }ifdef BOID_DEBUG myprintf( perceived center before averaging = %f %f %f\n, , )。 myprintf( num_flockmates_seen = %d\n,m_num_flockmates_seen)。endif // average the positions to get the perceived center of the flock center /= m_num_flockmates_seen。ifdef BOID_DEBUG myprintf( perceived center after averaging = %f %f %f\n, , )。endif // now that we have the perceived center, puter a vector towards it change = center m_pos。 // Scale the change vector so we don39。t turn on a dime.. (MinUrgency)。ifdef BOID_DEBUG myprintf( final change vector from SteerToCenter = %f %f %f\n, , , )。endif // return change vector return (change)。}遇到邊界魚停止運(yùn)動(dòng)// WorldBound.// Implements a world boundary so that flocks don39。t fly// infinitely far away from the camera, instead remaining // in a nice viewable area. It does this by wrapping flock// boids around to the other side of the world, so (for example)// they move out the right and return on the left.// Returns: nothing.void CBoid::WorldBound (void){ float maxX = CBox::WorldPtrGetBoxWidth()/2。 float maxY = CBox::Wor
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1