相关疑难解决方法(0)

如何在C++中实现矢量调配?

struct vec2
{
    union
    {
        struct { float x, y; };
        struct { float r, g; };
        struct { float s, t; };
    };
    vec2() {}
    vec2(float a, float b) : x(a), y(b) {}
};
struct vec3
{
    union
    {
        struct { float x, y, z; };
        struct { float r, g, b; };
        struct { float s, t, p; };
        // Here is the problem with g++.
        struct { vec2 xy; float z; };
        struct { float x; vec2 …
Run Code Online (Sandbox Code Playgroud)

c++ mingw g++ glsl visual-studio

12
推荐指数
2
解决办法
683
查看次数

标签 统计

c++ ×1

g++ ×1

glsl ×1

mingw ×1

visual-studio ×1