mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
Updated GLM version w/ now standard radians as angles.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
|
||||
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
/// of this software and associated documentation files (the "Software"), to deal
|
||||
/// in the Software without restriction, including without limitation the rights
|
||||
@@ -12,6 +12,10 @@
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// Restrictions:
|
||||
/// By making use of the Software for military purposes, you choose to make
|
||||
/// a Bunny unhappy.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
@@ -37,14 +41,13 @@
|
||||
/// <glm/gtc/random.hpp> need to be included to use these functionalities.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_GTC_random
|
||||
#define GLM_GTC_random GLM_VERSION
|
||||
#pragma once
|
||||
|
||||
// Dependency:
|
||||
#include "../glm.hpp"
|
||||
#include "../gtc/half_float.hpp"
|
||||
#include "../vec2.hpp"
|
||||
#include "../vec3.hpp"
|
||||
|
||||
#if(defined(GLM_MESSAGES) && !defined(glm_ext))
|
||||
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
|
||||
# pragma message("GLM: GLM_GTC_random extension included")
|
||||
#endif
|
||||
|
||||
@@ -59,10 +62,15 @@ namespace glm
|
||||
/// @param Max
|
||||
/// @tparam genType Value type. Currently supported: half (not recommanded), float or double scalars and vectors.
|
||||
/// @see gtc_random
|
||||
template <typename genType>
|
||||
genType linearRand(
|
||||
genType const & Min,
|
||||
genType const & Max);
|
||||
template <typename genTYpe>
|
||||
GLM_FUNC_DECL genTYpe linearRand(
|
||||
genTYpe Min,
|
||||
genTYpe Max);
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL vecType<T, P> linearRand(
|
||||
vecType<T, P> const & Min,
|
||||
vecType<T, P> const & Max);
|
||||
|
||||
/// Generate random numbers in the interval [Min, Max], according a gaussian distribution
|
||||
///
|
||||
@@ -70,45 +78,43 @@ namespace glm
|
||||
/// @param Deviation
|
||||
/// @see gtc_random
|
||||
template <typename genType>
|
||||
genType gaussRand(
|
||||
genType const & Mean,
|
||||
genType const & Deviation);
|
||||
GLM_FUNC_DECL genType gaussRand(
|
||||
genType Mean,
|
||||
genType Deviation);
|
||||
|
||||
/// Generate a random 2D vector which coordinates are regulary distributed on a circle of a given radius
|
||||
///
|
||||
/// @param Radius
|
||||
/// @see gtc_random
|
||||
template <typename T>
|
||||
detail::tvec2<T> circularRand(
|
||||
T const & Radius);
|
||||
template <typename T>
|
||||
GLM_FUNC_DECL tvec2<T, defaultp> circularRand(
|
||||
T Radius);
|
||||
|
||||
/// Generate a random 3D vector which coordinates are regulary distributed on a sphere of a given radius
|
||||
///
|
||||
/// @param Radius
|
||||
/// @see gtc_random
|
||||
template <typename T>
|
||||
detail::tvec3<T> sphericalRand(
|
||||
T const & Radius);
|
||||
template <typename T>
|
||||
GLM_FUNC_DECL tvec3<T, defaultp> sphericalRand(
|
||||
T Radius);
|
||||
|
||||
/// Generate a random 2D vector which coordinates are regulary distributed within the area of a disk of a given radius
|
||||
///
|
||||
/// @param Radius
|
||||
/// @see gtc_random
|
||||
template <typename T>
|
||||
detail::tvec2<T> diskRand(
|
||||
T const & Radius);
|
||||
template <typename T>
|
||||
GLM_FUNC_DECL tvec2<T, defaultp> diskRand(
|
||||
T Radius);
|
||||
|
||||
/// Generate a random 3D vector which coordinates are regulary distributed within the volume of a ball of a given radius
|
||||
///
|
||||
/// @param Radius
|
||||
/// @see gtc_random
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T> ballRand(
|
||||
T const & Radius);
|
||||
GLM_FUNC_DECL tvec3<T, defaultp> ballRand(
|
||||
T Radius);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "random.inl"
|
||||
|
||||
#endif//GLM_GTC_random
|
||||
|
||||
Reference in New Issue
Block a user