BRF文件数据结构

news/2024/5/18 14:27:20 标签: 数据结构, c++, 游戏程序

一.BRF-文件头数据结构

type_mesh = "mesh" 网格
type_material = "material" 材质

struct brf_header{
   int type_length; //4个字节, type字符串对应长度
   char* type_name; //根据type_length获取
   int type_content_num; //4个字节,对应类型所含个数,例如含有模型6个
}

例如一个包含2个模型的BRF文件,对应的BRF文件头应该是:

二.BRF-mesh数据结构

int 对应4个字节
float 对应4个字节

struct mesh{
   int name_length;//模型名长度
   char* name;//模型名
   const int material_flag = 0;//标志位
   int material_cnt;//材质名长度
   int material_name_length;//材质名长度
   char* material_name;//材质名

   int vertex_num;//顶点数量(Normal格式顶点) x, y, z三个坐标float类型数值
   vertex_normal[];
   
   int vertex_fvf_num;//顶点数量(FVF格式顶点)顶点数量
   vertex_fvf[];
   
   int triangle_num;//三角面数量
   triangle[];
}

struct vertex_normal{
   float x;
   float y;
   float z;
};

struct vertex_fvf{
   int vertex_fvf_index;
   const int vertex_uv_flag = -1;//标志位
   float x;
   float y;
   float z;
   float u;
   float v;
   float vnx;
   float vny;
   float vnz;
};

struct triangle{
   int v1_index;
   int v2_index;
   int v3_index;
}


http://www.niftyadmin.cn/n/5302209.html

相关文章

CentOS服务器之间免密登录和传输文件

使用过 Jenkins 的同学都知道,Jenkins 会在远程服务器上执行一些命令,如:cd /home/wwwroot/ && git pull,这时候就需要在 Jenkins 服务器上配置免密登录,以及在远程服务器上配置免密登录,这样才能实…

ElecardStreamEye使用教程(视频质量分析工具、视频分析)

文章目录 Elecard StreamEye 使用教程安装与设置下载安装 界面导航主菜单视频窗口分析窗口 文件操作打开视频文件 视频流分析帧类型识别码率分析分析报告 高级功能视觉表示比较模式自动化脚本 下载地址1:https://www.onlinedown.net/soft/58792.htm 下载地址2&…

解决Gitlab Prometheus导致的磁盘空间不足问题

解决Gitlab Prometheus导致的磁盘空间不足问题 用docker搭建了一个gitlab服务,已经建立了多个项目上传,但是突然有一天就503了。 df -TH查看系统盘,发现已经Used 100%爆满了。。。 💡Tips:/dev/vda1目录是系统盘目录。…

pdf格式转换为txt格式

pdf文档转换为txt文档 首先在python3虚拟环境中安装PyPDF2 Python 3.6.8 (default, Jun 20 2023, 11:53:23) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux Type "help", "copyright", "credits" or "license" for more infor…

UE4.27.2 网页串流

1、和Unity串流一样安装Node.js 下载地址https://nodejs.org/ 2、下载安装Epic Games启动程序https://www.unrealengine.com/zh-CN/download 3、安装UE4.7.2 4、这里就不安装像素流送演示,选个别的然后创建工程 5、启用PixelStreaming插件 6、设置额外启动参数&am…

理解UML中的依赖关系

理解UML中的依赖关系 在面向对象的设计中,理解各种类之间的关系对于构建一个清晰、可维护的系统至关重要。UML(统一建模语言)为我们提供了一种可视化这些关系的方式。今天,我们将深入探讨UML中的依赖关系(Dependency&a…

office学习记录

目录 Excelwordvisioonedriveproject学习资料git仓库百度云分享 视频教程官网资料 Excel word visio onedrive project 学习资料 git仓库 office学习笔记: https://gitee.com/fedorayang/office.git 百度云分享 安装程序: office2019 project2019 visio2019 书籍: Ac…

基于多反应堆的高并发服务器【C/C++/Reactor】(中)线程池的启动和从线程池中取出一个反应堆实例

一、线程池的启动 // 启动线程池 void threadPoolRun(struct ThreadPool* pool) {assert(pool && !pool->isStart);if(pool->mainLoop->threadID ! pthread_self()) {exit(0);}pool->isStart true;if(pool->threadNum) {for(int i0;i<pool->th…