Improve documentation

Former-commit-id: 08d70f6a53a7f12d2748d145d1fe139595a1b39e
This commit is contained in:
Lynix
2016-03-01 15:37:05 +01:00
parent dbce7592a9
commit 1c4135fc09
74 changed files with 277 additions and 242 deletions

View File

@@ -99,6 +99,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Approaches the objective, beginning with value and with increment
* \return The nearest value of the objective you can get with the value and the increment for one step
*
@@ -120,6 +121,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Clamps value between min and max and returns the expected value
* \return If value is not in the interval of min..max, value obtained is the nearest limit of this interval
*
@@ -135,6 +137,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets number of bits set in the number
* \return The number of bits set to 1
*
@@ -157,6 +160,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Converts degree to radian
* \return The representation in radian of the angle in degree (0..2*pi)
*
@@ -170,6 +174,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the unit from degree and convert it according to NAZARA_MATH_ANGLE_RADIAN
* \return Express the degrees
*
@@ -187,6 +192,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the unit from radian and convert it according to NAZARA_MATH_ANGLE_RADIAN
* \return Express the radians
*
@@ -204,6 +210,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the nearest power of two for the number
* \return First power of two containing the number
*
@@ -222,6 +229,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the number of digits to represent the number in base 10
* \return Number of digits
*
@@ -249,6 +257,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the number of digits to represent the number in base 10
* \return Number of digits
*
@@ -270,6 +279,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the number of digits to represent the number in base 10
* \return Number of digits
*
@@ -285,6 +295,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the number of digits to represent the number in base 10
* \return Number of digits
*
@@ -301,6 +312,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the number of digits to represent the number in base 10
* \return Number of digits
*
@@ -316,6 +328,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the number of digits to represent the number in base 10
* \return Number of digits
*
@@ -332,6 +345,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the number of digits to represent the number in base 10
* \return Number of digits + 1 for the dot
*
@@ -346,6 +360,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the number of digits to represent the number in base 10
* \return Number of digits + 1 for the dot
*
@@ -360,6 +375,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the number of digits to represent the number in base 10
* \return Number of digits + 1 for the dot
*
@@ -374,6 +390,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the log in base 2 of integral number
* \return Log of the number (floor)
*
@@ -391,6 +408,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the log in base 2 of integral number, only works for power of two !
* \return Log of the number
*
@@ -408,6 +426,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the power of integrals
* \return base^exponent for integral
*
@@ -426,6 +445,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Interpolates the value to other one with a factor of interpolation
* \return A new value which is the interpolation of two values
*
@@ -446,6 +466,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Multiplies X and Y, then add Z
* \return The result of X * Y + Z
*
@@ -487,6 +508,7 @@ namespace Nz
#endif
/*!
* \ingroup math
* \brief Normalizes the angle
* \return Normalized value between 0..2*(pi if radian or 180 if degrees)
*
@@ -512,6 +534,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Checks whether two numbers are equal
* \return true if they are equal within a certain epsilon
*
@@ -527,6 +550,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Checks whether two numbers are equal
* \return true if they are equal within the max difference
*
@@ -547,6 +571,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Converts the number to String
* \return String representation of the number
*
@@ -598,6 +623,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Converts radian to degree
* \return The representation in degree of the angle in radian (0..360)
*
@@ -611,6 +637,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Converts the string to number
* \return Number which is represented by the string
*
@@ -672,6 +699,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the degree from unit and convert it according to NAZARA_MATH_ANGLE_RADIAN
* \return Express in degrees
*
@@ -689,6 +717,7 @@ namespace Nz
}
/*!
* \ingroup math
* \brief Gets the radian from unit and convert it according to NAZARA_MATH_ANGLE_RADIAN
* \return Express in radians
*

View File

@@ -15,14 +15,15 @@ namespace Nz
{
/*!
* \class Nz::BoundingVolume<T>
* \ingroup math
* \class Nz::BoundingVolume
* \brief Math class that represents a bounding volume, a combination of a box and an oriented box
*
* \remark You need to call Update not to have undefined behaviour
*/
/*!
* \brief Constructs a BoundingVolume<T> object by default
* \brief Constructs a BoundingVolume object by default
*
* \remark extend is set to Extend_Null, aabb and obb are uninitialized
*/
@@ -34,7 +35,7 @@ namespace Nz
}
/*!
* \brief Constructs a BoundingVolume<T> object from Extend
* \brief Constructs a BoundingVolume object from Extend
* \param Extend Extend of the volume part of enumeration Extend
*
* \remark Aabb and obb are uninitialized
@@ -47,7 +48,7 @@ namespace Nz
}
/*!
* \brief Constructs a BoundingVolume<T> object from its position and sizes
* \brief Constructs a BoundingVolume object from its position and sizes
*
* \param X X component of position
* \param Y Y component of position
@@ -66,7 +67,7 @@ namespace Nz
}
/*!
* \brief Constructs a BoundingVolume<T> object from a box
* \brief Constructs a BoundingVolume object from a box
*
* \param box Box<T> object
*
@@ -80,7 +81,7 @@ namespace Nz
}
/*!
* \brief Constructs a BoundingVolume<T> object from an oriented box
* \brief Constructs a BoundingVolume object from an oriented box
*
* \param orientedBox OrientedBox<T> object
*
@@ -94,7 +95,7 @@ namespace Nz
}
/*!
* \brief Constructs a BoundingVolume<T> object from two vectors representing point of the space
* \brief Constructs a BoundingVolume object from two vectors representing point of the space
* (X, Y, Z) will be the components minimum of the two vectors and the (width, height, depth) will be the components maximum - minimum
*
* \param vec1 First point
@@ -110,7 +111,7 @@ namespace Nz
}
/*!
* \brief Constructs a BoundingVolume<T> object from another type of BoundingVolume
* \brief Constructs a BoundingVolume object from another type of BoundingVolume
*
* \param volume BoundingVolume of type U to convert to type T
*/
@@ -272,7 +273,7 @@ namespace Nz
}
/*!
* \brief Sets a BoundingVolume<T> object from two vectors representing point of the space
* \brief Sets a BoundingVolume object from two vectors representing point of the space
* (X, Y, Z) will be the components minimum of the two vectors and the (width, height, depth) will be the components maximum - minimum
*
* \param vec1 First point

View File

@@ -13,12 +13,13 @@
namespace Nz
{
/*!
* \class Nz::Box<T>
* \ingroup math
* \class Nz::Box
* \brief Math class that represents a three dimensional box
*/
/*!
* \brief Constructs a Box<T> object from its width, height and depth
* \brief Constructs a Box object from its width, height and depth
*
* \param Width Width of the box (following X)
* \param Height Height of the box (following Y)
@@ -51,7 +52,7 @@ namespace Nz
}
/*!
* \brief Constructs a Box<T> object from an array of six elements
* \brief Constructs a Box object from an array of six elements
*
* \param vec[6] vec[0] is X position, vec[1] is Y position, vec[2] is Z position, vec[3] is width, vec[4] is height and vec[5] is depth
*/
@@ -63,7 +64,7 @@ namespace Nz
}
/*!
* \brief Constructs a Box<T> object from a Rect
* \brief Constructs a Box object from a Rect
*
* \param rect Rectangle which describes (X, Y) position and (width, height) lenghts
*
@@ -77,7 +78,7 @@ namespace Nz
}
/*!
* \brief Constructs a Box<T> object from a vector representing width, height and depth
* \brief Constructs a Box object from a vector representing width, height and depth
*
* \param lengths (Width, Height, Depth) of the box
*
@@ -91,7 +92,7 @@ namespace Nz
}
/*!
* \brief Constructs a Box<T> object from two vectors representing point of the space
* \brief Constructs a Box object from two vectors representing point of the space
* (X, Y, Z) will be the components minimum of the two vectors and the (width, height, depth) will be the components maximum - minimum
*
* \param vec1 First point
@@ -105,7 +106,7 @@ namespace Nz
}
/*!
* \brief Constructs a Box<T> object from another type of Box
* \brief Constructs a Box object from another type of Box
*
* \param box Box of type U to convert to type T
*/
@@ -540,7 +541,7 @@ namespace Nz
}
/*!
* \brief Constructs a Box<T> object from its position and sizes
* \brief Constructs a Box object from its position and sizes
*
* \param X X component of position
* \param Y Y component of position

View File

@@ -28,6 +28,11 @@
#ifndef NAZARA_CONFIG_MATH_HPP
#define NAZARA_CONFIG_MATH_HPP
/*!
* \defgroup math (NazaraMath) Mathematics module
* 2D/3D mathematics module including matrix, vector, box, sphere, quaternion, ...
*/
/// Each modification of a paramater of the module needs a recompilation of the unit
// Define the radian as unit for angles

