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

};

}

相关推荐
博图光电2 小时前
Motioncam Color S + 蓝激光:3D 视觉革新,重塑工业与科研应用新格局
3d
新启航光学频率梳2 小时前
[新启航]深孔加工尺寸精度检测方法 - 激光频率梳 3D 轮廓测量
科技·3d·制造
eqwaak02 小时前
Matplotlib 动画显示进阶:交互式控制、3D 动画与未来趋势
python·tcp/ip·3d·语言模型·matplotlib
LabVIEW开发2 小时前
LabVIEW加载 STL 模型至 3D 场景 源码见附件
3d·labview·labview知识·labview功能·labview程序
作孽就得先起床2 小时前
unity pcd 二进制版 简单显示文件对象(单色)
unity·游戏引擎
陈言必行13 小时前
Unity 性能优化 之 静态资源优化 (音频 | 模型 | 纹理 | 动画)
unity·性能优化·游戏引擎
嘀咕博客13 小时前
Stable Virtual Camera:Stability AI等推出的AI模型 ,2D图像轻松转3D视频
人工智能·3d·音视频·ai工具
FuckPatience19 小时前
WPF Telerik.Windows.Controls.Data.PropertyGrid 自定义属性编辑器
wpf
Thomas_YXQ1 天前
Unity3D RectTransform.rect属性详解
unity·编辑器·游戏引擎·材质