ApophisZerg的vulkan游戏引擎的实现

1.math/math_types.h

#pragma once

#include "defines.h"

typedef struct vec2_u{

f32 elements[2];

struct{

union{

//The first element.

f32 x,r,s,u;

};

union{

f32 y,g,t,v;

};

};

}vec2;

typedef struct vec3_u{

union{

f32 elements[3];

struct{

union{

//The first element.

f32 x,r,s,u;

};

union{

f32 y,g,t,v;

};

union{

f32 z,b,p,w;

};

};

};

}vec3;

typedef struct vec4_u{

/* #if defined(KUSE_SIMD)

alignas(16) _m128 data;

#endif

alignas(16) f32 elements[4];

*/

union{

f32 elements[3];

struct{

union{

//The first element.

f32 x,r,s;

};

union{

f32 y,g,t;

};

union{

f32 z,b,p;

};

union{

f32 w,a,q;

};

};

};

}vec4;

typedef vec4 quat;

typedef union mat4_u{

f32 data[16];

}mat4;

typedef struct vertex_3d{

vec3 position;

}vertex_3d;

相关推荐
星依网络16 小时前
使用LabelImg工具标注数据(游戏辅助脚本开发)
python·游戏引擎·图形渲染·骨骼绑定
AT~17 小时前
unity 使用Socket和protobuf实现网络连接
unity·游戏引擎
feiduoge21 小时前
教程 36 - 方向光照
windows·游戏引擎·图形渲染
呼呼突突1 天前
Unity使用TouchSocket的RPC
unity·rpc·游戏引擎
qq_428639611 天前
虚幻基础:安装插件
游戏引擎·虚幻
AA陈超2 天前
虚幻引擎5 GAS开发俯视角RPG游戏 P07-18.生成火球术
c++·游戏·ue5·游戏引擎·虚幻
Doc.S2 天前
多无人机任务自定义(基于ZJU-FAST-Lab / EGO-Planner-v2)
游戏引擎·无人机·cocos2d
nnsix2 天前
Unity OpenXR开发HTC Vive Cosmos
unity·游戏引擎
nnsix2 天前
Unity OpenXR,扳机键交互UI时,必须按下扳机才触发
unity·游戏引擎
老朱佩琪!2 天前
Unity访问者模式
unity·游戏引擎·访问者模式