RuneI
Class BoneBridgeBig

source: c:\runehov\RuneI\Classes\BoneBridgeBig.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Decoration
         |
         +--RuneI.DecorationRune
            |
            +--RuneI.BoneBridgeBig
Direct Known Subclasses:None

class BoneBridgeBig
extends RuneI.DecorationRune

//============================================================================= // BoneBridgeBig. //=============================================================================

Function Summary
 void AddVelocity(vector NewVelocity)
 
simulated
FindAdjacents(int joint, out int, out int)
 
simulated
JointTouchedBy(Actor Other, int joint)



Source Code


00001	//=============================================================================
00002	// BoneBridgeBig.
00003	//=============================================================================
00004	class BoneBridgeBig extends DecorationRune;
00005	
00006	
00007	simulated event GetSpringJointParms(int joint, out float DampFactor, out float SpringConstant, out vector SpringThreshold)
00008	{
00009		DampFactor = 3;
00010		SpringConstant = 50;
00011		SpringThreshold = vect(5,5,50);
00012	}
00013	
00014	
00015	simulated function FindAdjacents(int joint, out int prev, out int next)
00016	{
00017		switch(joint)
00018		{
00019			case 3:		prev = 0;	next = 6;	break;
00020			case 6:		prev = 3;	next = 9;	break;
00021			case 9:		prev = 6;	next = 12;	break;
00022			case 12:	prev = 9;	next = 16;	break;
00023			case 16:	prev = 12;	next = 19;	break;
00024			case 19:	prev = 16;	next = 25;	break;
00025			case 25:	prev = 19;	next = 22;	break;
00026			case 22:	prev = 25;	next = 0;	break;
00027		}
00028	}
00029	
00030	function AddVelocity(vector NewVelocity)
00031	{	// Momentum has come in from another actor
00032	}
00033	
00034	simulated function JointTouchedBy(actor Other, int joint)
00035	{
00036		local vector vel,v;
00037		local int prev, next, dummy;
00038		local rotator torque;
00039	
00040		if ((JointFlags[joint] & JOINT_FLAG_SPRINGPOINT)==0)
00041			return;
00042	
00043		vel = Other.Velocity;
00044		if (VSize2D(vel) > 0 && vel.Z==0)
00045			vel.Z = -5;
00046		vel.X *= 0.05;
00047		vel.Y *= 0.05;
00048		vel.Z *= 0.5;
00049	
00050		ApplyJointForce(joint, vel);
00051	
00052		FindAdjacents(joint, prev, next);
00053	
00054		v = vel;
00055		while (prev != 0)
00056		{
00057			v *= 0.5;
00058			if (VSize(v) < 1)
00059				break;
00060	
00061			ApplyJointForce(prev, v);
00062			FindAdjacents(prev, prev, dummy);
00063		}
00064		until (prev == 0);
00065	
00066		v = vel;
00067		while (next != 0)
00068		{
00069			v *= 0.5;
00070			if (VSize(v) < 1)
00071				break;
00072	
00073			ApplyJointForce(next, v);
00074			FindAdjacents(next, dummy, next);
00075		}
00076	}
00077	
00078	defaultproperties
00079	{
00080	     bStatic=False
00081	     DrawType=DT_SkeletalMesh
00082	     bComplexOcclusion=True
00083	     CollisionRadius=220.000000
00084	     bCollideActors=True
00085	     bBlockActors=True
00086	     bBlockPlayers=True
00087	     bJointsBlock=True
00088	     bJointsTouch=True
00089	     Mass=50.000000
00090	     Skeletal=SkelModel'objects.BoneBridge'
00091	}

End Source Code