3d wpf游戏引擎的导入文件功能c++的.h实现

1.FbxImporter.h

#pragma once

#include "ToolsCommon.h"

#include <fbxsdk.h>

namespace primal::tools

{

struct scene_data;

struct scene;

struct mesh;

struct geometry_import_settings;

class fbx_context

{

public:

fbx_context(const char* file, scene* scene,scene_data* data)

: _scene{ scene }, _scene_data{data}

{

assert(file && _scene && _scene_data);

if (initialize_fbx())

{

load_fbx_file(file);

}

}

~fbx_context()

{

_fbx_scene->Destroy();

_fbx_manager->Destroy();

ZeroMemory(this, sizeof(fbx_context));

}

void get_scene(FbxNode* root = nullptr);

constexpr bool is_valid() const { return _fbx_manager && _fbx_scene; }

constexpr f32 scene_scale() const { return _scene_scale; }

private:

bool initialize_fbx();

void load_fbx_file(const char* file);

void get_meshes(FbxNode* node, utl::vector<mesh>& meshes, u32 lod_id, f32 lod_threshold);

void get_mesh(FbxNodeAttribute* attribute, utl::vector<mesh>& meshes, u32 lod_id,f32 lod_threshold);

void get_lod_group(FbxNodeAttribute* attribute);

bool get_mesh_data(FbxMesh* fbx_mesh, mesh& m);

scene* _scene{ nullptr };

scene_data* _scene_data{ nullptr };

FbxManager* _fbx_manager{ nullptr };

FbxScene* _fbx_scene{ nullptr };

f32 _scene_scale{ 1.0f };

};

}

相关推荐
文阿花27 分钟前
Echarts实现自定旋转3D饼状图
javascript·3d·echarts·饼状图
code_pgf2 小时前
3D点云目标检测(PointPillars)部署pipeline
人工智能·目标检测·3d
mxwin3 小时前
Unity Shader URP:法线如何进行光照计算
unity·游戏引擎·shader
爱凤的小光3 小时前
Cog3DRangeImagePlaneEstimatorTool完全指南
3d·visionpro
小二·3 小时前
微服务架构设计与实践
微服务·架构·wpf
文阿花3 小时前
Echarts实现柱状3D扇形图
android·3d·echarts
Zldaisy3d4 小时前
中南&南洋理工 l 3D打印含Al高熵合金高周疲劳机制与晶格摩擦工程研究
3d
暖馒4 小时前
WPF-Prism学习入门步骤记录
学习·wpf
CG_MAGIC5 小时前
Substance Painter:图层蒙版与智能材质
3d·材质·贴图·substance painter·效果图·建模教程·渲云渲染
小短腿的代码世界5 小时前
Qt Quick 3D场景导入与渲染架构深度解析:从USD到PBR材质的完整管线
qt·3d·架构