public override void UpdateAfterSimulation() { base.UpdateAfterSimulation(); //MyRenderProxy.DebugDrawSphere(m_gunBase.PositionMuzzleWorld, 0.2f, new Vector3(1, 0, 0), 1.0f, true); if (Owner == null) { return; } Vector3 weaponLocalPosition = Owner.GetLocalWeaponPosition(); Vector3D localDummyPosition = m_gunBase.GetMuzzleLocalPosition(); MatrixD weaponWorld = WorldMatrix; Vector3D localDummyPositionRotated; Vector3D.Rotate(ref localDummyPosition, ref weaponWorld, out localDummyPositionRotated); m_raycastComponent.SetPointOfReference(Owner.PositionComp.GetPosition() + weaponLocalPosition + localDummyPositionRotated); SinkComp.Update(); if (IsShooting && !SinkComp.IsPowered) { EndShoot(MyShootActionEnum.PrimaryAction); } UpdateEffect(); CheckEffectType(); if (Owner != null && Owner.ControllerInfo.IsLocallyHumanControlled()) { if (MySession.Static.SurvivalMode && (MySession.Static.GetCameraControllerEnum() != MyCameraControllerEnum.Spectator || MyFinalBuildConstants.IS_OFFICIAL)) { var character = ((MyCharacter)this.CharacterInventory.Owner); MyCubeBuilder.Static.MaxGridDistanceFrom = character.PositionComp.GetPosition() + character.WorldMatrix.Up * 1.8f; } else { MyCubeBuilder.Static.MaxGridDistanceFrom = null; } } //MyTrace.Watch("MyEngineerToolBase.RequiredPowerInput", RequiredPowerInput); }