GameObject AddLeg(Device device, Texture texture, Vector3 location) { var marioLegMesh = new MeshRenderer { Mesh = new TexturedCube(device, 0.24f, 0.24f, 0.3f, Mario.LegFrontUV, Mario.LegBackUV, Mario.LegLeftUV, Mario.LegRightUV, Mario.LegTopUV, Mario.LegBottomUV), Material = new TextureMaterial(texture, false) }; var container = _body.Add(new GameObject()); container.Translate(0, -0.05f, 0); var leg = container.Add(new GameObject()); leg.Translate(location + new Vector3(0, 0.05f, 0)); leg.Add(marioLegMesh); return container; }
GameObject AddArm(Device device, Texture texture, Vector3 location) { var marioArmMesh = new MeshRenderer { Mesh = new TexturedCube(device, 0.2f, 0.5f, 0.2f, Mario.ArmFrontUV, Mario.ArmBackUV, Mario.ArmLeftUV, Mario.ArmRightUV, Mario.ArmTopUV, Mario.ArmBottomUV), Material = new TextureMaterial(texture, false) }; var container = _body.Add(new GameObject()); container.Translate(0, 0.2f, 0); var arm = container.Add(new GameObject()); arm.Translate(location + new Vector3(0, -0.2f, 0)); arm.Add(marioArmMesh); return container; }