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;

相关推荐
benben0442 小时前
Unity3D仿星露谷物语开发54之退出菜单及创建可执行文件
游戏·ui·unity·游戏引擎
Magnum Lehar5 小时前
vulkan游戏引擎vulkan部分的fence实现
java·前端·游戏引擎
朗迹 - 张伟5 小时前
Unity数字人开发笔记
笔记·unity·游戏引擎
Luna-player6 小时前
在 Unity 中,Start 方法直接设置 RectTransform 的位置,时出现问题,与预计位置不匹配。
经验分享·unity·游戏引擎
qq_23857086236 小时前
Unity性能优化
unity·游戏引擎
Magnum Lehar19 小时前
vulkan游戏引擎的pipeline管道实现
java·开发语言·游戏引擎
Magnum Lehar19 小时前
vulkan游戏引擎的vulkan/shaders下的image实现
java·前端·游戏引擎
熵减画眉19 小时前
科技趋势分析系统(BBC)技术全解
人工智能·python·科技·机器学习·unity·自然语言处理·游戏引擎
虾球xz21 小时前
游戏引擎学习第314天:将精灵拆分成多个层
linux·c++·学习·游戏引擎
Magnum Lehar21 小时前
vulkan游戏引擎vulkan部分的frame_buffer实现
java·前端·游戏引擎