mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-23 23:21:49 +01:00
Add rotation routine for LS and RS
This commit is contained in:
parent
2fabd860a2
commit
d74820dbf5
@ -409,8 +409,17 @@ namespace DS4Windows
|
||||
return (value < min) ? min : (value > max) ? max : value;
|
||||
}
|
||||
|
||||
private static double[] tempDoubleArray = { 0.0, 0.0, 0.0, 0.0 };
|
||||
public static DS4State SetCurveAndDeadzone(int device, DS4State cState)
|
||||
{
|
||||
double rotation = tempDoubleArray[device] = getLSRotation(device);
|
||||
if (rotation != 0.0)
|
||||
cState.rotateLSCoordinates(rotation);
|
||||
|
||||
double rotationRS = tempDoubleArray[device] = getRSRotation(device);
|
||||
if (rotationRS != 0.0)
|
||||
cState.rotateRSCoordinates(rotationRS);
|
||||
|
||||
DS4State dState = new DS4State(cState);
|
||||
int x;
|
||||
int y;
|
||||
|
@ -756,6 +756,18 @@ namespace DS4Windows
|
||||
return m_Config.rsCurve[index];
|
||||
}
|
||||
|
||||
public static double[] LSRotation => m_Config.LSRotation;
|
||||
public static double getLSRotation(int index)
|
||||
{
|
||||
return m_Config.LSRotation[index];
|
||||
}
|
||||
|
||||
public static double[] RSRotation => m_Config.RSRotation;
|
||||
public static double getRSRotation(int index)
|
||||
{
|
||||
return m_Config.RSRotation[index];
|
||||
}
|
||||
|
||||
public static double[] L2Sens => m_Config.l2Sens;
|
||||
public static double getL2Sens(int index)
|
||||
{
|
||||
@ -1144,6 +1156,7 @@ namespace DS4Windows
|
||||
public int[] LSMaxzone = { 100, 100, 100, 100, 100 }, RSMaxzone = { 100, 100, 100, 100, 100 };
|
||||
public int[] l2AntiDeadzone = { 0, 0, 0, 0, 0 }, r2AntiDeadzone = { 0, 0, 0, 0, 0 };
|
||||
public int[] l2Maxzone = { 100, 100, 100, 100, 100 }, r2Maxzone = { 100, 100, 100, 100, 100 };
|
||||
public double[] LSRotation = { 0.0, 0.0, 0.0, 0.0, 0.0 }, RSRotation = { 0.0, 0.0, 0.0, 0.0, 0.0 };
|
||||
public double[] SXDeadzone = { 0.25, 0.25, 0.25, 0.25, 0.25 }, SZDeadzone = { 0.25, 0.25, 0.25, 0.25, 0.25 };
|
||||
public double[] l2Sens = { 1, 1, 1, 1, 1 }, r2Sens = { 1, 1, 1, 1, 1 };
|
||||
public double[] LSSens = { 1, 1, 1, 1, 1 }, RSSens = { 1, 1, 1, 1, 1 };
|
||||
@ -1444,6 +1457,9 @@ namespace DS4Windows
|
||||
XmlNode xmlRSAD = m_Xdoc.CreateNode(XmlNodeType.Element, "RSAntiDeadZone", null); xmlRSAD.InnerText = RSAntiDeadzone[device].ToString(); Node.AppendChild(xmlRSAD);
|
||||
XmlNode xmlLSMaxZone = m_Xdoc.CreateNode(XmlNodeType.Element, "LSMaxZone", null); xmlLSMaxZone.InnerText = LSMaxzone[device].ToString(); Node.AppendChild(xmlLSMaxZone);
|
||||
XmlNode xmlRSMaxZone = m_Xdoc.CreateNode(XmlNodeType.Element, "RSMaxZone", null); xmlRSMaxZone.InnerText = RSMaxzone[device].ToString(); Node.AppendChild(xmlRSMaxZone);
|
||||
XmlNode xmlLSRotation = m_Xdoc.CreateNode(XmlNodeType.Element, "LSRotation", null); xmlLSRotation.InnerText = Convert.ToInt32(LSRotation[device] * 180.0 / Math.PI).ToString(); Node.AppendChild(xmlLSRotation);
|
||||
XmlNode xmlRSRotation = m_Xdoc.CreateNode(XmlNodeType.Element, "RSRotation", null); xmlRSRotation.InnerText = Convert.ToInt32(RSRotation[device] * 180.0 / Math.PI).ToString(); Node.AppendChild(xmlRSRotation);
|
||||
|
||||
XmlNode xmlSXD = m_Xdoc.CreateNode(XmlNodeType.Element, "SXDeadZone", null); xmlSXD.InnerText = SXDeadzone[device].ToString(); Node.AppendChild(xmlSXD);
|
||||
XmlNode xmlSZD = m_Xdoc.CreateNode(XmlNodeType.Element, "SZDeadZone", null); xmlSZD.InnerText = SZDeadzone[device].ToString(); Node.AppendChild(xmlSZD);
|
||||
|
||||
@ -2195,6 +2211,24 @@ namespace DS4Windows
|
||||
}
|
||||
catch { r2Maxzone[device] = 100; missingSetting = true; }
|
||||
|
||||
try
|
||||
{
|
||||
Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LSRotation"); int temp = 0;
|
||||
int.TryParse(Item.InnerText, out temp);
|
||||
temp = Math.Min(Math.Max(temp, -180), 180);
|
||||
LSRotation[device] = temp * Math.PI / 180.0;
|
||||
}
|
||||
catch { LSRotation[device] = 0.0; missingSetting = true; }
|
||||
|
||||
try
|
||||
{
|
||||
Item = m_Xdoc.SelectSingleNode("/" + rootname + "/RSRotation"); int temp = 0;
|
||||
int.TryParse(Item.InnerText, out temp);
|
||||
temp = Math.Min(Math.Max(temp, -180), 180);
|
||||
RSRotation[device] = temp * Math.PI / 180.0;
|
||||
}
|
||||
catch { RSRotation[device] = 0.0; missingSetting = true; }
|
||||
|
||||
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/ButtonMouseSensitivity"); int.TryParse(Item.InnerText, out buttonMouseSensitivity[device]); }
|
||||
catch { missingSetting = true; }
|
||||
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/Rainbow"); double.TryParse(Item.InnerText, out rainbow[device]); }
|
||||
@ -2387,7 +2421,7 @@ namespace DS4Windows
|
||||
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroSmoothing"); bool.TryParse(Item.InnerText, out gyroSmoothing[device]); }
|
||||
catch { gyroSmoothing[device] = false; missingSetting = true; }
|
||||
|
||||
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroSmoothingWeight"); int temp = 0; int.TryParse(Item.InnerText, out temp); gyroSmoothWeight[device] = Convert.ToDouble(temp * 0.01); }
|
||||
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroSmoothingWeight"); int temp = 0; int.TryParse(Item.InnerText, out temp); gyroSmoothWeight[device] = Math.Min(Math.Max(0.0, Convert.ToDouble(temp * 0.01)), 1.0); }
|
||||
catch { gyroSmoothWeight[device] = 0.5; missingSetting = true; }
|
||||
|
||||
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LSCurve"); int.TryParse(Item.InnerText, out lsCurve[device]); }
|
||||
@ -3399,6 +3433,8 @@ namespace DS4Windows
|
||||
LSMaxzone[device] = RSMaxzone[device] = 100;
|
||||
l2AntiDeadzone[device] = r2AntiDeadzone[device] = 0;
|
||||
l2Maxzone[device] = r2Maxzone[device] = 100;
|
||||
LSRotation[device] = 0.0;
|
||||
RSRotation[device] = 0.0;
|
||||
SXDeadzone[device] = SZDeadzone[device] = 0.25;
|
||||
l2Sens[device] = r2Sens[device] = 1;
|
||||
LSSens[device] = RSSens[device] = 1;
|
||||
|
128
DS4Windows/DS4Forms/Options.Designer.cs
generated
128
DS4Windows/DS4Forms/Options.Designer.cs
generated
@ -287,6 +287,10 @@
|
||||
this.rBSAControls = new System.Windows.Forms.RadioButton();
|
||||
this.rBSAMouse = new System.Windows.Forms.RadioButton();
|
||||
this.pnlSAMouse = new System.Windows.Forms.Panel();
|
||||
this.lbGyroSmooth = new System.Windows.Forms.Label();
|
||||
this.cBGyroSmooth = new System.Windows.Forms.CheckBox();
|
||||
this.lbSmoothWeight = new System.Windows.Forms.Label();
|
||||
this.nUDGyroSmoothWeight = new System.Windows.Forms.NumericUpDown();
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.nUDGyroMouseVertScale = new System.Windows.Forms.NumericUpDown();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
@ -332,11 +336,12 @@
|
||||
this.shareToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.pSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.alwaysOnToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.nUDGyroSmoothWeight = new System.Windows.Forms.NumericUpDown();
|
||||
this.lbSmoothWeight = new System.Windows.Forms.Label();
|
||||
this.cBGyroSmooth = new System.Windows.Forms.CheckBox();
|
||||
this.advColorDialog = new DS4Windows.AdvancedColorDialog();
|
||||
this.lbGyroSmooth = new System.Windows.Forms.Label();
|
||||
this.tpRotation = new System.Windows.Forms.TabPage();
|
||||
this.label13 = new System.Windows.Forms.Label();
|
||||
this.nUDLSRotation = new System.Windows.Forms.NumericUpDown();
|
||||
this.label14 = new System.Windows.Forms.Label();
|
||||
this.nUDRSRotation = new System.Windows.Forms.NumericUpDown();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tBBlueBar)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tBGreenBar)).BeginInit();
|
||||
@ -410,6 +415,7 @@
|
||||
this.fLPSettings.SuspendLayout();
|
||||
this.gBGyro.SuspendLayout();
|
||||
this.pnlSAMouse.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDGyroSmoothWeight)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDGyroMouseVertScale)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDGyroSensitivity)).BeginInit();
|
||||
this.gBSensitivity.SuspendLayout();
|
||||
@ -420,7 +426,9 @@
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDSXS)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).BeginInit();
|
||||
this.cMGyroTriggers.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDGyroSmoothWeight)).BeginInit();
|
||||
this.tpRotation.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDLSRotation)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDRSRotation)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lowColorChooserButton
|
||||
@ -2633,6 +2641,7 @@
|
||||
this.tCSens.Controls.Add(this.maxZoneTabPage);
|
||||
this.tCSens.Controls.Add(this.tPCurve);
|
||||
this.tCSens.Controls.Add(this.tPOutCurve);
|
||||
this.tCSens.Controls.Add(this.tpRotation);
|
||||
resources.ApplyResources(this.tCSens, "tCSens");
|
||||
this.tCSens.Name = "tCSens";
|
||||
this.tCSens.SelectedIndex = 0;
|
||||
@ -3040,6 +3049,40 @@
|
||||
resources.ApplyResources(this.pnlSAMouse, "pnlSAMouse");
|
||||
this.pnlSAMouse.Name = "pnlSAMouse";
|
||||
//
|
||||
// lbGyroSmooth
|
||||
//
|
||||
resources.ApplyResources(this.lbGyroSmooth, "lbGyroSmooth");
|
||||
this.lbGyroSmooth.Name = "lbGyroSmooth";
|
||||
//
|
||||
// cBGyroSmooth
|
||||
//
|
||||
resources.ApplyResources(this.cBGyroSmooth, "cBGyroSmooth");
|
||||
this.cBGyroSmooth.Name = "cBGyroSmooth";
|
||||
this.cBGyroSmooth.UseVisualStyleBackColor = true;
|
||||
this.cBGyroSmooth.CheckedChanged += new System.EventHandler(this.cBGyroSmooth_CheckedChanged);
|
||||
//
|
||||
// lbSmoothWeight
|
||||
//
|
||||
resources.ApplyResources(this.lbSmoothWeight, "lbSmoothWeight");
|
||||
this.lbSmoothWeight.Name = "lbSmoothWeight";
|
||||
//
|
||||
// nUDGyroSmoothWeight
|
||||
//
|
||||
this.nUDGyroSmoothWeight.DecimalPlaces = 3;
|
||||
resources.ApplyResources(this.nUDGyroSmoothWeight, "nUDGyroSmoothWeight");
|
||||
this.nUDGyroSmoothWeight.Maximum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nUDGyroSmoothWeight.Name = "nUDGyroSmoothWeight";
|
||||
this.nUDGyroSmoothWeight.Value = new decimal(new int[] {
|
||||
5,
|
||||
0,
|
||||
0,
|
||||
65536});
|
||||
this.nUDGyroSmoothWeight.ValueChanged += new System.EventHandler(this.nUDGyroSmoothWeight_ValueChanged);
|
||||
//
|
||||
// label12
|
||||
//
|
||||
resources.ApplyResources(this.label12, "label12");
|
||||
@ -3532,39 +3575,57 @@
|
||||
resources.ApplyResources(this.alwaysOnToolStripMenuItem, "alwaysOnToolStripMenuItem");
|
||||
this.alwaysOnToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged);
|
||||
//
|
||||
// nUDGyroSmoothWeight
|
||||
// tpRotation
|
||||
//
|
||||
this.nUDGyroSmoothWeight.DecimalPlaces = 3;
|
||||
resources.ApplyResources(this.nUDGyroSmoothWeight, "nUDGyroSmoothWeight");
|
||||
this.nUDGyroSmoothWeight.Maximum = new decimal(new int[] {
|
||||
1,
|
||||
this.tpRotation.Controls.Add(this.nUDRSRotation);
|
||||
this.tpRotation.Controls.Add(this.label14);
|
||||
this.tpRotation.Controls.Add(this.nUDLSRotation);
|
||||
this.tpRotation.Controls.Add(this.label13);
|
||||
resources.ApplyResources(this.tpRotation, "tpRotation");
|
||||
this.tpRotation.Name = "tpRotation";
|
||||
this.tpRotation.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label13
|
||||
//
|
||||
resources.ApplyResources(this.label13, "label13");
|
||||
this.label13.Name = "label13";
|
||||
//
|
||||
// nUDLSRotation
|
||||
//
|
||||
resources.ApplyResources(this.nUDLSRotation, "nUDLSRotation");
|
||||
this.nUDLSRotation.Maximum = new decimal(new int[] {
|
||||
180,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nUDGyroSmoothWeight.Name = "nUDGyroSmoothWeight";
|
||||
this.nUDGyroSmoothWeight.Value = new decimal(new int[] {
|
||||
5,
|
||||
this.nUDLSRotation.Minimum = new decimal(new int[] {
|
||||
180,
|
||||
0,
|
||||
0,
|
||||
65536});
|
||||
this.nUDGyroSmoothWeight.ValueChanged += new System.EventHandler(this.nUDGyroSmoothWeight_ValueChanged);
|
||||
-2147483648});
|
||||
this.nUDLSRotation.Name = "nUDLSRotation";
|
||||
this.nUDLSRotation.ValueChanged += new System.EventHandler(this.nUDLSRotation_ValueChanged);
|
||||
//
|
||||
// lbSmoothWeight
|
||||
// label14
|
||||
//
|
||||
resources.ApplyResources(this.lbSmoothWeight, "lbSmoothWeight");
|
||||
this.lbSmoothWeight.Name = "lbSmoothWeight";
|
||||
resources.ApplyResources(this.label14, "label14");
|
||||
this.label14.Name = "label14";
|
||||
//
|
||||
// cBGyroSmooth
|
||||
// nUDRSRotation
|
||||
//
|
||||
resources.ApplyResources(this.cBGyroSmooth, "cBGyroSmooth");
|
||||
this.cBGyroSmooth.Name = "cBGyroSmooth";
|
||||
this.cBGyroSmooth.UseVisualStyleBackColor = true;
|
||||
this.cBGyroSmooth.CheckedChanged += new System.EventHandler(this.cBGyroSmooth_CheckedChanged);
|
||||
//
|
||||
// lbGyroSmooth
|
||||
//
|
||||
resources.ApplyResources(this.lbGyroSmooth, "lbGyroSmooth");
|
||||
this.lbGyroSmooth.Name = "lbGyroSmooth";
|
||||
resources.ApplyResources(this.nUDRSRotation, "nUDRSRotation");
|
||||
this.nUDRSRotation.Maximum = new decimal(new int[] {
|
||||
180,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nUDRSRotation.Minimum = new decimal(new int[] {
|
||||
180,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
this.nUDRSRotation.Name = "nUDRSRotation";
|
||||
this.nUDRSRotation.ValueChanged += new System.EventHandler(this.nUDRSRotation_ValueChanged);
|
||||
//
|
||||
// Options
|
||||
//
|
||||
@ -3667,6 +3728,7 @@
|
||||
this.gBGyro.PerformLayout();
|
||||
this.pnlSAMouse.ResumeLayout(false);
|
||||
this.pnlSAMouse.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDGyroSmoothWeight)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDGyroMouseVertScale)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDGyroSensitivity)).EndInit();
|
||||
this.gBSensitivity.ResumeLayout(false);
|
||||
@ -3678,7 +3740,10 @@
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDSXS)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).EndInit();
|
||||
this.cMGyroTriggers.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDGyroSmoothWeight)).EndInit();
|
||||
this.tpRotation.ResumeLayout(false);
|
||||
this.tpRotation.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDLSRotation)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDRSRotation)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@ -3994,5 +4059,10 @@
|
||||
private System.Windows.Forms.NumericUpDown nUDGyroSmoothWeight;
|
||||
private System.Windows.Forms.CheckBox cBGyroSmooth;
|
||||
private System.Windows.Forms.Label lbGyroSmooth;
|
||||
private System.Windows.Forms.TabPage tpRotation;
|
||||
private System.Windows.Forms.NumericUpDown nUDRSRotation;
|
||||
private System.Windows.Forms.Label label14;
|
||||
private System.Windows.Forms.NumericUpDown nUDLSRotation;
|
||||
private System.Windows.Forms.Label label13;
|
||||
}
|
||||
}
|
@ -464,6 +464,24 @@ namespace DS4Windows
|
||||
nUDRSMaxZone.Value = 1;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
nUDLSRotation.Value = (decimal)(LSRotation[device] * 180.0 / Math.PI);
|
||||
}
|
||||
catch
|
||||
{
|
||||
nUDLSRotation.Value = 0.0m;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
nUDRSRotation.Value = (decimal)(RSRotation[device] * 180.0 / Math.PI);
|
||||
}
|
||||
catch
|
||||
{
|
||||
nUDRSRotation.Value = 0.0m;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
nUDSX.Value = (decimal)SXDeadzone[device];
|
||||
@ -645,6 +663,8 @@ namespace DS4Windows
|
||||
nUDRSAntiDead.Value = 0;
|
||||
nUDLSMaxZone.Value = 1;
|
||||
nUDRSMaxZone.Value = 1;
|
||||
nUDLSRotation.Value = 0;
|
||||
nUDRSRotation.Value = 0;
|
||||
nUDSX.Value = .25m;
|
||||
nUDSZ.Value = .25m;
|
||||
|
||||
@ -1298,6 +1318,10 @@ namespace DS4Windows
|
||||
LSDeadzone[device] = (int)Math.Round((nUDLS.Value * 127), 0);
|
||||
LSAntiDeadzone[device] = (int)(nUDLSAntiDead.Value * 100);
|
||||
RSAntiDeadzone[device] = (int)(nUDRSAntiDead.Value * 100);
|
||||
LSMaxzone[device] = (int)(nUDLSMaxZone.Value * 100);
|
||||
RSMaxzone[device] = (int)(nUDRSMaxZone.Value * 100);
|
||||
LSRotation[device] = (double)nUDLSRotation.Value * Math.PI / 180.0;
|
||||
RSRotation[device] = (double)nUDRSRotation.Value * Math.PI / 180.0;
|
||||
ButtonMouseSensitivity[device] = (int)numUDMouseSens.Value;
|
||||
FlashAt[device] = (int)nUDflashLED.Value;
|
||||
SXDeadzone[device] = (double)nUDSX.Value;
|
||||
@ -2853,6 +2877,22 @@ namespace DS4Windows
|
||||
}
|
||||
}
|
||||
|
||||
private void nUDLSRotation_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!loading)
|
||||
{
|
||||
LSRotation[device] = (double)nUDLSRotation.Value * Math.PI / 180.0;
|
||||
}
|
||||
}
|
||||
|
||||
private void nUDRSRotation_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!loading)
|
||||
{
|
||||
RSRotation[device] = (double)nUDRSRotation.Value * Math.PI / 180.0;
|
||||
}
|
||||
}
|
||||
|
||||
private void Options_Resize(object sender, EventArgs e)
|
||||
{
|
||||
fLPSettings.AutoScroll = false;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -159,5 +159,25 @@ namespace DS4Windows
|
||||
RXUnit = Math.Abs(Math.Cos(RSAngleRad));
|
||||
RYUnit = Math.Abs(Math.Sin(LSAngleRad));
|
||||
}
|
||||
|
||||
public void rotateLSCoordinates(double rotation)
|
||||
{
|
||||
double sinAngle = Math.Sin(rotation), cosAngle = Math.Cos(rotation);
|
||||
double tempLX = LX - 127.5, tempLY = LY - 127.5;
|
||||
Byte tempx = (Byte)(tempLX * cosAngle - tempLY * sinAngle + 127.5);
|
||||
Byte tempy = (Byte)(tempLX * sinAngle + tempLY * cosAngle + 127.5);
|
||||
LX = tempx;
|
||||
LY = tempy;
|
||||
}
|
||||
|
||||
public void rotateRSCoordinates(double rotation)
|
||||
{
|
||||
double sinAngle = Math.Sin(rotation), cosAngle = Math.Cos(rotation);
|
||||
double tempRX = RX - 127.5, tempRY = RY - 127.5;
|
||||
Byte tempx = (Byte)(tempRX * cosAngle - tempRY * sinAngle + 127.5);
|
||||
Byte tempy = (Byte)(tempRX * sinAngle + tempRY * cosAngle + 127.5);
|
||||
RX = tempx;
|
||||
RY = tempy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user