This commit is contained in:
Pascal Serrarens 2025-04-17 09:33:17 +02:00
parent db36669afb
commit 67cf8b31fb
6 changed files with 5 additions and 14 deletions

View File

@ -6,10 +6,6 @@ using Vector3Float = UnityEngine.Vector3;
namespace LinearAlgebra namespace LinearAlgebra
{ {
public class Direction
{
namespace LinearAlgebra {
/// <summary> /// <summary>
/// A direction in 3D space /// A direction in 3D space
/// </summary> /// </summary>

View File

@ -84,8 +84,6 @@ namespace LinearAlgebra {
for (int ix = 0; ix < n; ix++) for (int ix = 0; ix < n; ix++)
this.data[ix, ix] = v.data[ix]; this.data[ix, ix] = v.data[ix];
} }
public void FillDiagonal(float f) {
uint n = Math.Min(this.nRows, this.nCols);
public void FillDiagonal(float f) public void FillDiagonal(float f)
{ {
int n = Math.Min(this.nRows, this.nCols); int n = Math.Min(this.nRows, this.nCols);

View File

@ -18,12 +18,11 @@ namespace LinearAlgebra {
this.w = w; this.w = w;
} }
#if UNITY_5_3_OR_NEWER
public static Quaternion Reflect(Quaternion q) { public static Quaternion Reflect(Quaternion q) {
return new(-q.x, -q.y, -q.z, q.w); return new(-q.x, -q.y, -q.z, q.w);
} }
#if UNITY_5_3_OR_NEWER
public static Matrix2 ToRotationMatrix(Quaternion q) { public static Matrix2 ToRotationMatrix(Quaternion q) {
float w = q.x, x = q.y, y = q.z, z = q.w; float w = q.x, x = q.y, y = q.z, z = q.w;

View File

@ -3,8 +3,6 @@ using System.Numerics;
using Quaternion = UnityEngine.Quaternion; using Quaternion = UnityEngine.Quaternion;
#endif #endif
namespace LinearAlgebra
{
namespace LinearAlgebra { namespace LinearAlgebra {
public class SwingTwist { public class SwingTwist {

View File

@ -13,7 +13,7 @@ namespace RoboidControl {
float distance = ReceiveFloat16(data, ref ix); float distance = ReceiveFloat16(data, ref ix);
float horizontal = ReceiveAngle8(data, ref ix); float horizontal = ReceiveAngle8(data, ref ix);
float vertical = ReceiveAngle8(data, ref ix); float vertical = ReceiveAngle8(data, ref ix);
Spherical v = new Spherical(distance, horizontal, vertical); Spherical v = Spherical.Degrees(distance, horizontal, vertical);
return v; return v;
} }

View File

@ -13,7 +13,7 @@ namespace RoboidControl.test {
[Test] [Test]
public void Test_Participant() { public void Test_Participant() {
LocalParticipant participant = new LocalParticipant("127.0.0.1", 7682); ParticipantUDP participant = new ParticipantUDP("127.0.0.1", 7682);
ulong milliseconds = (ulong)DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); ulong milliseconds = (ulong)DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
ulong startTime = milliseconds; ulong startTime = milliseconds;
@ -46,7 +46,7 @@ namespace RoboidControl.test {
[Test] [Test]
public void Test_SiteParticipant() { public void Test_SiteParticipant() {
SiteServer siteServer = new SiteServer(7681); SiteServer siteServer = new SiteServer(7681);
LocalParticipant participant = new LocalParticipant("127.0.0.1", 7681); ParticipantUDP participant = new ParticipantUDP("127.0.0.1", 7681);
ulong milliseconds = (ulong)DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); ulong milliseconds = (ulong)DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
ulong startTime = milliseconds; ulong startTime = milliseconds;
@ -64,7 +64,7 @@ namespace RoboidControl.test {
[Test] [Test]
public void Test_ThingMsg() { public void Test_ThingMsg() {
SiteServer siteServer = new SiteServer(7681); SiteServer siteServer = new SiteServer(7681);
LocalParticipant participant = new LocalParticipant("127.0.0.1"); ParticipantUDP participant = new ParticipantUDP("127.0.0.1");
Thing thing = new Thing(participant) { Thing thing = new Thing(participant) {
name = "First Thing", name = "First Thing",
modelUrl = "https://passer.life/extras/ant.jpg" modelUrl = "https://passer.life/extras/ant.jpg"