private void SetupBody( SceneManager sceneMgr )
{
// create main model
bodyNode = sceneMgr.RootSceneNode.CreateChildSceneNode( Vector3.UnitY * CharHeight );
bodyEnt = sceneMgr.CreateEntity( "SinbadBody", "Sinbad.mesh" );
bodyNode.AttachObject( bodyEnt );
// create swords and attach to sheath
sword1 = sceneMgr.CreateEntity( "SinbadSword1", "Sword.mesh" );
sword2 = sceneMgr.CreateEntity( "SinbadSword2", "Sword.mesh" );
bodyEnt.AttachObjectToBone( "Sheath.L", sword1 );
bodyEnt.AttachObjectToBone( "Sheath.R", sword2 );
// create a couple of ribbon trails for the swords, just for fun
NamedParameterList paras = new NamedParameterList();
paras[ "numberOfChains" ] = "2";
paras[ "maxElements" ] = "80";
swordTrail = (RibbonTrail)sceneMgr.CreateMovableObject( "SinbadRibbon", "RibbonTrail", paras );
swordTrail.MaterialName = "Examples/LightRibbonTrail";
swordTrail.TrailLength = 20;
swordTrail.IsVisible = false;
sceneMgr.RootSceneNode.AttachObject( swordTrail );
for ( int i = 0; i < 2; i++ )
{
swordTrail.SetInitialColor( i, new ColorEx( 1, 0.8f, 0 ) );
swordTrail.SetColorChange( i, new ColorEx( 0.75f, 0.25f, 0.25f, 0.25f ) );
swordTrail.SetWidthChange( i, 1 );
swordTrail.SetInitialWidth( i, 0.5f );
}
keyDirection = Vector3.Zero;
verticalVelocity = 0;
}