public void MathSharp() { Vector128 <float> newScale = Vector.Multiply(_mathSharpScale, _mathSharpAmount); Vector128 <float> deltaT = Vector.Multiply(_mathSharpScale, Vector.Subtract(Vector.SingleConstants.One, _mathSharpAmount)); deltaT = Vector.Multiply(deltaT, _mathSharpAnchor); Vector128 <float> result = Vector.Multiply((Vector.Add(_mathSharpTranslation, deltaT)), newScale); result.StoreToVector(out _mathSharpResult); }
public unsafe void MathSharpWithStorageTypes() { fixed(Vector2F *pScale = &_storageMathSharpScale) fixed(Vector2F * pAmount = &_storageMathSharpAmount) fixed(Vector2F * pAnchor = &_storageMathSharpAnchor) fixed(Vector2F * pTranslation = &_storageMathSharpTranslation) { var scale = VectorExtensions.ToVector128(pScale); var amount = VectorExtensions.ToVector128(pAmount); var anchor = VectorExtensions.ToVector128(pAnchor); var translation = VectorExtensions.ToVector128(pTranslation); Vector128 <float> newScale = Vector.Multiply(scale, amount); Vector128 <float> deltaT = Vector.Multiply(scale, Vector.Subtract(Vector.SingleConstants.One, amount)); deltaT = Vector.Multiply(deltaT, anchor); Vector128 <float> result = Vector.Multiply((Vector.Add(translation, deltaT)), newScale); result.StoreToVector(out _mathSharpResult); } }