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

};

}

相关推荐
Macbethad3 小时前
工业设备数据记录程序技术方案
wpf·信息与通信
CG_MAGIC6 小时前
用ZBrush和Blender制作波洛3D肖像
3d·blender·效果图渲染·zbrush·渲云渲染
qq_205279058 小时前
Unity log工具 Unity Logviewer插件
unity·游戏引擎
IMPYLH9 小时前
Lua 的 tonumber 函数
开发语言·笔记·后端·junit·游戏引擎·lua
Renderbus瑞云渲染农场10 小时前
Maya相关插件有哪些?Maya云渲染插件哪些好用?
3d·云计算·3dsmax·maya
tealcwu10 小时前
【Unity实战】如何使用VS Code在真实iOS设备上调试 Unity应用
unity·游戏引擎·iphone
YANshangqian10 小时前
Agisoft Metashape Pro(3D摄影建模软件)
3d
top_designer11 小时前
PS 样式参考:3D 白模直接出原画?概念美术的“光影魔术手”
游戏·3d·prompt·aigc·技术美术·建模·游戏美术
多恩Stone15 小时前
【3DV 进阶-10】Trellis 中的表示 SLat 理解(1)
人工智能·python·算法·3d·aigc
Echo_NGC223716 小时前
【AirSim 教程指南】Part 3:相机与传感器(RGB / 深度 / 分割 / LiDAR)
人工智能·计算机视觉·游戏引擎·ar·无人机·图形渲染·着色器