mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-13 10:58:07 +00:00

* LXFML SPLITTING Included test file * move base to global namespace * wip need to test * update last fixes * update world sending bbb to be more efficient * Address feedback form Emo in doscord * Make LXFML class for robust and add more tests to edge cases and malformed data * get rid of the string copy and make the deep clone have a recursive limit * cleanup tests * fix test file locations * fix file path * KISS * add cmakelists * fix typos * NL @ EOF * tabs and split out to func * naming standard
30 lines
980 B
C++
30 lines
980 B
C++
// Darkflame Universe
|
|
// Copyright 2025
|
|
|
|
#ifndef LXFML_H
|
|
#define LXFML_H
|
|
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <vector>
|
|
|
|
#include "NiPoint3.h"
|
|
|
|
namespace Lxfml {
|
|
struct Result {
|
|
std::string lxfml;
|
|
NiPoint3 center;
|
|
};
|
|
|
|
// Normalizes a LXFML model to be positioned relative to its local 0, 0, 0 rather than a game worlds 0, 0, 0.
|
|
// Returns a struct of its new center and the updated LXFML containing these edits.
|
|
[[nodiscard]] Result NormalizePosition(const std::string_view data, const NiPoint3& curPosition = NiPoint3Constant::ZERO);
|
|
[[nodiscard]] std::vector<Result> Split(const std::string_view data, const NiPoint3& curPosition = NiPoint3Constant::ZERO);
|
|
|
|
// these are only for the migrations due to a bug in one of the implementations.
|
|
[[nodiscard]] Result NormalizePositionOnlyFirstPart(const std::string_view data);
|
|
[[nodiscard]] Result NormalizePositionAfterFirstPart(const std::string_view data, const NiPoint3& position);
|
|
};
|
|
|
|
#endif //!LXFML_H
|