All pastes #953764 Raw Edit

Vermischtes

public text v1 · immutable
#953764 ·published 2008-03-23 09:55 UTC
rendered paste body
//returns true if something is in the way of the Door.
bool Door::doorObstructed()
{
   Point3F  center;
   mRenderObjToWorld.getColumn(3, &center);

   U32 mask = PlayerObjectType | VehicleObjectType; // Rigid shapes use VehicleObjectType mask oO

   Box3F B(center - boundingBoxExtent, center + boundingBoxExtent, true);

   EarlyOutPolyList polyList;
   polyList.mPlaneList.clear();
   polyList.mNormal.set(0,0,0);
   polyList.mPlaneList.setSize(6);
   polyList.mPlaneList[0].set(B.min, VectorF(-1,0,0));
   polyList.mPlaneList[1].set(B.max, VectorF(0,1,0));
   polyList.mPlaneList[2].set(B.max, VectorF(1,0,0));
   polyList.mPlaneList[3].set(B.min, VectorF(0,-1,0));
   polyList.mPlaneList[4].set(B.min, VectorF(0,0,-1));
   polyList.mPlaneList[5].set(B.max, VectorF(0,0,1));

   bool obstructed = gServerContainer.buildPolyList(B, mask, &polyList);
   return obstructed;
}