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;

相关推荐
XR技术研习社4 小时前
“情况说明“以后,Unity XR 开发者如何选择?
unity·游戏引擎·xr
虾球xz6 小时前
游戏引擎学习第257天:处理一些 Win32 相关的问题
c++·学习·游戏引擎
夜猫逐梦7 小时前
【Unity】 组件库分类详解
unity·游戏引擎
虾球xz7 小时前
游戏引擎学习第255天:构建配置树
c++·学习·游戏引擎
工藤新一¹15 小时前
C++/SDL 进阶游戏开发 —— 双人塔防(代号:村庄保卫战 20)
c++·单例模式·游戏引擎·sdl·c++游戏开发
EQ-雪梨蛋花汤19 小时前
【XR空间传送】深入理解Unity中 XR Interaction Toolkit 的 MatchOrientation 用法与使用场景(空间传送、视角切换)
unity·游戏引擎·xr
工藤新一¹1 天前
C++/SDL 进阶游戏开发 —— 双人塔防(代号:村庄保卫战 19)
开发语言·c++·游戏引擎·游戏开发·sdl
北冥没有鱼啊1 天前
UE 材质 条纹循环发光
游戏·ue5·游戏引擎·ue4·材质
虾球xz1 天前
游戏引擎学习第256天:XBox 控制器卡顿和修复 GL Blit 伽玛问题
c++·学习·游戏引擎·xbox