mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-07 09: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
|
||||
@@ -36,15 +40,13 @@
|
||||
/// <glm/gtx/bit.hpp> need to be included to use these functionalities.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_GTX_bit
|
||||
#define GLM_GTX_bit GLM_VERSION
|
||||
#pragma once
|
||||
|
||||
// Dependency:
|
||||
#include "../glm.hpp"
|
||||
#include "../gtc/half_float.hpp"
|
||||
// Dependencies
|
||||
#include "../gtc/bitfield.hpp"
|
||||
|
||||
#if(defined(GLM_MESSAGES) && !defined(glm_ext))
|
||||
# pragma message("GLM: GLM_GTX_bit extension included")
|
||||
#if(defined(GLM_MESSAGES))
|
||||
# pragma message("GLM: GLM_GTX_bit extension is deprecated, include GLM_GTC_bitfield and GLM_GTC_integer instead")
|
||||
#endif
|
||||
|
||||
namespace glm
|
||||
@@ -52,89 +54,67 @@ namespace glm
|
||||
/// @addtogroup gtx_bit
|
||||
/// @{
|
||||
|
||||
/// Build a mask of 'count' bits
|
||||
/// @see gtx_bit
|
||||
template <typename genIType>
|
||||
genIType mask(genIType const & count);
|
||||
|
||||
/// Component wise extraction of bit fields.
|
||||
/// genType and genIType could be a scalar or a vector.
|
||||
/// @see gtx_bit
|
||||
template <typename genIUType, typename sizeType>
|
||||
GLM_DEPRECATED genIUType extractField(
|
||||
genIUType const & v,
|
||||
sizeType const & first,
|
||||
sizeType const & count);
|
||||
|
||||
//! Find the lowest bit set to 1 in a integer variable.
|
||||
/// @see gtx_bit
|
||||
template <typename genType>
|
||||
GLM_DEPRECATED int lowestBit(genType const & value);
|
||||
|
||||
//! Find the highest bit set to 1 in a integer variable.
|
||||
/// @see gtx_bit
|
||||
template <typename genType>
|
||||
GLM_DEPRECATED int highestBit(genType const & value);
|
||||
|
||||
//! Find the highest bit set to 1 in a integer variable and return its value.
|
||||
/// @see gtx_bit
|
||||
template <typename genType>
|
||||
genType highestBitValue(genType const & value);
|
||||
|
||||
//! Return true if the value is a power of two number.
|
||||
/// @see gtx_bit
|
||||
template <typename genType>
|
||||
bool isPowerOfTwo(genType const & value);
|
||||
|
||||
//! Return the power of two number which value is just higher the input value.
|
||||
/// @see gtx_bit
|
||||
template <typename genType>
|
||||
genType powerOfTwoAbove(genType const & value);
|
||||
|
||||
//! Return the power of two number which value is just lower the input value.
|
||||
/// @see gtx_bit
|
||||
template <typename genType>
|
||||
genType powerOfTwoBelow(genType const & value);
|
||||
|
||||
//! Return the power of two number which value is the closet to the input value.
|
||||
/// @see gtx_bit
|
||||
template <typename genType>
|
||||
genType powerOfTwoNearest(genType const & value);
|
||||
|
||||
//! Revert all bits of any integer based type.
|
||||
/// @see gtx_bit
|
||||
template <typename genType>
|
||||
GLM_DEPRECATED genType bitRevert(genType const & value);
|
||||
|
||||
//! Rotate all bits to the right.
|
||||
/// @see gtx_bit
|
||||
template <typename genType>
|
||||
genType bitRotateRight(genType const & In, std::size_t Shift);
|
||||
|
||||
//! Rotate all bits to the left.
|
||||
/// @see gtx_bit
|
||||
template <typename genType>
|
||||
genType bitRotateLeft(genType const & In, std::size_t Shift);
|
||||
|
||||
//! Set to 1 a range of bits.
|
||||
/// @see gtx_bit
|
||||
template <typename genIUType>
|
||||
genIUType fillBitfieldWithOne(
|
||||
genIUType const & Value,
|
||||
int const & FromBit,
|
||||
int const & ToBit);
|
||||
GLM_FUNC_DECL genIUType highestBitValue(genIUType Value);
|
||||
|
||||
//! Set to 0 a range of bits.
|
||||
/// Find the highest bit set to 1 in a integer variable and return its value.
|
||||
///
|
||||
/// @see gtx_bit
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL vecType<T, P> highestBitValue(vecType<T, P> const & value);
|
||||
|
||||
/// Return the power of two number which value is just higher the input value.
|
||||
/// Deprecated, use ceilPowerOfTwo from GTC_round instead
|
||||
///
|
||||
/// @see gtc_round
|
||||
/// @see gtx_bit
|
||||
template <typename genIUType>
|
||||
genIUType fillBitfieldWithZero(
|
||||
genIUType const & Value,
|
||||
int const & FromBit,
|
||||
int const & ToBit);
|
||||
GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoAbove(genIUType Value);
|
||||
|
||||
/// Return the power of two number which value is just higher the input value.
|
||||
/// Deprecated, use ceilPowerOfTwo from GTC_round instead
|
||||
///
|
||||
/// @see gtc_round
|
||||
/// @see gtx_bit
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_DEPRECATED GLM_FUNC_DECL vecType<T, P> powerOfTwoAbove(vecType<T, P> const & value);
|
||||
|
||||
/// Return the power of two number which value is just lower the input value.
|
||||
/// Deprecated, use floorPowerOfTwo from GTC_round instead
|
||||
///
|
||||
/// @see gtc_round
|
||||
/// @see gtx_bit
|
||||
template <typename genIUType>
|
||||
GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoBelow(genIUType Value);
|
||||
|
||||
/// Return the power of two number which value is just lower the input value.
|
||||
/// Deprecated, use floorPowerOfTwo from GTC_round instead
|
||||
///
|
||||
/// @see gtc_round
|
||||
/// @see gtx_bit
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_DEPRECATED GLM_FUNC_DECL vecType<T, P> powerOfTwoBelow(vecType<T, P> const & value);
|
||||
|
||||
/// Return the power of two number which value is the closet to the input value.
|
||||
/// Deprecated, use roundPowerOfTwo from GTC_round instead
|
||||
///
|
||||
/// @see gtc_round
|
||||
/// @see gtx_bit
|
||||
template <typename genIUType>
|
||||
GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoNearest(genIUType Value);
|
||||
|
||||
/// Return the power of two number which value is the closet to the input value.
|
||||
/// Deprecated, use roundPowerOfTwo from GTC_round instead
|
||||
///
|
||||
/// @see gtc_round
|
||||
/// @see gtx_bit
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_DEPRECATED GLM_FUNC_DECL vecType<T, P> powerOfTwoNearest(vecType<T, P> const & value);
|
||||
|
||||
/// @}
|
||||
} //namespace glm
|
||||
|
||||
|
||||
#include "bit.inl"
|
||||
|
||||
#endif//GLM_GTX_bit
|
||||
|
||||
Reference in New Issue
Block a user