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;

相关推荐
南無忘码至尊40 分钟前
Unity学习90天-第2天-认识Unity生命周期函数并用 Update 控制物体移动,FixedUpdate 控制物理
学习·unity·游戏引擎
小林up4 小时前
【Unity URP源码阅读1】ColorGradingLUT
unity·游戏引擎
风酥糖7 小时前
Godot游戏练习01-第27节-升级选项选择生效
游戏·游戏引擎·godot
星夜泊客9 小时前
unity 海底海洋资源OceanEnviromentPackUrp材质丢失修正
unity·游戏引擎·材质
weixin_4242946710 小时前
Unity 的Button Animator
unity·游戏引擎
UQ_rookie10 小时前
【Unity3D】在URP渲染管线下使用liltoon插件出现粉色无法渲染情况的解决方案
unity·游戏引擎·shader·urp·着色器·vrchat·liltoon
南無忘码至尊1 天前
Unity学习90天-第1天-认识Transform + 坐标系
学习·unity·游戏引擎
南無忘码至尊1 天前
Unity学习90天-第1天-认识Unity并书写我们的第一个脚本
学习·unity·游戏引擎
风酥糖1 天前
Godot游戏练习01-第26节-轮次结束后弹出升级选项
游戏·游戏引擎·godot
雪域迷影1 天前
Hazel游戏引擎结构分析
c++·游戏引擎·hazel