Go back to C# stoneage to please Unity
This commit is contained in:
parent
7bf9f39301
commit
bf5855afa3
28
SpaceNav.cs
28
SpaceNav.cs
@ -110,7 +110,11 @@ namespace SpaceNavWrapper
|
|||||||
#region Properties
|
#region Properties
|
||||||
public double Sensitivity
|
public double Sensitivity
|
||||||
{
|
{
|
||||||
get => _sensitivity;
|
get
|
||||||
|
{
|
||||||
|
return _sensitivity;
|
||||||
|
}
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_sensitivity = value;
|
_sensitivity = value;
|
||||||
@ -120,26 +124,34 @@ namespace SpaceNavWrapper
|
|||||||
|
|
||||||
public int Threshold
|
public int Threshold
|
||||||
{
|
{
|
||||||
get => _threshold;
|
get
|
||||||
|
{
|
||||||
|
return _threshold;
|
||||||
|
}
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_threshold = value;
|
_threshold = value;
|
||||||
spnav_deadzone(value);
|
spnav_deadzone(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Nonblocking
|
public bool Nonblocking
|
||||||
{
|
{
|
||||||
get => _nonblocking;
|
get
|
||||||
|
{
|
||||||
|
return _nonblocking;
|
||||||
|
}
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_nonblocking = value;
|
_nonblocking = value;
|
||||||
spnav_set_nonblocking(value);
|
spnav_set_nonblocking(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
if (!isDisposed)
|
if (!isDisposed)
|
||||||
{
|
{
|
||||||
|
@ -13,24 +13,63 @@ namespace SpaceNavWrapper
|
|||||||
|
|
||||||
public MotionEventArgs(int x, int y, int z, int rx, int ry, int rz)
|
public MotionEventArgs(int x, int y, int z, int rx, int ry, int rz)
|
||||||
{
|
{
|
||||||
axisValues = new Dictionary<SpaceNavAxis, int>
|
axisValues = new Dictionary<SpaceNavAxis, int>();
|
||||||
{
|
axisValues[SpaceNavAxis.X] = x;
|
||||||
[SpaceNavAxis.X] = x,
|
axisValues[SpaceNavAxis.Y] = y;
|
||||||
[SpaceNavAxis.Y] = y,
|
axisValues[SpaceNavAxis.Z] = y;
|
||||||
[SpaceNavAxis.Z] = y,
|
axisValues[SpaceNavAxis.Rx] = rx;
|
||||||
[SpaceNavAxis.Rx] = rx,
|
axisValues[SpaceNavAxis.Ry] = ry;
|
||||||
[SpaceNavAxis.Ry] = ry,
|
axisValues[SpaceNavAxis.Rz] = rz;
|
||||||
[SpaceNavAxis.Rz] = rz
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int X => axisValues[SpaceNavAxis.X];
|
public int X
|
||||||
public int Y => axisValues[SpaceNavAxis.Y];
|
{
|
||||||
public int Z => axisValues[SpaceNavAxis.Z];
|
get
|
||||||
public int Rx => axisValues[SpaceNavAxis.Rx];
|
{
|
||||||
public int Ry => axisValues[SpaceNavAxis.Ry];
|
return axisValues[SpaceNavAxis.X];
|
||||||
public int Rz => axisValues[SpaceNavAxis.Rz];
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Y
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return axisValues[SpaceNavAxis.Y];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Z
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return axisValues[SpaceNavAxis.Z];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Rx
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return axisValues[SpaceNavAxis.Rx];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Ry
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return axisValues[SpaceNavAxis.Ry];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Rz
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return axisValues[SpaceNavAxis.Rz];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return string.Format("x={0} y={1} z={2} rx={3} ry={4} rz={5}", X, Y, Z, Rx, Ry, Rz);
|
return string.Format("x={0} y={1} z={2} rx={3} ry={4} rz={5}", X, Y, Z, Rx, Ry, Rz);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user