Compare commits

...

2 Commits

Author SHA1 Message Date
Ben Visness
5ca1d58b36 Improve grammar/spelling 2018-11-29 13:21:05 -06:00
Zak Strange
5bf727dbd5 Removed copy in operator[] (#93)
* Removed copy in operator[]

* Updated version info
2018-11-29 09:32:12 -08:00
2 changed files with 8 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
/*
HandmadeMath.h v1.7.0
HandmadeMath.h v1.7.1
This is a single header file with a bunch of useful functions for game and
graphics math operations.
@@ -176,7 +176,8 @@
(*) Renamed the 'Rows' member of hmm_mat4 to 'Columns'. Since our
matrices are column-major, this should have been named 'Columns'
from the start. 'Rows' is still present, but has been deprecated.
1.7.1
(*) Changed operator[] to take a const ref int instead of an int.
LICENSE
@@ -324,7 +325,7 @@ typedef union hmm_vec2
float Elements[2];
#ifdef __cplusplus
inline float &operator[](int Index)
inline float &operator[](const int &Index)
{
return Elements[Index];
}
@@ -375,7 +376,7 @@ typedef union hmm_vec3
float Elements[3];
#ifdef __cplusplus
inline float &operator[](int Index)
inline float &operator[](const int &Index)
{
return Elements[Index];
}
@@ -439,7 +440,7 @@ typedef union hmm_vec4
#endif
#ifdef __cplusplus
inline float &operator[](int Index)
inline float &operator[](const int &Index)
{
return Elements[Index];
}
@@ -459,7 +460,7 @@ typedef union hmm_mat4
#endif
#ifdef __cplusplus
inline hmm_vec4 operator[](const int Index)
inline hmm_vec4 operator[](const int &Index)
{
float* col = Elements[Index];

View File

@@ -10,6 +10,7 @@ To get started, go download [the latest release](https://github.com/HandmadeMath
Version | Changes |
----------------|----------------|
**1.7.1** | Changed operator[] to take a const ref int instead of an int.
**1.7.0** | Renamed the 'Rows' member of hmm_mat4 to 'Columns'. Since our matrices are column-major, this should have been named 'Columns' from the start. 'Rows' is still present, but has been deprecated.
**1.6.0** | Added array subscript operators for vector and matrix types in C++. This is provided as a convenience, but be aware that it may incur an extra function call in unoptimized builds.
**1.5.1** | Fixed a bug with uninitialized elements in HMM_LookAt.