mirror of
https://github.com/HandmadeMath/HandmadeMath.git
synced 2026-05-02 03:54:42 +00:00
Taking the parameter for the operator[] as a reference. This should allow it to be inlined
This commit is contained in:
@@ -316,9 +316,9 @@ typedef union hmm_vec2
|
|||||||
float Elements[2];
|
float Elements[2];
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
inline float &operator[](int i)
|
inline float &operator[](int &Index)
|
||||||
{
|
{
|
||||||
return Elements[i];
|
return Elements[Index];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} hmm_vec2;
|
} hmm_vec2;
|
||||||
@@ -367,9 +367,9 @@ typedef union hmm_vec3
|
|||||||
float Elements[3];
|
float Elements[3];
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
inline float &operator[](int i)
|
inline float &operator[](int &Index)
|
||||||
{
|
{
|
||||||
return Elements[i];
|
return Elements[Index];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} hmm_vec3;
|
} hmm_vec3;
|
||||||
@@ -431,9 +431,9 @@ typedef union hmm_vec4
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
inline float &operator[](int i)
|
inline float &operator[](int &Index)
|
||||||
{
|
{
|
||||||
return Elements[i];
|
return Elements[Index];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} hmm_vec4;
|
} hmm_vec4;
|
||||||
@@ -447,9 +447,9 @@ typedef union hmm_mat4
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
inline hmm_vec4 operator[](int i)
|
inline hmm_vec4 operator[](const int &Index)
|
||||||
{
|
{
|
||||||
float* col = Elements[i];
|
float* col = Elements[Index];
|
||||||
|
|
||||||
hmm_vec4 result;
|
hmm_vec4 result;
|
||||||
result.Elements[0] = col[0];
|
result.Elements[0] = col[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user