2026-04-01 12:46:48 +02:00
|
|
|
|
using Microsoft.VisualStudio.DebuggerVisualizers;
|
|
|
|
|
|
using NamedPipes;
|
2026-04-01 15:47:54 +02:00
|
|
|
|
using System;
|
2026-04-01 12:46:48 +02:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Numerics;
|
|
|
|
|
|
namespace Vector3VisualizerSource;
|
|
|
|
|
|
|
|
|
|
|
|
public class Vector3ObjectSource : VisualizerObjectSource
|
|
|
|
|
|
{
|
|
|
|
|
|
public Vector3ObjectSource()
|
|
|
|
|
|
{
|
|
|
|
|
|
Debug.WriteLine("new Vector3ObjectSource");
|
|
|
|
|
|
}
|
|
|
|
|
|
public override void GetData(object target, Stream outgoingData)
|
|
|
|
|
|
{
|
2026-04-01 15:47:54 +02:00
|
|
|
|
Debug.WriteLine("GetData: objectType is: " + target.GetType().FullName);
|
2026-04-01 12:46:48 +02:00
|
|
|
|
Vector3Model vector3Model = new();
|
|
|
|
|
|
switch (target)
|
|
|
|
|
|
{
|
|
|
|
|
|
case Vector3 vector3:
|
2026-04-01 15:47:54 +02:00
|
|
|
|
vector3Model.Vector3 = vector3;
|
2026-04-01 12:46:48 +02:00
|
|
|
|
break;
|
|
|
|
|
|
case IEnumerable<Vector3> vector3List:
|
2026-04-01 15:47:54 +02:00
|
|
|
|
vector3Model.Vector3 = vector3List.Last();
|
2026-04-01 12:46:48 +02:00
|
|
|
|
break;
|
|
|
|
|
|
case Quaternion quaternion:
|
2026-04-01 15:47:54 +02:00
|
|
|
|
vector3Model.Quaternion = quaternion;
|
2026-04-01 12:46:48 +02:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
SerializeAsJson(outgoingData, vector3Model);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|