Cafu Engine
Misc.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_MATH_MISC_HPP_INCLUDED
8 #define CAFU_MATH_MISC_HPP_INCLUDED
9 
10 
11 template<class T> class Vector3T;
12 
13 
14 namespace cf
15 {
16  namespace math
17  {
18  float round(float f); ///< Rounds the given number to the nearest integer.
19  double round(double d); ///< Rounds the given number to the nearest integer.
20 
21  /// Rounds all components of the given vector to the nearest integer.
22  template<class T> Vector3T<T> round(const Vector3T<T>& v)
23  {
24  return Vector3T<T>(round(v.x), round(v.y), round(v.z));
25  }
26  }
27 }
28 
29 #endif
T y
The y-component of this vector.
Definition: Vector3.hpp:41
This class represents a polymorphic 3-dimensional vector.
Definition: Misc.hpp:11
T z
The z-component of this vector.
Definition: Vector3.hpp:42
T x
The x-component of this vector.
Definition: Vector3.hpp:40