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;

相关推荐
weixin_424294677 小时前
在Unity中,摄像机移动时出现“残影”或“闪烁”是常见问题,主要原因和处理方法。
unity·游戏引擎
孟无岐7 小时前
【Laya】Browser 使用说明
typescript·游戏引擎·游戏程序·laya
天人合一peng8 小时前
unity 3d 通过游戏对象的名子查到其对象
游戏·unity·游戏引擎
__water13 小时前
RHK《Unity接入DeepSeek问答》
unity·游戏引擎·智能问答·deepseek接入·deepseekapikey
在路上看风景14 小时前
1.4 Unity运行时路径
unity·游戏引擎
郝学胜-神的一滴15 小时前
Qt OpenGL 生成Mipmap技术详解
开发语言·c++·qt·系统架构·游戏引擎·图形渲染·unreal engine
孟无岐1 天前
【Laya】Laya 类使用说明
typescript·游戏引擎·游戏程序·laya
在路上看风景2 天前
1.2 Unity资源分类
unity·游戏引擎
one named slash2 天前
BMFont在Unity中生成艺术字
unity·游戏引擎
郝学胜-神的一滴2 天前
图形学中的纹理映射问题:摩尔纹与毛刺的深度解析
c++·程序人生·unity·游戏引擎·图形渲染·unreal engine