Skip to content

Commit

Permalink
libcore|Vector: Decomposing a Vector3 into an array
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Aug 12, 2014
1 parent 4f59457 commit f64dce8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doomsday/libcore/include/de/core/vector.h
Expand Up @@ -444,6 +444,10 @@ class Vector3 : public Vector2<Type>
if(vecAbs.z > vecAbs[axis]) axis = 2;
return axis;
}
inline void decompose(Type *array) const {
for(int i = 0; i < 3; ++i) array[i] = (*this)[i];
}

Vector2<Type> xz() const {
return Vector2<Type>(Vector2<Type>::x, z);
}
Expand Down

0 comments on commit f64dce8

Please sign in to comment.