mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-07-04 02:01:51 +00:00
Dump IW4 xmodels as obj
This commit is contained in:
@ -0,0 +1,25 @@
|
||||
#include "CommonIW4.h"
|
||||
|
||||
#include "Utils/Pack.h"
|
||||
|
||||
using namespace IW4;
|
||||
|
||||
PackedTexCoords Common::Vec2PackTexCoords(const vec2_t* in)
|
||||
{
|
||||
return PackedTexCoords{Pack32::Vec2PackTexCoords(reinterpret_cast<const float*>(in))};
|
||||
}
|
||||
|
||||
PackedUnitVec Common::Vec3PackUnitVec(const vec3_t* in)
|
||||
{
|
||||
return PackedUnitVec{Pack32::Vec3PackUnitVec(reinterpret_cast<const float*>(in))};
|
||||
}
|
||||
|
||||
void Common::Vec2UnpackTexCoords(const PackedTexCoords& in, vec2_t* out)
|
||||
{
|
||||
Pack32::Vec2UnpackTexCoords(in.packed, reinterpret_cast<float*>(out));
|
||||
}
|
||||
|
||||
void Common::Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out)
|
||||
{
|
||||
Pack32::Vec3UnpackUnitVec(in.packed, reinterpret_cast<float*>(out));
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "IW4.h"
|
||||
|
||||
namespace IW4
|
||||
{
|
||||
inline const char* szWeapTypeNames[]
|
||||
@ -192,4 +194,13 @@ namespace IW4
|
||||
"rear",
|
||||
"all",
|
||||
};
|
||||
}
|
||||
|
||||
class Common
|
||||
{
|
||||
public:
|
||||
static PackedTexCoords Vec2PackTexCoords(const vec2_t* in);
|
||||
static PackedUnitVec Vec3PackUnitVec(const vec3_t* in);
|
||||
static void Vec2UnpackTexCoords(const PackedTexCoords& in, vec2_t* out);
|
||||
static void Vec3UnpackUnitVec(const PackedUnitVec& in, vec3_t* out);
|
||||
};
|
||||
}
|
||||
|
@ -650,9 +650,9 @@ namespace IW4
|
||||
{
|
||||
MaterialInfo info;
|
||||
char stateBitsEntry[48];
|
||||
char textureCount;
|
||||
char constantCount;
|
||||
char stateBitsCount;
|
||||
unsigned char textureCount;
|
||||
unsigned char constantCount;
|
||||
unsigned char stateBitsCount;
|
||||
char stateFlags;
|
||||
char cameraRegion;
|
||||
MaterialTechniqueSet* techniqueSet;
|
||||
|
Reference in New Issue
Block a user