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

};

}

相关推荐
mxwin9 小时前
Unity Shader FLOWMAP岩浆流动制作案例
unity·游戏引擎·shader·uv
小贺儿开发9 小时前
【Arduino与Unity交互探究】01 摇杆模块
科技·unity·游戏引擎·arduino·串口通信·摇杆·硬件交互
Yasin Chen11 小时前
Unity TMP_SDF 分析(三)顶点着色器1
unity·游戏引擎·着色器
mxwin12 小时前
Unity Shader 使用 Noise 图 制作Shader 溶解效果
unity·游戏引擎
mxwin14 小时前
Unity Shader 用 Ramp 贴图实现薄膜干涉效果
unity·游戏引擎·贴图·shader·uv
魔士于安14 小时前
Unity星球资源,八大星球,带fps显示
游戏·unity·游戏引擎·贴图·模型
css在哪里15 小时前
小程序版 Three.js 入门 Demo(完整可运行)
3d·小程序·threejs
鹿野素材屋18 小时前
Unity动画幅度太大怎么办
unity·游戏引擎
He BianGu18 小时前
【笔记】在WPF中GiveFeedbackEventHandler的功能和应用场景详细介绍
笔记·wpf
就是有点傻18 小时前
WPF自定义控件-水晶球
wpf