Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 3, 2006, 7:22:44 PM (18 years ago)
Author:
patrick
Message:

ground collision works again

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/lib/graphics/importer/bsp_manager.cc

    r9061 r9065  
    985985
    986986
     987  plane* testPlane;
     988
     989  bool xCollision = false;
     990  bool zCollision = false;
     991
    987992
    988993  float height = 40;
     
    9981003    dest1     = worldEntity->getAbsCoor() +  box->center + dirX * (box->halfLength[0]  + BSP_X_OFFSET);
    9991004    dest2     = worldEntity->getAbsCoor() -  box->center + dirX * (box->halfLength[0]  + BSP_X_OFFSET);
    1000    
     1005
    10011006    Vector dirZ =  worldEntity->getAbsDirZ(); dirX.y = 0.0f; dirZ.normalize();
    10021007    //position2 = worldEntity->getAbsCoor() +  box->center - dirZ * (box->halfLength[2]  + BSP_Z_OFFSET);
     
    10091014
    10101015
    1011 //   PRINTF(0)("x and v\n");
    1012 //   worldEntity->getAbsDirX().debug();
    1013 //   worldEntity->getAbsDirV().debug();
    1014 
    1015 
    1016   // 1st Ray
     1016
     1017  // 1st Ray: Y RAY
    10171018  this->inputStart =  position;
    10181019  this->inputEnd =   dest;
     
    10521053      this->out = out;
    10531054    }
    1054 
    1055 
    1056   }
    1057 
    1058   plane* testPlane = this->collPlane;
    1059 
    1060   bool xCollision = false;
    1061   bool zCollision = false;
     1055  }
     1056    testPlane = this->collPlane;
     1057
     1058
    10621059  bool xCollisionNeg = false;
    10631060  bool zCollisionNeg = false;
    1064  
    1065 
    1066 
    1067     // 2nd Collision Detection
     1061
     1062
     1063
     1064    // 2nd Collision Detection X-RAY
    10681065    this->outputStartsOut = true;
    10691066    this->outputAllSolid = false;
     
    10931090
    10941091
    1095       // 3rd Collision Detection
     1092      // 3rd Collision Detection Z-RAY
    10961093      this->outputStartsOut = true;
    10971094      this->outputAllSolid = false;
     
    11211118      }
    11221119
    1123   //end if
    1124   /*
    1125   This is how you would calculate the Coordinates where worldEntity Collided with the BSP world.
    1126   out.x = position1.x + (dest.x -position1.x) * this->outputFraction;
    1127   out.z = position1.z + (dest.z -position1.z) * this->outputFraction;
    1128   */
    1129 
    11301120
    11311121  // Return the normal here: Normal's stored in this->collPlane;
    11321122  if( collision) {
    1133     worldEntity->registerCollision(COLLISION_TYPE_AXIS_Y_NEG , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z), out, SolidFlag);
     1123    worldEntity->registerCollision(COLLISION_TYPE_AXIS_Y , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z), out, SolidFlag);
    11341124}
    11351125  if(xCollision) {
    11361126    worldEntity->registerCollision(COLLISION_TYPE_AXIS_X , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z),dest1 , SolidFlag);
    11371127  }
    1138  
     1128
    11391129  if(zCollision) {
    11401130    worldEntity->registerCollision(COLLISION_TYPE_AXIS_Z , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z), dest2 , SolidFlag);
    11411131  }
    11421132
    1143 
    1144   //else  worldEntity->registerCollision(COLLISION_TYPE_AXIS_Y, this->parent, worldEntity, Vector(0.0, 2.0, 0.0), dest, false);
    11451133
    11461134}
Note: See TracChangeset for help on using the changeset viewer.