This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/src/services/vehicle/model_attachment.hpp
maybegreat48 9ccb77e8eb
Add more spoofing options and added clang-format (#1020)
* feat(Spoofing): add spoofing
* feat(Spoofing): prepare code for player attach
* remove(PlayerAttach): isn't going to work due to netsync architecture
* fix(GUI): fix scaling
* feat(Project): add clang-format file
* feat(Classes): update classes
* fix(BlackHole): remove unnecessary cleanup
* fix(Formatting): fix formatting for initializer lists
* feat(clang-format): Set tab width and 1 space before comment

Co-authored-by: Yimura <24669514+Yimura@users.noreply.github.com>
2023-03-01 21:27:15 +00:00

50 lines
1.5 KiB
C++

#pragma once
#include "json_util.hpp"
#include "natives.hpp"
namespace big
{
struct model_attachment
{
Hash model_hash;
Vector3 position;
Vector3 rotation;
bool has_collision;
bool is_visible;
bool is_invincible;
};
static void to_json(nlohmann::json& j, const model_attachment& attachment)
{
j = nlohmann::json{{"model_hash", attachment.model_hash},
{"position_x", attachment.position.x},
{"position_y", attachment.position.y},
{"position_z", attachment.position.z},
{"rotation_x", attachment.rotation.x},
{"rotation_y", attachment.rotation.y},
{"rotation_z", attachment.rotation.z},
{"has_collision", attachment.has_collision},
{"is_visible", attachment.is_visible},
{"is_invincible", attachment.is_invincible}
};
};
static void from_json(const nlohmann::json& j, model_attachment& attachment)
{
set_from_key_or_default(j, "model_hash", attachment.model_hash);
set_from_key_or_default(j, "position_x", attachment.position.x);
set_from_key_or_default(j, "position_y", attachment.position.y);
set_from_key_or_default(j, "position_z", attachment.position.z);
set_from_key_or_default(j, "rotation_x", attachment.rotation.x);
set_from_key_or_default(j, "rotation_y", attachment.rotation.y);
set_from_key_or_default(j, "rotation_z", attachment.rotation.z);
set_from_key_or_default(j, "has_collision", attachment.has_collision);
set_from_key_or_default(j, "is_visible", attachment.is_visible, true);
set_from_key_or_default(j, "is_invincible", attachment.is_invincible);
}
};