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
//=============================================================================
// 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.000000
     OffsetMag=(X=10.000000,Y=10.000000,Z=10.000000)
     OffsetRate=(X=1000.000000,Y=1000.000000,Z=1000.000000)
     OffsetTime=3.000000
     bCollideActors=Falsch
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fr 30.3.2007 08:43:38.000 - Creation time: Mo 16.4.2007 11:20:57.234 - Created with UnCodeX