예제 #1
0
/*
============
idAASLocal::ShowArea
============
*/
void idAASLocal::ShowArea(const idVec3 &origin) const
{
	static int lastAreaNum;
	int areaNum;
	const aasArea_t *area;
	idVec3 org;

	areaNum = PointReachableAreaNum(origin, DefaultSearchBounds(), (AREA_REACHABLE_WALK|AREA_REACHABLE_FLY));
	org = origin;
	PushPointIntoAreaNum(areaNum, org);

	if (aas_goalArea.GetInteger()) {
		int travelTime;
		idReachability *reach;

		RouteToGoalArea(areaNum, org, aas_goalArea.GetInteger(), TFL_WALK|TFL_AIR, travelTime, &reach);
		gameLocal.Printf("\rtt = %4d", travelTime);

		if (reach) {
			gameLocal.Printf(" to area %4d", reach->toAreaNum);
			DrawArea(reach->toAreaNum);
		}
	}

	if (areaNum != lastAreaNum) {
		area = &file->GetArea(areaNum);
		gameLocal.Printf("area %d: ", areaNum);

		if (area->flags & AREA_LEDGE) {
			gameLocal.Printf("AREA_LEDGE ");
		}

		if (area->flags & AREA_REACHABLE_WALK) {
			gameLocal.Printf("AREA_REACHABLE_WALK ");
		}

		if (area->flags & AREA_REACHABLE_FLY) {
			gameLocal.Printf("AREA_REACHABLE_FLY ");
		}

		if (area->contents & AREACONTENTS_CLUSTERPORTAL) {
			gameLocal.Printf("AREACONTENTS_CLUSTERPORTAL ");
		}

		if (area->contents & AREACONTENTS_OBSTACLE) {
			gameLocal.Printf("AREACONTENTS_OBSTACLE ");
		}

		gameLocal.Printf("\n");
		lastAreaNum = areaNum;
	}

	if (org != origin) {
		idBounds bnds = file->GetSettings().boundingBoxes[ 0 ];
		bnds[ 1 ].z = bnds[ 0 ].z;
		gameRenderWorld->DebugBounds(colorYellow, bnds, org);
	}

	DrawArea(areaNum);
}
예제 #2
0
/*
============
idAASLocal::ShowFlyPath
============
*/
void idAASLocal::ShowFlyPath( const idVec3 &origin, int goalAreaNum, const idVec3 &goalOrigin ) const {
	int i, areaNum, curAreaNum, travelTime;
	idReachability *reach;
	idVec3 org, areaCenter;
	aasPath_t path;
	if( !file ) {
		return;
	}
	org = origin;
	areaNum = PointReachableAreaNum( org, DefaultSearchBounds(), AREA_REACHABLE_FLY );
	PushPointIntoAreaNum( areaNum, org );
	curAreaNum = areaNum;
	for( i = 0; i < 100; i++ ) {
		if( !RouteToGoalArea( curAreaNum, org, goalAreaNum, TFL_WALK | TFL_FLY | TFL_AIR, travelTime, &reach ) ) {
			break;
		}
		if( !reach ) {
			break;
		}
		gameRenderWorld->DebugArrow( colorPurple, org, reach->start, 2 );
		DrawReachability( reach );
		if( reach->toAreaNum == goalAreaNum ) {
			break;
		}
		curAreaNum = reach->toAreaNum;
		org = reach->end;
	}
	if( FlyPathToGoal( path, areaNum, origin, goalAreaNum, goalOrigin, TFL_WALK | TFL_FLY | TFL_AIR ) ) {
		gameRenderWorld->DebugArrow( colorBlue, origin, path.moveGoal, 2 );
	}
}
예제 #3
0
/*
============
idAASLocal::ShowPushIntoArea
============
*/
void idAASLocal::ShowPushIntoArea( const idVec3 &origin ) const {
	int areaNum;
	idVec3 target;
	target = origin;
	areaNum = PointReachableAreaNum( target, DefaultSearchBounds(), ( AREA_REACHABLE_WALK | AREA_REACHABLE_FLY ) );
	PushPointIntoAreaNum( areaNum, target );
	gameRenderWorld->DebugArrow( colorGreen, origin, target, 1 );
}
예제 #4
0
void idAASLocal::DrawEASRoute( const idVec3& playerOrigin, int goalArea )
{
	idVec3 origin = playerOrigin;
	int areaNum = PointReachableAreaNum( origin, DefaultSearchBounds(), (AREA_REACHABLE_WALK|AREA_REACHABLE_FLY) );

	PushPointIntoAreaNum( areaNum, origin );

	elevatorSystem->DrawRoute(areaNum, goalArea);
}