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;

相关推荐
mxwin1 天前
Unity Shader 光线追踪原理与实战案例
unity·游戏引擎
xcLeigh3 天前
Unity基础:Instantiate实例化——在运行时动态创建游戏物体
游戏·unity·游戏引擎·教程·instantiate
辻弋2018 天前
五年前的旅行视频糊成马赛克?Video2X用Real-ESRGAN逐帧重建细节,但只支持Windows、集显用户建议直接放弃
服务器·数据库·windows·游戏引擎·电脑
淡海水12 天前
02-02-原理篇-分代GC
算法·unity·c#·游戏引擎·.net·gc
淡海水13 天前
02-03-原理篇-大对象堆
unity·c#·游戏引擎·.net·gc
郝学胜-神的一滴14 天前
C++ Templates 01:拨开迷雾,读懂C++模板经典著作
开发语言·c++·程序人生·游戏·游戏引擎·软件构建
淡海水14 天前
02-01-原理篇-Mark-Sweep与变种算法
算法·unity·c#·游戏引擎·.net·gc
babywang015 天前
Unity笔记--AssetBundle详解
unity·游戏引擎
魔士于安15 天前
经典Game
游戏·游戏引擎·贴图·技术美术·模型
淡海水15 天前
01-04-认知篇-Unity内存全景
unity·c#·游戏引擎·.net·gc