## XIDCine
Class HelicoTopRotor

source: C:\XIII\XIDCine\Classes\HelicoTopRotor.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Decoration
             |
             +--XIDCine.HelicoTopRotor

Direct Known Subclasses:ApacheTopRotor, FBIHelicoTopRotor, NiceHelicoTopRotor

class HelicoTopRotor
extends Engine.Decoration

    //-----------------------------------------------------------
    //
    //-----------------------------------------------------------

Variables
`float` | `Angle,RotationSpeed`
`bTurning,` | `bChanging`

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class HelicoTopRotor extends Decoration; //VehiclePart;
    00005
    00006	//var ShadowProjector	Shadow;
    00007	VAR bool bTurning, bChanging;
    00008	VAR float Angle,RotationSpeed;
    00009
    00010	EVENT PostBeginPlay()
    00011	{
    00012		if( (Owner!=none) && (Owner.bActorShadows) && (Shadow==None) )
    00013		{
    00014			Shadow = Spawn(class'ShadowProjector',Self,'',Location/*+vect(0,0,150)*/);
    00015			Shadow.ShadowScale = 4.4;
    00016			Shadow.MaxTraceDistance=2500;
    00017			Shadow.ShadowIntensity=64;
    00018		}
    00019
    00020		if ( HelicoDeco(Owner)!=none && HelicoDeco(Owner).bInitiallyOn )
    00021		{
    00022			bTurning=true;
    00023			RotationSpeed=250000;
    00024		}
    00025	}
    00026
    00027	EVENT Trigger(actor Other, Pawn EventInstigator)
    00028	{
    00029		bTurning=!bTurning;
    00030		bChanging=true;
    00031
    00032	}
    00033
    00034	EVENT Tick(float dT)
    00035	{
    00036	    LOCAL ROTATOR R;
    00037
    00038		if (bChanging)
    00039		{
    00040			if (bTurning)
    00041			{
    00042				RotationSpeed+=0.25*250000*dt;
    00043				if (RotationSpeed>=250000)
    00044				{
    00045					RotationSpeed=250000;
    00046					bChanging=false;
    00047				}
    00048			}
    00049			else
    00050			{
    00051				RotationSpeed-=0.25*250000*dt;
    00052				if (RotationSpeed<=0)
    00053				{
    00054					RotationSpeed=0;
    00055					bChanging=false;
    00056				}
    00057			}
    00058		}
    00059		R=RelativeRotation;
    00060		Angle += RotationSpeed*dT;
    00061		R.Yaw = Angle;
    00062		R.Roll = 0;
    00063		R.Pitch = 0;
    00064	    SetRelativeRotation( R );
    00065	}
    00066
    00067	EVENT Bump( actor Other)
    00068	{
    00069		if ( Other.IsA( 'XIIIPlayerPawn' ) && RotationSpeed>50000 )
    00070			Other.TakeDamage( 2000, none, Other.Location, vect(0,0,0), class'DTSuicided' );
    00071	}
    00072
    00073
    00074
    00075	defaultproperties
    00076	{
    00077	     bStatic=False
    00078	     bBlockZeroExtentTraces=False
    00079	     bBlockNonZeroExtentTraces=False
    00080	     bActorShadows=True
    00081	     DrawType=DT_StaticMesh
    00082	     StaticMesh=StaticMesh'Meshes_Vehicules.HelicomangousteTop'
    00083	}

End Source Code