ApophisZerg的vulkan游戏引擎的实现

1.math/math_types.h

#pragma once

#include "defines.h"

typedef struct vec2_u{

f32 elements2;

struct{

union{

//The first element.

f32 x,r,s,u;

};

union{

f32 y,g,t,v;

};

};

}vec2;

typedef struct vec3_u{

union{

f32 elements3;

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

*/

union{

f32 elements3;

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

}mat4;

typedef struct vertex_3d{

vec3 position;

}vertex_3d;

相关推荐
hai31524754312 天前
九章编程法 · 猜数字游戏 (GW-BASIC 重构版) *
人工智能·microsoft·游戏引擎·游戏程序
心前阳光12 天前
Unity资源导入之自动化资源导入
unity·自动化·游戏引擎
心前阳光13 天前
Unity之2021.3.45f2c1发布安卓程序遇到的问题
android·unity·游戏引擎
纪纯13 天前
PicoVR Unity Integration SDK 3.4 常用交互API
unity·游戏引擎·vr·pico
鼎艺创新科技13 天前
三维电子沙盘中OSGB倾斜摄影数据的加载与渲染
游戏引擎·cocos2d
kyle~13 天前
Godot开源游戏引擎
开源·游戏引擎·godot
zdr尽职尽责13 天前
Unity录像功能
学习·ui·unity·游戏引擎
真鬼12313 天前
【Unity Cursor】AI规矩
unity·游戏引擎
mxwin13 天前
Unity Shader 深入理解 LinearEyeDepth 与 DepthTexture
unity·游戏引擎
开维游戏引擎13 天前
AI自动生成游戏时,deepseek和mimo对比
android·游戏·语言模型·游戏引擎·ai编程