SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
Generic.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include <sourcepp/Macros.h>
6#include <sourcepp/Math.h>
7
8namespace mdlpp {
9
10constexpr int ROOT_LOD = 0;
11constexpr int MAX_LOD_COUNT = 8;
12constexpr int MAX_BONES_PER_VERTEX = 3;
13
14struct BBox {
15 int32_t bone;
16 int32_t group;
17 sourcepp::math::Vec3f bboxMin;
18 sourcepp::math::Vec3f bboxMax;
19
20 //int32_t hitboxNameOffset;
21 std::string name;
22
23 //int32_t _unused0[8];
24};
25
26struct Movement {
27 enum Flags : int32_t {
29 FLAG_X = 1 << 0,
30 FLAG_Y = 1 << 1,
31 FLAG_Z = 1 << 2,
32 FLAG_XR = 1 << 3,
33 FLAG_YR = 1 << 4,
34 FLAG_ZR = 1 << 5,
35 FLAG_LX = 1 << 6,
36 FLAG_LY = 1 << 7,
37 FLAG_LZ = 1 << 8,
38 FLAG_LXR = 1 << 9,
39 FLAG_LYR = 1 << 10,
40 FLAG_LZR = 1 << 11,
41 FLAG_LINEAR = 1 << 12,
42 FLAG_MASK_TYPES = (1 << 18) - 1,
43 FLAG_RLOOP = 1 << 18,
44 };
45
46 int32_t endFrame;
50 float yawEnd;
51 sourcepp::math::Vec3f movement;
52 sourcepp::math::Vec3f relativePosition;
53};
55
56struct IKLock {
57 int32_t chain;
58 float posWeight;
60 int32_t flags;
61
62 //int32_t unused[4];
63};
64
65union AnimValue {
66 struct {
67 uint8_t valid;
68 uint8_t total;
69 } num;
70 int16_t value;
71};
72static_assert(sizeof(AnimValue) == 2);
73
74// x/y/z or pitch/yaw/roll
75using AnimValuePtr = sourcepp::math::Vec3i16;
76
77} // namespace mdlpp
#define SOURCEPP_BITFLAGS_ENUM(Enum)
Defines bitwise operators for an enum or enum class.
Definition Macros.h:29
Definition mdlpp.h:9
constexpr int ROOT_LOD
Definition Generic.h:10
sourcepp::math::Vec3i16 AnimValuePtr
Definition Generic.h:75
constexpr int MAX_LOD_COUNT
Definition Generic.h:11
constexpr int MAX_BONES_PER_VERTEX
Definition Generic.h:12
sourcepp::math::Vec3f bboxMin
Definition Generic.h:17
int32_t group
Definition Generic.h:16
sourcepp::math::Vec3f bboxMax
Definition Generic.h:18
std::string name
Definition Generic.h:21
int32_t bone
Definition Generic.h:15
int32_t flags
Definition Generic.h:60
float posWeight
Definition Generic.h:58
int32_t chain
Definition Generic.h:57
float localQWeight
Definition Generic.h:59
float velocityStart
Definition Generic.h:48
int32_t endFrame
Definition Generic.h:46
sourcepp::math::Vec3f relativePosition
Definition Generic.h:52
sourcepp::math::Vec3f movement
Definition Generic.h:51
float velocityEnd
Definition Generic.h:49
int16_t value
Definition Generic.h:70
uint8_t valid
Definition Generic.h:67
uint8_t total
Definition Generic.h:68
struct mdlpp::AnimValue::@260325364302223141001101027371236243335257207016 num