MCPcopy Create free account
hub / github.com/RozDavid/UnScene3D / operator/=

Method operator/=

utils/cpp_utils/include/vec3.h:115–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113 }
114
115 inline void operator/=(T val) {
116 //optimized version for float/double (doesn't work for int) -- assumes compiler statically optimizes if
117 if (std::is_same<T, float>::value || std::is_same<T, double>::value) {
118 T inv = (T) 1 / val;
119 array[0] *= inv;
120 array[1] *= inv;
121 array[2] *= inv;
122 } else {
123 array[0] /= val;
124 array[1] /= val;
125 array[2] /= val;
126 }
127 }
128
129 inline vec3<T> operator*(T val) const {
130 return vec3<T>(array[0] * val, array[1] * val, array[2] * val);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected