diff --git a/src/object/CMakeLists.txt b/src/object/CMakeLists.txt index 7da1fdd..a77c62e 100644 --- a/src/object/CMakeLists.txt +++ b/src/object/CMakeLists.txt @@ -1,6 +1,7 @@ file(GLOB PRIVATE_SOURCES "*.cpp" "client/*.cpp" + "movement/*.cpp" ) add_library(object STATIC diff --git a/src/object/movement/CMoveSpline.cpp b/src/object/movement/CMoveSpline.cpp new file mode 100644 index 0000000..71d3f4e --- /dev/null +++ b/src/object/movement/CMoveSpline.cpp @@ -0,0 +1,32 @@ +#include "object/movement/CMoveSpline.hpp" +#include "util/DataStore.hpp" +#include + +CDataStore& operator>>(CDataStore& msg, CMoveSpline& spline) { + msg.Get(spline.flags); + + if (spline.flags & 0x20000) { + msg.Get(spline.face.facing); + } else if (spline.flags & 0x10000) { + msg.Get(spline.face.guid); + } else { + msg >> spline.face.spot; + } + + uint32_t val; + msg.Get(val); + spline.start = OsGetAsyncTimeMsPrecise() - val; + + msg.Get(spline.uint2C); + msg.Get(spline.uint30); + msg.Get(spline.float204); + msg.Get(spline.float208); + msg.Get(spline.float20C); + msg.Get(spline.uint210); + + msg >> spline.spline; + + msg >> spline.vector1F8; + + return msg; +} diff --git a/src/object/movement/CMoveSpline.hpp b/src/object/movement/CMoveSpline.hpp new file mode 100644 index 0000000..0f8ff90 --- /dev/null +++ b/src/object/movement/CMoveSpline.hpp @@ -0,0 +1,32 @@ +#ifndef OBJECT_MOVEMENT_C_MOVE_SPLINE_HPP +#define OBJECT_MOVEMENT_C_MOVE_SPLINE_HPP + +#include "util/C3Spline.hpp" +#include "util/GUID.hpp" +#include +#include + +struct CMoveSpline { + // TODO + union { + C3Vector spot = {}; + WOWGUID guid; + float facing; + } face; + uint32_t flags; + uint32_t start; + // TODO + uint32_t uint2C; + uint32_t uint30; + C3Spline_CatmullRom spline; + C3Vector vector1F8; + float float204; + float float208; + float float20C; + uint32_t uint210; + // TODO +}; + +CDataStore& operator>>(CDataStore& msg, CMoveSpline& spline); + +#endif