View File

@@ -16,14 +16,15 @@ namespace Nz
{
/*!
* \class Nz::Vector4<T>
* \ingroup math
* \class Nz::EulerAngles
* \brief Math class that represents an Euler angle. Those describe a rotation transformation by rotating an object on its various axes in specified amounts per axis, and a specified axis order
*
* \remark Rotation are "left-handed", it means that you take your left hand, put your thumb finger in the direction you want and you other fingers represent the way of rotating
*/
/*!
* \brief Constructs a EulerAngles<T> object from its components
* \brief Constructs a EulerAngles object from its components
*
* \param P Pitch component = X axis
* \param Y Yaw component = Y axis
@@ -37,7 +38,7 @@ namespace Nz
}
/*!
* \brief Constructs a EulerAngles<T> object from an array of three elements
* \brief Constructs a EulerAngles object from an array of three elements
*
* \param angles[3] angles[0] is pitch component, angles[1] is yaw component and angles[2] is roll component
*/
@@ -49,7 +50,7 @@ namespace Nz
}
/*!
* \brief Constructs a EulerAngles<T> object from a quaternion
* \brief Constructs a EulerAngles object from a quaternion
*
* \param quat Quaternion representing a rotation of space
*/
@@ -61,7 +62,7 @@ namespace Nz
}
/*!
* \brief Constructs a EulerAngles<T> object from another type of EulerAngles
* \brief Constructs a EulerAngles object from another type of EulerAngles
*
* \param angles EulerAngles of type U to convert to type T
*/

