mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Swapped out the pieceofshit robot model for a male human one from a public repo
This commit is contained in:
@@ -104,16 +104,32 @@ namespace SS3D.Modules.Mobs
|
||||
}
|
||||
|
||||
// This is horrible I know, it will be changed!
|
||||
public void Animate(string animation)
|
||||
{
|
||||
if (!mobDict.Keys.Contains(myMobID))
|
||||
return;
|
||||
|
||||
mobDict[myMobID].animState.Enabled = true;
|
||||
mobDict[myMobID].animState.Loop = true;
|
||||
|
||||
switch (animation)
|
||||
{
|
||||
case "walk":
|
||||
mobDict[myMobID].animState = mobDict[myMobID].Entity.GetAnimationState("trns_walk");
|
||||
break;
|
||||
case "idle":
|
||||
mobDict[myMobID].animState = mobDict[myMobID].Entity.GetAnimationState("idle");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
public void MoveMe(int i)
|
||||
{
|
||||
mobDict[myMobID].animState = mobDict[myMobID].Entity.GetAnimationState("Walk");
|
||||
mobDict[myMobID].animState.Enabled = true;
|
||||
mobDict[myMobID].animState.Loop = true;
|
||||
Mogre.Vector3 lastPosition = mobDict[myMobID].Node.Position;
|
||||
switch (i)
|
||||
{
|
||||
case 1:
|
||||
mobDict[myMobID].Node.Translate(new Vector3(1, 0, 0), Node.TransformSpace.TS_LOCAL);
|
||||
mobDict[myMobID].Node.Translate(new Vector3(0, 0, 1), Node.TransformSpace.TS_LOCAL);
|
||||
break;
|
||||
case 2:
|
||||
mobDict[myMobID].Node.Rotate(Mogre.Vector3.UNIT_Y, Mogre.Math.DegreesToRadians(-2));
|
||||
@@ -122,7 +138,7 @@ namespace SS3D.Modules.Mobs
|
||||
mobDict[myMobID].Node.Rotate(Mogre.Vector3.UNIT_Y, Mogre.Math.DegreesToRadians(2));
|
||||
break;
|
||||
case 4:
|
||||
mobDict[myMobID].Node.Translate(new Vector3(-1, 0, 0), Node.TransformSpace.TS_LOCAL);
|
||||
mobDict[myMobID].Node.Translate(new Vector3(0, 0, -1), Node.TransformSpace.TS_LOCAL);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -236,7 +252,7 @@ namespace SS3D.Modules.Mobs
|
||||
myMobID = mobID;
|
||||
|
||||
mEngine.Camera.DetachFromParent();
|
||||
mEngine.Camera.Position = new Vector3(-160, 240, 0);
|
||||
mEngine.Camera.Position = new Vector3(0, 240, -160);
|
||||
|
||||
SceneNode camNode = mob.Node.CreateChildSceneNode();
|
||||
camNode.AttachObject(mEngine.Camera);
|
||||
|
||||
@@ -173,6 +173,7 @@ namespace SS3D.States
|
||||
if(keyState.IsKeyDown(MOIS.KeyCode.KC_W))
|
||||
{
|
||||
mobManager.MoveMe(1);
|
||||
mobManager.Animate("walk");
|
||||
}
|
||||
if(keyState.IsKeyDown(MOIS.KeyCode.KC_D))
|
||||
{
|
||||
@@ -185,6 +186,11 @@ namespace SS3D.States
|
||||
if (keyState.IsKeyDown(MOIS.KeyCode.KC_S))
|
||||
{
|
||||
mobManager.MoveMe(4);
|
||||
mobManager.Animate("walk");
|
||||
}
|
||||
if (!keyState.IsKeyDown(MOIS.KeyCode.KC_W) && !keyState.IsKeyDown(MOIS.KeyCode.KC_S))
|
||||
{
|
||||
mobManager.Animate("idle");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,15 +26,15 @@ namespace SS3D_shared
|
||||
sceneManager.DestroySceneNode(entityName);
|
||||
}
|
||||
Node = sceneManager.RootSceneNode.CreateChildSceneNode(entityName);
|
||||
Entity = sceneManager.CreateEntity(entityName, "robot.mesh");
|
||||
Entity = sceneManager.CreateEntity(entityName, "male.mesh");
|
||||
Entity.UserObject = (AtomBaseClass)this;
|
||||
Node.Scale(0.4f, 0.4f, 0.4f);
|
||||
Node.Scale(15f, 15f, 15f);
|
||||
Node.Position = position;
|
||||
Node.AttachObject(Entity);
|
||||
interpolationPacket = new List<InterpolationPacket>();
|
||||
mobID = ID;
|
||||
|
||||
animState = Entity.GetAnimationState("Idle");
|
||||
animState = Entity.GetAnimationState("idle");
|
||||
animState.Loop = true;
|
||||
animState.Enabled = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user