public override void AssignAvatar(int actorId) { base.AssignAvatar(actorId); PlayerIndex inputIndex = GameResources.PlaySession.LocalPlayers[PlayerId]; Actor avatar = GameResources.ActorManager.GetActorById(ActorId); BipedControllerComponent bipedControl = avatar.GetComponent<BipedControllerComponent>(ActorComponent.ComponentType.Control); bipedControl.AimCheck = delegate() { return mInputMode == InputMode.Aiming; }; // Begin InputProcessors configuration: // Biped, aloof mode: TPBipedFixedControlsInputProcessor bipedProc; if (mInputProcs[(int)(InputMode.Aloof)].ContainsKey(typeof(TPBipedFixedControlsInputProcessor))) { bipedProc = (TPBipedFixedControlsInputProcessor)(mInputProcs[(int)(InputMode.Aloof)][typeof(TPBipedFixedControlsInputProcessor)]); } else { bipedProc = new TPBipedFixedControlsInputProcessor(inputIndex, mCamera); mInputProcs[(int)(InputMode.Aloof)].Add(typeof(TPBipedFixedControlsInputProcessor), bipedProc); } bipedProc.ActiveInputMap = mPlayerInputMap; bipedProc.SetControllerComponent(bipedControl); // Biped, aiming mode: TPAimingBipedMovementInputProcessor aimingBipedProc; if (mInputProcs[(int)(InputMode.Aiming)].ContainsKey(typeof(TPAimingBipedMovementInputProcessor))) { aimingBipedProc = (TPAimingBipedMovementInputProcessor)(mInputProcs[(int)(InputMode.Aiming)][typeof(TPAimingBipedMovementInputProcessor)]); } else { aimingBipedProc = new TPAimingBipedMovementInputProcessor(inputIndex); mInputProcs[(int)(InputMode.Aiming)].Add(typeof(TPAimingBipedMovementInputProcessor), aimingBipedProc); } aimingBipedProc.ActiveInputMap = mPlayerInputMap; aimingBipedProc.SetControllerComponent(bipedControl); // Skill palette, shared between aiming and aloof modes: TPBipedPaletteInputProcessor paletteProc; if (mInputProcs[(int)(InputMode.Aloof)].ContainsKey(typeof(TPBipedPaletteInputProcessor))) { paletteProc = (TPBipedPaletteInputProcessor)(mInputProcs[(int)(InputMode.Aloof)][typeof(TPBipedPaletteInputProcessor)]); } else { paletteProc = new TPBipedPaletteInputProcessor(inputIndex); mInputProcs[(int)(InputMode.Aloof)].Add(typeof(TPBipedPaletteInputProcessor), paletteProc); } if (!(mInputProcs[(int)(InputMode.Aiming)].ContainsKey(typeof(TPBipedPaletteInputProcessor)))) { mInputProcs[(int)(InputMode.Aiming)].Add(typeof(TPBipedPaletteInputProcessor), paletteProc); } paletteProc.ActiveInputMap = mPlayerInputMap; paletteProc.SetControllerComponent(bipedControl); BipedSkillPalette skillPalette = avatar.GetBehaviorThatImplementsType<BipedSkillPalette>(); paletteProc.SetSkillPalette(skillPalette); // Camera, aloof mode: TPCameraInputProcessor camera; if (mInputProcs[(int)(InputMode.Aloof)].ContainsKey(typeof(TPCameraInputProcessor))) { camera = (TPCameraInputProcessor)(mInputProcs[(int)(InputMode.Aloof)][typeof(TPCameraInputProcessor)]); } else { camera = new TPCameraInputProcessor(inputIndex, mMmoCameraDesc); mInputProcs[(int)(InputMode.Aloof)].Add(typeof(TPCameraInputProcessor), camera); } camera.ActiveInputMap = mPlayerInputMap; // Done with InputProcessor configuration. // Reset camera placement: mMmoCameraDesc.Distance = 38.0f; mMmoCameraDesc.Pitch = -MathHelper.Pi / 6.0f; // Positive pitch will move the camera -Y since it's on the +Z side mMmoCameraDesc.Yaw = 0.0f; DynamicCollisionComponent dcc = avatar.GetComponent<DynamicCollisionComponent>(ActorComponent.ComponentType.Physics); mAvatarBepuEntity = dcc.Entity; }