## XIDMaps
Class CineMalletteSM

source: C:\XIII\XIDMaps\Classes\CineMalletteSM.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--XIII.SMAttached
             |
             +--XIDMaps.CineMalletteSM

Direct Known Subclasses:None

class CineMalletteSM
extends XIII.SMAttached

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

Variables
`CineMalletteSM` | `PartieSuperieure`
`Pawn` | `PersoALaMallette`
`bool` | `bFermeLaMallette`
`bool` | `bMalletteEnMain`
`int` | `eRotRollMax`
`fHauteur,` | `fHauteurMax`
`rotator` | `rRot`
`vector` | `vPosInit`

States
STA_PoseMallette, STA_FermetureMallette

Function Summary
`void` | `Trigger(Actor Other, Pawn EventInstigator)`
    //-----------------------------------------------------------

State STA_PoseMallette Function Summary

State STA_FermetureMallette Function Summary

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class CineMalletteSM extends SMAttached
    00005		placeable;
    00006
    00007	var() Pawn PersoALaMallette;
    00008	var() CineMalletteSM PartieSuperieure;
    00009	var bool bFermeLaMallette;
    00010	var bool bMalletteEnMain;
    00011	var rotator rRot;
    00012	var int eRotRollMax;
    00013	var vector vPosInit;
    00014	var float fHauteur, fHauteurMax;
    00015
    00016
    00017	//-----------------------------------------------------------
    00018	event PostBeginPlay()
    00019	{
    00020		if (PartieSuperieure == none)
    00021		{
    00022			// la partie superieure est independante, la partie inferieure traitera les deux cas
    00023			Disable( 'Trigger' );
    00024		}
    00025	}
    00026
    00027	//-----------------------------------------------------------
    00028	function Trigger( actor Other, pawn EventInstigator )
    00029	{
    00030		if ( !bFermeLaMallette )
    00031		{
    00032			rRot = Rotation;
    00033			GotoState( 'STA_FermetureMallette' );
    00034		}
    00035		else
    00036		{
    00037			if ( PersoALaMallette != none )
    00038			{
    00039				if ( !bMalletteEnMain )
    00040				{
    00041					bMalletteEnMain = true;
    00042					// partie inferieure
    00043					PersoALaMallette.AttachToBone(self,'X R Hand');
    00044					SetRelativeLocation(Default.RelativeLocation);
    00045					SetRelativeRotation(Default.RelativeRotation);
    00046					bHidden = true;
    00047					RefreshDisplaying();
    00048					// partie superieure
    00049					PersoALaMallette.AttachToBone(PartieSuperieure,'X R Hand');
    00050					PartieSuperieure.SetRelativeLocation(Default.RelativeLocation);
    00051					PartieSuperieure.SetRelativeRotation(Default.RelativeRotation + rot(0,0,1)*eRotRollMax);
    00052					PartieSuperieure.bHidden = true;
    00053					PartieSuperieure.RefreshDisplaying();
    00054				}
    00055				else
    00056				{
    00057					// partie inferieure
    00058					PersoALaMallette.DetachFromBone(self);
    00059					SetLocation( vect( -7839, -2760, 898) );
    00060					SetRotation( rot( 0, 32768, 0 ) );
    00061					bHidden = false;
    00062					RefreshDisplaying();
    00063					// partie superieure
    00064
    00065					PersoALaMallette.DetachFromBone(PartieSuperieure);
    00066					PartieSuperieure.SetLocation( vect( -7839, -2760, 898) );
    00067					PartieSuperieure.SetRotation( rot( 0, 32768, -20390 ) );
    00068	//				PartieSuperieure.SetLocation(Location);
    00069	//				PartieSuperieure.SetRotation(Rotation + rot(0,0,1)*eRotRollMax);
    00070					PartieSuperieure.bHidden = false;
    00071					PartieSuperieure.RefreshDisplaying();
    00072					bMalletteEnMain = false;
    00073					GotoState('STA_PoseMallette');
    00074				}
    00075			}
    00076		}
    00077	}
    00078
    00079	//-----------------------------------------------------------
    00080	State STA_FermetureMallette
    00081	{
    00082		event Tick(float dt)
    00083		{
    00084			rRot.Roll -= 70000*dt;
    00085			rRot.Roll = fMax( rRot.Roll,eRotRollMax );
    00086			PartieSuperieure.SetRotation(rRot);
    00087			if ( rRot.Roll == eRotRollMax )
    00088			{
    00089				bFermeLaMallette = true;
    00090				GotoState('');
    00091			}
    00092		}
    00093	}
    00094
    00095
    00096	//-----------------------------------------------------------
    00097	State STA_PoseMallette
    00098	{
    00099		event BeginState()
    00100		{
    00101			vPosInit = Location;
    00102			fHauteur = 0;
    00103			fHauteurMax = 10;
    00104		}
    00105
    00106		event Tick(float dt)
    00107		{
    00108			fHauteur += 50*dt;
    00109			fHauteur = fMin(fHauteur,fHauteurMax);
    00110			SetLocation( vPosInit - fHauteur*vect(0,0,1) );
    00111			PartieSuperieure.SetLocation(Location);
    00112			if ( fHauteur == fHauteurMax )
    00113			{
    00114				GotoState('');
    00115			}
    00116		}
    00117	}
    00118
    00119
    00120	//-----------------------------------------------------------
    00121
    00122
    00123	defaultproperties
    00124	{
    00125	     eRotRollMax=-20390
    00126	     RelativeLocation=(X=42.000000,Z=2.000000)
    00127	     RelativeRotation=(Pitch=16384,Roll=16384)
    00128	     StaticMesh=StaticMesh'Staticbanque.liasse_valise_bas'
    00129	}

End Source Code