private void Oscillate() { MatrixFrame globalFrame = this.GameEntity.GetGlobalFrame(); globalFrame.rotation = Mat3.Lerp(this.oscillationStart.rotation, this.oscillationEnd.rotation, MathF.Clamp(this.oscillationPercentage, 0.0f, 1f)); this.GameEntity.SetGlobalFrame(globalFrame); this.oscillationPercentage = (float)((1.0 + Math.Cos((double)this.oscillationSpeed * 1.0 * (double)this.et)) / 2.0); }