View File

@@ -17,14 +17,15 @@ namespace Nz
{
/*!
* \class Nz::Frustum<T>
* \ingroup math
* \class Nz::Frustum
* \brief Math class that represents a frustum in the three dimensional vector space
*
* Frustums are used to determine what is inside the camera's field of view. They help speed up the rendering process
*/
/*!
* \brief Constructs a Frustum<T> object from another type of Frustum
* \brief Constructs a Frustum object from another type of Frustum
*
* \param frustum Frustum of type U to convert to type T
*/

View File

@@ -22,14 +22,15 @@ namespace Nz
{
/*!
* \class Nz::Matrix4<T>
* \ingroup math
* \class Nz::Matrix4
* \brief Math class that represents a transformation of the four dimensional vector space with the notion of projectivity
*
* \remark Matrix4 is said to be "row-major" and affine if last column is made of (0, 0, 0, 1)
*/
/*!
* \brief Constructs a Matrix4<T> object from its components
* \brief Constructs a Matrix4 object from its components
*
* \param rIJ Matrix components at index(I, J)
*/
@@ -47,7 +48,7 @@ namespace Nz
}
/*!
* \brief Constructs a Matrix4<T> object from an array of sixteen elements
* \brief Constructs a Matrix4 object from an array of sixteen elements
*
* \param matrix[16] Matrix components
*/
@@ -59,7 +60,7 @@ namespace Nz
}
/*!
* \brief Constructs a Matrix4<T> object from another type of Matrix4
* \brief Constructs a Matrix4 object from another type of Matrix4
*
* \param matrix Matrix4 of type U to convert to type T
*/
@@ -1785,7 +1786,7 @@ std::ostream& operator<<(std::ostream& out, const Nz::Matrix4<T>& matrix)
*/
template<typename T>
Nz::Matrix4<T> operator*(T scale, const Nz::Matrix4<T>& matrix)
Nz::Matrix4<T> operator*(T scale, const Nz::Matrix4& matrix)
{
return matrix * scale;
}

View File

