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;

相关推荐
winlife_1 小时前
让 AI 写敌人状态机,并用脚本化场景验证状态转换正确:funplay-unity-mcp 实战
人工智能·unity·游戏引擎·ai编程·状态机·mcp
tealcwu1 小时前
【Unity实战】Unity IAP 5.3 中实现 Windows Custom Store 实战教程
windows·unity·游戏引擎
zhiSiBuYu05173 小时前
Godot 游戏引擎新手从零开发指南
游戏引擎·godot
qq_2052790516 小时前
Unity 运行时候会时不时卡顿一下,哪怕是空场景
unity·游戏引擎
美团骑手阿豪20 小时前
Unity UGUI自适应分辨率
unity·游戏引擎
winlife_21 小时前
让 AI 跑通“调跳跃手感“的完整闭环:funplay-unity-mcp 实战案例
人工智能·unity·游戏引擎·ai编程·mcp·游戏手感
万兴丶2 天前
Coplay适用于 Unity 的“Al 代理”使用指南
unity·游戏引擎·ai编程
魔士于安2 天前
Unity材质球大合集
unity·游戏引擎·材质
mxwin2 天前
Unity Shader 冰面 Shader 制作原理与流程
unity·游戏引擎·shader
玖玥拾2 天前
Cocos学习笔记:关卡系统、音频管理与物理控制
游戏引擎·cocos2d