public NewGlyphTrainingStage(int targetGlyphIndex, Focus Focus, OrientationSensorProvider Provider = null) : base($"Training glyph {Glyph.AllGlyphs[targetGlyphIndex].Name}") { TargetGlyphIndex = targetGlyphIndex; TargetGlyph = Glyph.AllGlyphs[targetGlyphIndex]; Implement = Focus; Res.DebuggingSignalFlag = true; verbLog("Ctor"); Stillness = new StillnessProvider(); //Stillness.StartDisplayLoop(Current, 750); SetUpProvider(Stillness); Volume = 0.1f; verbLog("Averages"); //AverageAttitude = new AdvancedRollingAverageQuat(timeFrameInPeriods: 15); AverageAttitude = new RollingAverage <Quaternion>(timeFrameInPeriods: 10); AttitudeProvider = Provider ?? new GravityOrientationProvider(Implement.FrameShift); AttitudeProvider.Activate(); if (targetGlyphIndex == 0) { lastOrientation = Quaternion.Identity; } else { lastOrientation = Glyph.AllGlyphs[targetGlyphIndex - 1].Orientation; } verbLog("Auto-activation"); Activate(); }
public GlyphTrainingStage(string label, Focus Focus, OrientationSensorProvider Provider = null) : base(label) { Implement = Focus; Res.DebuggingSignalFlag = true; verbLog("Ctor"); Stillness = new StillnessProvider(); //Stillness.StartDisplayLoop(Current, 750); SetUpProvider(Stillness); Volume = 0.1f; verbLog("Averages"); //AverageAttitude = new AdvancedRollingAverageQuat(timeFrameInPeriods: 15); AverageAttitude = new RollingAverage <Quaternion>(timeFrameInPeriods: 10); AttitudeProvider = Provider ?? new GravityOrientationProvider(Implement.FrameShift); AttitudeProvider.Activate(); if (Current.SpellBeingTrained.Glyphs.Count == 0) { lastOrientation = Quaternion.Identity; } else { lastOrientation = Current.SpellBeingTrained.Glyphs.Last().Orientation; } verbLog("Auto-activation"); Activate(); }