@@ -14,14 +14,15 @@
namespace Nz
{
/*!
* \class Nz::OrientedBox<T>
* \ingroup math
* \class Nz::OrientedBox
* \brief Math class that represents an oriented three dimensional box
*
* \remark You need to call Update not to have undefined behaviour
*/
/*!
* \brief Constructs a OrientedBox<T> object from its position and sizes
* \brief Constructs a OrientedBox object from its position and sizes
*
* \param X X component of position
* \param Y Y component of position
@@ -38,7 +39,7 @@ namespace Nz
}
/*!
* \brief Constructs a OrientedBox<T> object from a box
* \brief Constructs a OrientedBox object from a box
*
* \param box Box<T> object
*/
@@ -50,7 +51,7 @@ namespace Nz
}
/*!
* \brief Constructs a OrientedBox<T> object from two vectors representing point of the space
* \brief Constructs a OrientedBox object from two vectors representing point of the space
* (X, Y, Z) will be the components minimum of the two vectors and the (width, height, depth) will be the components maximum - minimum
*
* \param vec1 First point
@@ -64,7 +65,7 @@ namespace Nz
}
/*!
* \brief Constructs a OrientedBox<T> object from another type of OrientedBox
* \brief Constructs a OrientedBox object from another type of OrientedBox
*
* \param orientedBox OrientedBox of type U to convert to type T
*/
@@ -178,7 +179,7 @@ namespace Nz
}
/*!
* \brief Sets a OrientedBox<T> object from two vectors representing point of the space
* \brief Sets a OrientedBox object from two vectors representing point of the space
* (X, Y, Z) will be the components minimum of the two vectors and the (width, height, depth) will be the components maximum - minimum
*
* \param vec1 First point

View File

@@ -12,14 +12,15 @@
namespace Nz
{
/*!
* \class Nz::Vector4<T>
* \ingroup math
* \class Nz::Plane
* \brief Math class that represents a plane in 3D
*
* \remark The convention used in this class is: If you ask for plane with normal (0, 1, 0) and distance 1, you will get 0 * X + 1 * Y + 0 * Z - 1 = 0 or Y = 1. Notice the sign minus before the distance on the left side of the equation
*/
/*!
* \brief Constructs a Plane<T> object from its components
* \brief Constructs a Plane object from its components
*
* \param normalX X component of the normal
* \param normalY Y component of the normal
@@ -34,7 +35,7 @@ namespace Nz
}
/*!
* \brief Constructs a Plane<T> object from an array of four elements
* \brief Constructs a Plane object from an array of four elements
*
* \param plane[4] plane[0] is X component, plane[1] is Y component, plane[2] is Z component and plane[3] is D
*/
@@ -46,7 +47,7 @@ namespace Nz
}
/*!
* \brief Constructs a Plane<T> object from a normal and a distance
* \brief Constructs a Plane object from a normal and a distance
*
* \param Normal normal of the vector
* \param D Distance to origin
@@ -59,7 +60,7 @@ namespace Nz
}
/*!
* \brief Constructs a Plane<T> object from a normal and a point
* \brief Constructs a Plane object from a normal and a point
*
* \param Normal Normal of the plane
* \param point Point which verifies the equation of the plane
@@ -72,7 +73,7 @@ namespace Nz
}
/*!
* \brief Constructs a Plane<T> object from three points
* \brief Constructs a Plane object from three points
*
* \param point1 First point
* \param point2 Second point
@@ -88,7 +89,7 @@ namespace Nz
}
/*!
* \brief Constructs a Plane<T> object from another type of Plane
* \brief Constructs a Plane object from another type of Plane
*
* \param plane Plane of type U to convert to type T
*/

View File

@@ -16,14 +16,15 @@
namespace Nz
{
/*!
* \class Nz::Quaternion<T>
* \ingroup math
* \class Nz::Quaternion
* \brief Math class that represents an element of the quaternions
*
* \remark The quaternion is meant to be 'unit' to represent rotations in a three dimensional space
*/
/*!
* \brief Constructs a Quaternion<T> object from its components
* \brief Constructs a Quaternion object from its components
*
* \param W W component
* \param X X component
@@ -38,7 +39,7 @@ namespace Nz
}
/*!
* \brief Constructs a Quaternion<T> object from a EulerAngles
* \brief Constructs a Quaternion object from a EulerAngles
*
* \param angles Easier representation of rotation of space
*
@@ -52,7 +53,7 @@ namespace Nz
}
/*!
* \brief Constructs a Quaternion<T> object from an angle and a direction
* \brief Constructs a Quaternion object from an angle and a direction
*
* \param angle Unit depends of NAZARA_MATH_ANGLE_RADIAN
* \param axis Vector3 which represents a direction, no need to be normalized
@@ -65,7 +66,7 @@ namespace Nz
}
/*!
* \brief Constructs a Quaternion<T> object from an array of four elements
* \brief Constructs a Quaternion object from an array of four elements
*
* \param quat[4] quat[0] is W component, quat[1] is X component, quat[2] is Y component and quat[3] is Z component
*/
@@ -85,7 +86,7 @@ namespace Nz
*/
/*!
* \brief Constructs a Quaternion<T> object from another type of Quaternion
* \brief Constructs a Quaternion object from another type of Quaternion
*
* \param quat Quaternion of type U to convert to type T
*/

View File

@@ -11,14 +11,15 @@
namespace Nz
{
/*!
* \class Nz::Ray<T>
* \ingroup math
* \class Nz::Ray
* \brief Math class that represents a ray or a straight line in 3D space
*
* This ray is meant to be understood like origin + lambda * direction, where lambda is a real positive parameter
*/
/*!
* \brief Constructs a Ray<T> object from its position and direction
* \brief Constructs a Ray object from its position and direction
*
* \param X X position
* \param Y Y position
@@ -35,7 +36,7 @@ namespace Nz
}
/*!
* \brief Constructs a Ray<T> object from two Vector3
* \brief Constructs a Ray object from two Vector3
*
* \param Origin Vector which represents the origin of the ray
* \param Direction Vector which represents the direction of the ray
@@ -48,7 +49,7 @@ namespace Nz
}
/*!
* \brief Constructs a Ray<T> object from two arrays of three elements
* \brief Constructs a Ray object from two arrays of three elements
*
* \param Origin[3] Origin[0] is X position, Origin[1] is Y position and Origin[2] is Z position
* \param Direction[3] Direction[0] is X direction, Direction[1] is Y direction and Direction[2] is Z direction
@@ -61,7 +62,7 @@ namespace Nz
}
/*!
* \brief Constructs a Ray<T> object from the intersection of two planes
* \brief Constructs a Ray object from the intersection of two planes
*
* \param planeOne First plane
* \param planeTwo Second secant plane
@@ -77,7 +78,7 @@ namespace Nz
}
/*!
* \brief Constructs a Ray<T> object from another type of Ray
* \brief Constructs a Ray object from another type of Ray
*
* \param ray Ray of type U to convert to type T
*/
@@ -90,7 +91,7 @@ namespace Nz
}
/*!
* \brief Constructs a Ray<T> object from two Vector3 from another type of Ray
* \brief Constructs a Ray object from two Vector3 from another type of Ray
*
* \param Origin Origin of type U to convert to type T
* \param Direction Direction of type U to convert to type T

View File

@@ -13,14 +13,15 @@
namespace Nz
{
/*!
* \class Nz::Rect<T>
* \ingroup math
* \class Nz::Rect
* \brief Math class that represents an axis-aligned rectangle in two dimensions
*
* \remark The basis is said to be "left-hand". It means that with your left hand, the thumb is X positive, the index finger Y positive pointing to the bottom
*/
/*!
* \brief Constructs a Rect<T> object from its width and height
* \brief Constructs a Rect object from its width and height
*
* \param Width Width of the rectangle (following X)
* \param Height Height of the rectangle (following Y)
@@ -35,7 +36,7 @@ namespace Nz
}
/*!
* \brief Constructs a Rect<T> object from its position, width and height
* \brief Constructs a Rect object from its position, width and height
*
* \param X X position
* \param Y Y position
@@ -50,7 +51,7 @@ namespace Nz
}
/*!
* \brief Constructs a Rect<T> object from an array of four elements
* \brief Constructs a Rect object from an array of four elements
*
* \param vec[4] vec[0] is X position, vec[1] is Y position, vec[2] is width and vec[3] is height
*/
@@ -62,7 +63,7 @@ namespace Nz
}
/*!
* \brief Constructs a Rect<T> object from a vector representing width and height
* \brief Constructs a Rect object from a vector representing width and height
*
* \param lengths (Width, Height) of the rectangle
*
@@ -76,7 +77,7 @@ namespace Nz
}
/*!
* \brief Constructs a Rect<T> object from two vectors representing point of the space
* \brief Constructs a Rect object from two vectors representing point of the space
* (X, Y) will be the components minimum of the two vectors and the width and height will be the components maximum - minimum
*
* \param vec1 First point
@@ -90,7 +91,7 @@ namespace Nz
}
/*!
* \brief Constructs a Rect<T> object from another type of Rect
* \brief Constructs a Rect object from another type of Rect
*
* \param rect Rect of type U to convert to type T
*/
@@ -504,7 +505,7 @@ namespace Nz
}
/*!
* \brief Sets a Rect<T> object from two vectors representing point of the space
* \brief Sets a Rect object from two vectors representing point of the space
* (X, Y) will be the components minimum of the two vectors and the width and height will be the components maximum - minimum
* \return A reference to this rectangle
*

View File

@@ -14,12 +14,13 @@
namespace Nz
{
/*!
* \class Nz::Sphere<T>
* \ingroup math
* \class Nz::Sphere
* \brief Math class that represents a sphere "S2" in a three dimensional euclidean space
*/
/*!
* \brief Constructs a Sphere<T> object from its center position and radius
* \brief Constructs a Sphere object from its center position and radius
*
* \param X X position
* \param Y Y position
@@ -41,7 +42,7 @@ namespace Nz
*/
/*!
* \brief Constructs a Sphere<T> object from its position and radius
* \brief Constructs a Sphere object from its position and radius
*
* \param center Center of the sphere
* \param Radius Half of the diameter
@@ -54,7 +55,7 @@ namespace Nz
}
/*!
* \brief Constructs a Sphere<T> object from an array of four elements
* \brief Constructs a Sphere object from an array of four elements
*
* \param sphere[4] sphere[0] is X component, sphere[1] is Y component, sphere[2] is Z component and sphere[3] is radius
*/
@@ -66,7 +67,7 @@ namespace Nz
}
/*!
* \brief Constructs a Sphere<T> object from another type of Sphere
* \brief Constructs a Sphere object from another type of Sphere
*
* \param sphere Sphere of type U to convert to type T
*/

