From fe5517e319799caca1c0d0c519ab98c6ea1b0aa7 Mon Sep 17 00:00:00 2001 From: CorentinPtrl Date: Wed, 16 Mar 2022 17:10:58 +0100 Subject: [PATCH] Added Rotation to Actor and changed organization --- SoTCoreExternal/Data/Quaternion.cs | 20 ++++++++++++++++++++ SoTCoreExternal/{ => Data}/Vector3.cs | 4 ++-- SoTCoreExternal/SoTCoreExternal.csproj | 11 +++++++---- SoTCoreExternal/SotCore.cs | 1 + SoTCoreExternal/SotStuff.cs | 12 ++++++++++++ SoTCoreExternal/{ => UE4}/UE4Actor.cs | 18 ++++++++++++------ SoTCoreExternal/{ => UE4}/UE4Engine.cs | 2 +- SoTCoreExternal/{ => UE4}/UEObject.cs | 2 +- SotCoreTest/Program.cs | 2 ++ 9 files changed, 58 insertions(+), 14 deletions(-) create mode 100644 SoTCoreExternal/Data/Quaternion.cs rename SoTCoreExternal/{ => Data}/Vector3.cs (76%) create mode 100644 SoTCoreExternal/SotStuff.cs rename SoTCoreExternal/{ => UE4}/UE4Actor.cs (88%) rename SoTCoreExternal/{ => UE4}/UE4Engine.cs (99%) rename SoTCoreExternal/{ => UE4}/UEObject.cs (99%) diff --git a/SoTCoreExternal/Data/Quaternion.cs b/SoTCoreExternal/Data/Quaternion.cs new file mode 100644 index 0000000..73eb7c2 --- /dev/null +++ b/SoTCoreExternal/Data/Quaternion.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SoT.Data +{ + public struct Quaternion + { + public float X; + public float Y; + public float Z; + public float W; + public override string ToString() + { + return String.Format("(X : {0} Y: {1} Z: {2} W: {3} )", X,Y,Z,W); + } + } +} diff --git a/SoTCoreExternal/Vector3.cs b/SoTCoreExternal/Data/Vector3.cs similarity index 76% rename from SoTCoreExternal/Vector3.cs rename to SoTCoreExternal/Data/Vector3.cs index be716aa..b0b70fc 100644 --- a/SoTCoreExternal/Vector3.cs +++ b/SoTCoreExternal/Data/Vector3.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace SoT +namespace SoT.Data { public struct Vector3 { @@ -13,7 +13,7 @@ public struct Vector3 public float Z; public override string ToString() { - return "(X : " + X + " Y: " + Y + " Z: " + Z + ")"; + return String.Format("(X : {0} Y: {1} Z: {2})", X, Y, Z); } } } diff --git a/SoTCoreExternal/SoTCoreExternal.csproj b/SoTCoreExternal/SoTCoreExternal.csproj index 52b1ef5..666ee5c 100644 --- a/SoTCoreExternal/SoTCoreExternal.csproj +++ b/SoTCoreExternal/SoTCoreExternal.csproj @@ -83,14 +83,17 @@ + - - - + + + + - + + \ No newline at end of file diff --git a/SoTCoreExternal/SotCore.cs b/SoTCoreExternal/SotCore.cs index b9253b4..dbe1160 100644 --- a/SoTCoreExternal/SotCore.cs +++ b/SoTCoreExternal/SotCore.cs @@ -1,5 +1,6 @@ using SoT.Util; using System; +using SoT.UE4; namespace SoT { diff --git a/SoTCoreExternal/SotStuff.cs b/SoTCoreExternal/SotStuff.cs new file mode 100644 index 0000000..c5f2e50 --- /dev/null +++ b/SoTCoreExternal/SotStuff.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SoTCoreExternal +{ + public class SotStuff + { + } +} diff --git a/SoTCoreExternal/UE4Actor.cs b/SoTCoreExternal/UE4/UE4Actor.cs similarity index 88% rename from SoTCoreExternal/UE4Actor.cs rename to SoTCoreExternal/UE4/UE4Actor.cs index a46dd17..fbf45dd 100644 --- a/SoTCoreExternal/UE4Actor.cs +++ b/SoTCoreExternal/UE4/UE4Actor.cs @@ -1,18 +1,16 @@ -using System; +using SoT.Data; +using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; -namespace SoT +namespace SoT.UE4 { public struct FTransform { - public float x; - public float y; - public float z; - public float w; + public Quaternion Rotation; public Vector3 Translation; public Vector3 Scale3D; }; @@ -84,6 +82,14 @@ public Vector3 Position } } + public Quaternion Rotation + { + get + { + return actor.GetRootComponent().transform.Rotation; + } + } + public UE4Actor(ulong address) : base(address) { } diff --git a/SoTCoreExternal/UE4Engine.cs b/SoTCoreExternal/UE4/UE4Engine.cs similarity index 99% rename from SoTCoreExternal/UE4Engine.cs rename to SoTCoreExternal/UE4/UE4Engine.cs index aed62ed..506a649 100644 --- a/SoTCoreExternal/UE4Engine.cs +++ b/SoTCoreExternal/UE4/UE4Engine.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace SoT +namespace SoT.UE4 { public class UE4Engine { diff --git a/SoTCoreExternal/UEObject.cs b/SoTCoreExternal/UE4/UEObject.cs similarity index 99% rename from SoTCoreExternal/UEObject.cs rename to SoTCoreExternal/UE4/UEObject.cs index 3466c9c..e3b97ed 100644 --- a/SoTCoreExternal/UEObject.cs +++ b/SoTCoreExternal/UE4/UEObject.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace SoT +namespace SoT.UE4 { public class UEObject { diff --git a/SotCoreTest/Program.cs b/SotCoreTest/Program.cs index 89b9796..af9332a 100644 --- a/SotCoreTest/Program.cs +++ b/SotCoreTest/Program.cs @@ -1,6 +1,8 @@ using System; using System.Threading; using SoT; +using SoT.UE4; + namespace SotEspCoreTest { class Program