private void UpdateKeys(float frameTime, Controller input) { this.mDirectionFactor = input.MovementFactor; this.FastMove = input.IsActionOccuring(UserAction.Sprint); this.MouseMovement(frameTime, input.Yaw, input.Pitch); }
public void UpdateCamera(float frameTime, Controller input = null) { if (input != null) { this.UpdateKeys(frameTime, input); } if (this.mFreeze) { return; } Vector3 move = Vector3.ZERO; move += this.mCamera.Direction * this.mDirectionFactor.z; move -= this.mCamera.Right * this.mDirectionFactor.x; move += this.mCamera.Up * this.mDirectionFactor.y; move.Normalise(); move *= 800; if (this.mFastMove) { move *= 6; } if (move != Vector3.ZERO) { this.mCamera.Move(move * frameTime); } }
public bool Setup() { this.mRoot = new Root(PLUGINS_CFG); if(!this.Configure()) { return false; } this.ChooseSceneManager(); this.CreateCamera(); this.CreateViewports(); TextureManager.Singleton.DefaultNumMipmaps = 5; this.LoadResources(); int windowHnd; this.mWindow.GetCustomAttribute("WINDOW", out windowHnd); this.mController = new Controller(this, windowHnd); MaterialManager.Singleton.SetDefaultTextureFiltering(TextureFilterOptions.TFO_NONE); this.AddFrameLstn(new RootLstn(TypeLstn.FrameRendering, this.OnFrameRendering)); GraphicBlock.generateFace(); LogManager.Singleton.DefaultLog.LogMessage("***********************Program\'s Log***********************"); //LogManager.Singleton.DefaultLog.LogDetail = LoggingLevel.LL_LOW; this.mSceneMgr.ShadowFarDistance = 400; Game.World.Display.ColoredMaterials.Init(); this.Resize += this.OgreForm_Resize; return true; }
public void UpdateEmotes(Controller controller) { if (this.AnimMgr.AreAnimationsPlaying(GetString(AnimName.JumpStart, AnimName.JumpLoop, AnimName.JumpEnd, AnimName.RunBase, AnimName.RunTop))) { return; } foreach (Emote emote in this.mEmotes.Where(emote => controller.HasActionOccured(emote.Action))) { string[] names = GetString(emote.Anim); if (!this.AnimMgr.AreAnimationsPlaying(names)) this.AnimMgr.SetAnims(names); else this.AnimMgr.DeleteAnims(names); } }