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;

相关推荐
向宇it8 小时前
【unity游戏开发——热更新】什么是Unity热更新
游戏·unity·编辑器·游戏引擎
龚子亦17 小时前
【数字人开发】Unity+百度智能云平台实现长短文本个性化语音生成功能
百度·unity·游戏引擎
benben04418 小时前
Unity3D仿星露谷物语开发67之创建新的NPC
开发语言·游戏·ui·c#·游戏引擎
RPGMZ19 小时前
RPGMZ游戏引擎之如何设计每小时开启一次的副本
javascript·游戏·游戏引擎·rpgmz
RPGMZ19 小时前
RPGMZ游戏引擎 如何手动控制文字显示速度
开发语言·javascript·游戏引擎·rpgmz
3D霸霸1 天前
Unity渲染管线 Global Volume 及 Post-processing
unity·游戏引擎
benben0441 天前
Unity3D仿星露谷物语开发66之NPC存档
游戏·ui·unity·c#·游戏引擎
龚子亦2 天前
【数字人开发】Unity+百度智能云平台实现短语音文本识别功能
百度·unity·游戏引擎
Magnum Lehar2 天前
wpf游戏引擎主界面实现3
ui·游戏引擎·wpf
沧海归城2 天前
Unity_VR_如何用键鼠模拟VR输入_PICO项目配置
unity·游戏引擎·vr