View File

@@ -14,12 +14,13 @@
namespace Nz
{
/*!
* \class Nz::Vector2<T>
* \ingroup math
* \class Nz::Vector2
* \brief Math class that represents an element of the two dimensional vector space
*/
/*!
* \brief Constructs a Vector2<T> object from its coordinates
* \brief Constructs a Vector2 object from its coordinates
*
* \param X X component
* \param Y Y component
@@ -32,7 +33,7 @@ namespace Nz
}
/*!
* \brief Constructs explicitely a Vector2<T> object from its "scale"
* \brief Constructs explicitely a Vector2 object from its "scale"
*
* \param scale X component = Y component
*/
@@ -44,7 +45,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector2<T> object from an array of two elements
* \brief Constructs a Vector2 object from an array of two elements
*
* \param vec[2] vec[0] is X component and vec[1] is Y component
*/
@@ -56,7 +57,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector2<T> object from another type of Vector2
* \brief Constructs a Vector2 object from another type of Vector2
*
* \param vec Vector of type U to convert to type T
*/
@@ -69,7 +70,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector2<T> object from a Vector3
* \brief Constructs a Vector2 object from a Vector3
*
* \param vec Vector3 where only the first two components are taken
*/
@@ -81,7 +82,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector2<T> object from a Vector4
* \brief Constructs a Vector2 object from a Vector4
*
* \param vec Vector4 where only the first two components are taken
*/
@@ -988,7 +989,7 @@ std::ostream& operator<<(std::ostream& out, const Nz::Vector2<T>& vec)
*/
template<typename T>
Nz::Vector2<T> operator*(T scale, const Nz::Vector2<T>& vec)
Nz::Vector2<T> operator*(T scale, const Nz::Vector2& vec)
{
return Nz::Vector2<T>(scale * vec.x, scale * vec.y);
}

View File

@@ -14,14 +14,15 @@
namespace Nz
{
/*!
* \class Nz::Vector2<T>
* \ingroup math
* \class Nz::Vector3
* \brief Math class that represents an element of the three dimensional vector space
*
* \remark The basis is said to be "right-hand". It means that with your right hand, the thumb is X positive, the index finger Y positive and the middle finger (pointing to you) Z positive
*/
/*!
* \brief Constructs a Vector3<T> object from its coordinates
* \brief Constructs a Vector3 object from its coordinates
*
* \param X X component
* \param Y Y component
@@ -35,7 +36,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector3<T> object from a component and a Vector2<T>
* \brief Constructs a Vector3 object from a component and a Vector2<T>
*
* \param X X component
* \param vec vec.X = Y component and vec.y = Z component
@@ -48,7 +49,7 @@ namespace Nz
}
/*!
* \brief Constructs explicitely a Vector3<T> object from its "scale"
* \brief Constructs explicitely a Vector3 object from its "scale"
*
* \param scale X component = Y component = Z component
*/
@@ -60,7 +61,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector3<T> object from an array of three elements
* \brief Constructs a Vector3 object from an array of three elements
*
* \param vec[3] vec[0] is X component, vec[1] is Y component and vec[2] is Z component
*/
@@ -72,7 +73,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector3<T> object from a Vector2<T> and a component
* \brief Constructs a Vector3 object from a Vector2<T> and a component
*
* \param vec vec.X = X component and vec.y = Y component
* \param Z Z component
@@ -85,7 +86,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector3<T> object from another type of Vector3
* \brief Constructs a Vector3 object from another type of Vector3
*
* \param vec Vector of type U to convert to type T
*/
@@ -98,7 +99,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector3<T> object from a Vector4
* \brief Constructs a Vector3 object from a Vector4
*
* \param vec Vector4 where only the first three components are taken
*/
@@ -1299,7 +1300,7 @@ std::ostream& operator<<(std::ostream& out, const Nz::Vector3<T>& vec)
*/
template<typename T>
Nz::Vector3<T> operator*(T scale, const Nz::Vector3<T>& vec)
Nz::Vector3<T> operator*(T scale, const Nz::Vector3& vec)
{
return Nz::Vector3<T>(scale * vec.x, scale * vec.y, scale * vec.z);
}

View File

@@ -16,12 +16,13 @@ namespace Nz
{
/*!
* \class Nz::Vector4<T>
* \ingroup math
* \class Nz::Vector4
* \brief Math class that represents an element of the three dimensional vector space with the notion of projectivity. When the fourth component is 1, it describes an 'usual' point and when it is 0, it represents the point at infinity
*/
/*!
* \brief Constructs a Vector4<T> object from its coordinates
* \brief Constructs a Vector4 object from its coordinates
*
* \param X X component
* \param Y Y component
@@ -36,7 +37,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector4<T> object from two components and a Vector2<T>
* \brief Constructs a Vector4 object from two components and a Vector2<T>
*
* \param X X component
* \param Y Y component
@@ -50,7 +51,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector4<T> object from one component, a Vector2<T> and one component
* \brief Constructs a Vector4 object from one component, a Vector2<T> and one component
*
* \param X X component
* \param vec vec.X = Y component and vec.y = Z component
@@ -64,7 +65,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector4<T> object from one component and a Vector3<T>
* \brief Constructs a Vector4 object from one component and a Vector3<T>
*
* \param X X component
* \param vec vec.X = Y component, vec.y = Z component and vec.z = W component
@@ -77,7 +78,7 @@ namespace Nz
}
/*!
* \brief Constructs explicitely a Vector4<T> object from its "scale"
* \brief Constructs explicitely a Vector4 object from its "scale"
*
* \param scale X component = Y component = Z component = W component
*/
@@ -89,7 +90,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector4<T> object from an array of four elements
* \brief Constructs a Vector4 object from an array of four elements
*
* \param vec[4] vec[0] is X component, vec[1] is Y component, vec[2] is Z component and vec[3] is W component
*/
@@ -101,7 +102,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector4<T> object from a Vector2<T> and two components
* \brief Constructs a Vector4 object from a Vector2<T> and two components
*
* \param vec vec.X = X component and vec.y = Y component
* \param Z Z component
@@ -115,7 +116,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector4<T> object from one component and a Vector3<T>
* \brief Constructs a Vector4 object from one component and a Vector3<T>
*
* \param vec vec.X = X component, vec.y = Y component and vec.z = Z component
* \param W W component
@@ -128,7 +129,7 @@ namespace Nz
}
/*!
* \brief Constructs a Vector4<T> object from another type of Vector4
* \brief Constructs a Vector4 object from another type of Vector4
*
* \param vec Vector of type U to convert to type T
*/
@@ -1037,7 +1038,7 @@ std::ostream& operator<<(std::ostream& out, const Nz::Vector4<T>& vec)
template<typename T>
Nz::Vector4<T> operator*(T scale, const Nz::Vector4<T>& vec)
Nz::Vector4<T> operator*(T scale, const Nz::Vector4& vec)
{
return Nz::Vector4<T>(scale * vec.x, scale * vec.y, scale * vec.z, scale * vec.w);
}