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 };

};

}

相关推荐
抠头专注python环境配置1 小时前
解决Windows安装PythonOCC报错:从“No module named ‘OCC’ ”到一键成功
人工智能·windows·python·3d·cad·pythonocc
xiaobaishuoAI1 小时前
分布式事务实战(Seata 版):解决分布式系统数据一致性问题(含代码教学)
大数据·人工智能·分布式·深度学习·wpf·geo
da_vinci_x3 小时前
武器设计实战:一把大剑裂变 5 种属性?Structure Ref 的“换肤”魔法
游戏·3d·设计模式·ai作画·aigc·设计师·游戏美术
yeflx3 小时前
Ubuntu下Colmap源码编译调试
ubuntu·3d
小北方城市网5 小时前
微服务注册中心与配置中心实战(Nacos 版):实现服务治理与配置统一
人工智能·后端·安全·职场和发展·wpf·restful
cjp5606 小时前
017.WPF使用自定义样式
wpf
故事不长丨8 小时前
C#log4net详解:从入门到精通,配置、实战与框架对比
c#·.net·wpf·log4net·日志·winform·日志系统
军军君018 小时前
Three.js基础功能学习十二:常量与核心
前端·javascript·学习·3d·threejs·three·三维
垂葛酒肝汤10 小时前
Unity中的协程的原理
unity·游戏引擎
cjp56011 小时前
002.为C#动态链接库添加wpf窗体
microsoft·c#·wpf