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

Gameplay.ViewShaker


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
//=============================================================================
// ViewShaker:  Shakes view of any playercontrollers - amb - rewrote this
// within the ShakeRadius
//=============================================================================

class ViewShaker extends Triggers;

//-----------------------------------------------------------------------------
// Variables.

var() float  ShakeRadius;		// radius within which to shake player views
var() vector RotMag;			// how far to rot view
var() vector RotRate;			// how fast to rot view
var() float  RotTime;			// how much time to rot the instigator's view
var() vector OffsetMag;		    // max view offset vertically
var() vector OffsetRate;		// how fast to offset view vertically
var() float  OffsetTime;	    // how much time to offset view

//-----------------------------------------------------------------------------
// Functions.

simulated function Trigger( actor Other, pawn EventInstigator )
{
	local Controller		C;
	local PlayerController	LocalPlayer;

	LocalPlayer = Level.GetLocalPlayerController();
	if ( (LocalPlayer != None) && (VSize(Location - LocalPlayer.ViewTarget.Location) < ShakeRadius) )		
		LocalPlayer.ShakeView(RotMag, RotRate, RotTime, OffsetMag, OffsetRate, OffsetTime);

	for ( C=Level.ControllerList; C!=None; C=C.NextController )
		if ( (PlayerController(C) != None) && (C != LocalPlayer) 
			&& (VSize(Location - PlayerController(C).ViewTarget.Location) < ShakeRadius) )		
			C.ShakeView(RotMag, RotRate, RotTime, OffsetMag, OffsetRate, OffsetTime);
}

defaultproperties
{
	ShakeRadius=+2000.0
	OffsetMag=(X=10,Y=10,Z=10)
	OffsetRate=(X=1000,Y=1000,Z=1000)
	OffsetTime=3.0
	bCollideActors=false
}


Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Di 5.9.2006 22:28:50.000 - Creation time: Do 14.8.2014 09:58:55.001 - Created with UnCodeX