mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 13:48:38 -05:00
There is no need for operator bool conversion:
- it was there for != NULL checks when convert-to-pointer existed, which is no longer the case.
This commit is contained in:
parent
3095f8205a
commit
dd2fa12d57
28
external/cubicvr2/math/mat4.h
vendored
28
external/cubicvr2/math/mat4.h
vendored
@ -39,15 +39,6 @@ namespace CubicVR {
|
||||
return (as_array[i]);
|
||||
}
|
||||
|
||||
//compare to ZERO-filled matrix
|
||||
inline operator bool() const {
|
||||
|
||||
return (a != 0.0f || b != 0.0f || c != 0.0f || d != 0.0f ||
|
||||
e != 0.0f || f != 0.0f || g != 0.0f || h != 0.0f ||
|
||||
i != 0.0f || j != 0.0f || k != 0.0f || l != 0.0f ||
|
||||
m != 0.0f || n != 0.0f || o != 0.0f || p != 0.0f);
|
||||
}
|
||||
|
||||
//To be accessed by GL API directly, accessed by pointer.
|
||||
//operator* overloading is way too dangerous, especially in ptr != NULL
|
||||
//tests.
|
||||
@ -286,22 +277,19 @@ namespace CubicVR {
|
||||
static mat4 transform(vec3 position, vec3 rotation, vec3 scale) {
|
||||
mat4 m = mat4::identity();
|
||||
|
||||
if (!position) {
|
||||
m *= mat4::translate(position[0],position[1],position[2]);
|
||||
m *= mat4::translate(position[0],position[1],position[2]);
|
||||
|
||||
if (!(rotation[0] == 0 && rotation[1] == 0 && rotation[2] == 0)) {
|
||||
m *= mat4::rotate(rotation[0], rotation[1], rotation[2]);
|
||||
}
|
||||
if (!rotation) {
|
||||
if (!(rotation[0] == 0 && rotation[1] == 0 && rotation[2] == 0)) {
|
||||
m *= mat4::rotate(rotation[0],rotation[1],rotation[2]);
|
||||
}
|
||||
}
|
||||
if (!scale) {
|
||||
if (!(scale[0] == 1 && scale[1] == 1 && scale[2] == 1)) {
|
||||
m *= mat4::scale(scale[0],scale[1],scale[2]);
|
||||
}
|
||||
|
||||
if (!(scale[0] == 1 && scale[1] == 1 && scale[2] == 1)) {
|
||||
m *= mat4::scale(scale[0],scale[1],scale[2]);
|
||||
}
|
||||
|
||||
return m;
|
||||
};
|
||||
|
||||
static vec4 vec4_multiply(vec4 m1, mat4 m2) {
|
||||
vec4 mOut;
|
||||
|
||||
|
8
external/cubicvr2/math/transform.h
vendored
8
external/cubicvr2/math/transform.h
vendored
@ -73,7 +73,7 @@ namespace CubicVR {
|
||||
|
||||
void pushMatrix(mat4 m) {
|
||||
c_stack++;
|
||||
m_stack[c_stack] = (m ? m : getIdentity());
|
||||
m_stack[c_stack] = m;
|
||||
}
|
||||
|
||||
void popMatrix() {
|
||||
@ -91,11 +91,7 @@ namespace CubicVR {
|
||||
|
||||
result = mat4::identity();
|
||||
|
||||
if (!init_mat) {
|
||||
m_stack[0] = init_mat;
|
||||
} else {
|
||||
setIdentity();
|
||||
}
|
||||
m_stack[0] = init_mat;
|
||||
}
|
||||
|
||||
void translate(__float x, __float y, __float z) {
|
||||
|
6
external/cubicvr2/math/vec3.h
vendored
6
external/cubicvr2/math/vec3.h
vendored
@ -39,12 +39,6 @@ namespace CubicVR {
|
||||
return (as_array[i]);
|
||||
}
|
||||
|
||||
//compare to ZERO-filled vector
|
||||
inline operator bool() const {
|
||||
|
||||
return (x != 0.0f || y != 0.0f || z != 0.0f);
|
||||
}
|
||||
|
||||
vec3 (__float xi,__float yi,__float zi) { x = xi; y = yi; z = zi; }
|
||||
vec3 () { x = y = z = 0.0f; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user