Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Gameplay.AimProjectileWeapons


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
class AimProjectileWeapons extends AimFunctions;

//=====================================================================
// Functions

//---------------------------------------------------------------------
// AI weapon function: get spot to aim for when firing this weapon

static function Vector getAimLocation( Weapon weapon, Pawn target, optional float leadScale )
{
	local float timeToHit;

	assert( target != None );
	assert( weapon.rookMotor != None );

	if ( leadScale == 0 )
		leadScale = static.getLeadScale( weapon );

	timeToHit = static.projectileTimeToTarget( weapon, target );
	return target.predictedLocation( leadScale * timeToHit ) -
			timetoHit * weapon.rookMotor.getPhysicalAttachment().Velocity * weapon.projectileInheritedVelFactor;
}

//---------------------------------------------------------------------
// AI weapon function: return the approximate position of the projectile's impact
// (if nothing is hit timeToHit and hitLocation are unchanged)

static function Actor getThingHit( out Vector hitLocation, out float timeToHit, Weapon weapon, Vector projVelocity )
{
	local Actor thingHit;
	local Vector spawnLocation;
	local Vector hitNormal;

	spawnLocation = weapon.rookMotor.getProjectileSpawnLocation();

	thingHit = weapon.AIAimTrace(
				hitLocation, hitNormal,											// out value
				spawnLocation,													// start point
				spawnLocation + MAX_PROJECTILE_TRAVEL_TIME * projVelocity );	// end point

	if ( thingHit != None )
		timeToHit = VSize( hitLocation - spawnLocation ) / VSize( projVelocity );

	return thingHit;
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: ne 5.9.2004 15:53:10.000 - Creation time: st 23.5.2018 00:10:40.868 - Created with UnCodeX