Beispiel #1
0
void TriggerAreaProcess( VECTOR * OldPos , VECTOR * NewPos , TRIGGER_AREA * Area )
{
	bool	OldIn;
	bool	NewIn;

	Entry = false;
	Exit = false;
	In = false;
	if( Area->type == ZONE_Sphere )
	{
   		OldIn = DistanceVector2Vector( &Area->pos , OldPos ) < Area->half_size.x;
   		NewIn = DistanceVector2Vector( &Area->pos , NewPos ) < Area->half_size.x;

   		if( !OldIn && NewIn )
   			Entry = true;
   		if( OldIn && !NewIn )
   			Exit = true;
   		if( OldIn && NewIn )
   		{
   			In = true;
   		}
   	}else{
   		RayToHull( Area->Zone , OldPos , NewPos , Area->num_sides );
   	}
}
Beispiel #2
0
/*===================================================================
	Procedure	:	Check if im in a Teleport Zone....
	Input		:	void
	Output		:	void
===================================================================*/
void TeleportsZoneCheck( VECTOR * OldPos , VECTOR * NewPos , TELEPORT * TPpnt )
{

	bool	OldIn;
	bool	NewIn;
	Entry = false;
	Exit = false;
	In = false;
	if( TPpnt->zone_type == ZONE_Sphere )
	{
   		OldIn = DistanceVector2Vector( &TPpnt->Pos , OldPos ) <= TPpnt->half_size.x;
   		NewIn = DistanceVector2Vector( &TPpnt->Pos , NewPos ) <= TPpnt->half_size.x;
   		if( !OldIn && NewIn )
   			Entry = true;
   		if( OldIn && !NewIn )
   			Exit = true;
   		if( OldIn && NewIn )
   			In = true;
   	}else{
   		RayToHull( TPpnt->Zone , OldPos , NewPos , TPpnt->num_sides );
   	}
}
Beispiel #3
0
/*===================================================================
	Procedure	:	Check if im in a External Force Zone....
	Input		:	void
	Output		:	void
===================================================================*/
void ExternalForcesZoneCheck( VECTOR * OldPos , VECTOR * NewPos , EXTERNALFORCE * EFpnt )
{

	bool	OldIn;
	bool	NewIn;
	Entry = false;
	Exit = false;
	In = false;
	if( EFpnt->Type == ZONE_Sphere )
	{
   		OldIn = DistanceVector2Vector( &EFpnt->Pos , OldPos ) < EFpnt->half_size.x;
   		NewIn = DistanceVector2Vector( &EFpnt->Pos , NewPos ) < EFpnt->half_size.x;
   		if( !OldIn && NewIn )
   			Entry = true;
   		if( OldIn && !NewIn )
   			Exit = true;
   		if( OldIn && NewIn )
   		{
   			In = true;
   		}
   	}else{
   		RayToHull( EFpnt->Zone , OldPos , NewPos , EFpnt->num_sides );
   	}
}