mirror of
https://github.com/g-truc/glm.git
synced 2024-11-22 08:54:35 +00:00
Merge branch '0.9.0'
This commit is contained in:
commit
205a288247
@ -1,4 +1,5 @@
|
||||
#include "../../glm/glm.hpp" // glm::vec3, glm::vec4, glm::ivec4, glm::mat4
|
||||
#include <vector>
|
||||
|
||||
struct triangle
|
||||
{
|
||||
@ -17,12 +18,29 @@ void computeNormal(triangle & Triangle)
|
||||
#include "../../glm/gtc/matrix_projection.hpp" // glm::perspective
|
||||
#include "../../glm/gtc/matrix_transform.hpp" // glm::translate, glm::rotate, glm::scale
|
||||
#include "../../glm/gtc/type_ptr.hpp" // glm::value_ptr
|
||||
#include "../../glm/gtc/quaternion.hpp" // glm::quat
|
||||
#include "../../glm/gtx/comparison.hpp" // == !=
|
||||
//#include "../../glm/ext.hpp"
|
||||
|
||||
glm::vec4 const ClearColor = glm::vec4(glm::vec3(0.0f), 1.0f);
|
||||
glm::ivec4 const Viewport = glm::ivec4(0, 0, 640, 480);
|
||||
|
||||
void glUniformMatrix4fv(int location, int count, bool transpose, const float * value);
|
||||
|
||||
void ticket0023()
|
||||
{
|
||||
std::vector<int> vals;
|
||||
vals.push_back(1);
|
||||
vals.push_back(2);
|
||||
vals.push_back(3);
|
||||
std::vector<int>::iterator it1, it2;
|
||||
it1 = vals.begin();
|
||||
it2 = vals.end();
|
||||
it1 != it2; // <-- Here
|
||||
glm::vec3 c;
|
||||
glm::quat q;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
//triangle Triangle;
|
||||
@ -38,5 +56,7 @@ int main()
|
||||
glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f));
|
||||
glm::mat4 MVP = Projection * View * Model;
|
||||
|
||||
glUniformMatrix4fv(LocationMVP, 1, GL_FALSE, glm::value_ptr(MVP));
|
||||
//glUniformMatrix4fv(LocationMVP, 1, GL_FALSE, glm::value_ptr(MVP));
|
||||
|
||||
ticket0023();
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i >= size_type(0) && i < col_size());
|
||||
assert(i < col_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ namespace glm
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i >= size_type(0) && i < value_size());
|
||||
assert(i < value_size());
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ namespace glm
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i >= size_type(0) && i < value_size());
|
||||
assert(i < value_size());
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace glm
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i >= size_type(0) && i < value_size());
|
||||
assert(i < value_size());
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ namespace glm
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i >= size_type(0) && i < value_size());
|
||||
assert(i < value_size());
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace glm
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i >= size_type(0) && i < value_size());
|
||||
assert(i < value_size());
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ namespace glm
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i >= size_type(0) && i < value_size());
|
||||
assert(i < value_size());
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace glm
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i >= size_type(0) && i < value_size());
|
||||
assert(i < value_size());
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ namespace glm
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i >= size_type(0) && i < value_size());
|
||||
assert(i < value_size());
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_gtc_swizzle
|
||||
#define glm_gtc_closest_point
|
||||
#define glm_gtc_swizzle
|
||||
|
||||
// Dependency:
|
||||
#include "../glm.hpp"
|
||||
@ -26,7 +26,25 @@ namespace glm
|
||||
//! GLM_GTC_swizzle extension
|
||||
namespace swizzle{
|
||||
|
||||
template <typename T>
|
||||
T swizzle(
|
||||
detail::tvec4<T> const & v,
|
||||
comp x);
|
||||
|
||||
template <typename T>
|
||||
detail::tvec2<T> swizzle(
|
||||
detail::tvec4<T> const & v,
|
||||
comp x, comp y);
|
||||
|
||||
template <typename T>
|
||||
detail::tvec3<T> swizzle(
|
||||
detail::tvec4<T> const & v,
|
||||
comp x, comp y, comp z);
|
||||
|
||||
template <typename T>
|
||||
inline detail::tref4<T> swizzle(
|
||||
detail::tvec4<T> const & v,
|
||||
comp x, comp y, comp z, comp w);
|
||||
|
||||
}//namespace swizzle
|
||||
}//namespace gtc
|
||||
|
@ -28,13 +28,45 @@ namespace glm
|
||||
|
||||
//! Define == operator for vectors
|
||||
//! From GLM_GTX_comparison extension.
|
||||
template <typename vecType>
|
||||
bool operator== (vecType const & x, vecType const & y);
|
||||
template <typename T>
|
||||
bool operator== (
|
||||
detail::tvec2<T> const & x,
|
||||
detail::tvec2<T> const & y);
|
||||
|
||||
//! Define == operator for vectors
|
||||
//! From GLM_GTX_comparison extension.
|
||||
template <typename T>
|
||||
bool operator== (
|
||||
detail::tvec3<T> const & x,
|
||||
detail::tvec3<T> const & y);
|
||||
|
||||
//! Define == operator for vectors
|
||||
//! From GLM_GTX_comparison extension.
|
||||
template <typename T>
|
||||
bool operator== (
|
||||
detail::tvec4<T> const & x,
|
||||
detail::tvec4<T> const & y);
|
||||
|
||||
//! Define != operator for vectors
|
||||
//! From GLM_GTX_comparison extension.
|
||||
template <typename vecType>
|
||||
bool operator!= (vecType const & x, vecType const & y);
|
||||
template <typename T>
|
||||
bool operator!= (
|
||||
detail::tvec2<T> const & x,
|
||||
detail::tvec2<T> const & y);
|
||||
|
||||
//! Define != operator for vectors
|
||||
//! From GLM_GTX_comparison extension.
|
||||
template <typename T>
|
||||
bool operator!= (
|
||||
detail::tvec3<T> const & x,
|
||||
detail::tvec3<T> const & y);
|
||||
|
||||
//! Define != operator for vectors
|
||||
//! From GLM_GTX_comparison extension.
|
||||
template <typename T>
|
||||
bool operator!= (
|
||||
detail::tvec4<T> const & x,
|
||||
detail::tvec4<T> const & y);
|
||||
|
||||
}//namespace comparison
|
||||
}//namespace gtx
|
||||
|
39
glm/gtx/int_10_10_10_2.hpp
Normal file
39
glm/gtx/int_10_10_10_2.hpp
Normal file
@ -0,0 +1,39 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net)
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Created : 2010-07-07
|
||||
// Updated : 2010-07-07
|
||||
// Licence : This source is under MIT License
|
||||
// File : glm/gtx/int_10_10_10_2.hpp
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Dependency:
|
||||
// - GLM core
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef glm_gtx_int_10_10_10_2
|
||||
#define glm_gtx_int_10_10_10_2
|
||||
|
||||
// Dependency:
|
||||
#include "../glm.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
namespace gtx{
|
||||
//! GLM_GTX_int_10_10_10_2 extension: Add support for integer for core functions
|
||||
namespace int_10_10_10_2
|
||||
{
|
||||
//! From GLM_GTX_int_10_10_10_2 extension.
|
||||
int int10_10_10_2_cast(glm::vec4 const & v);
|
||||
|
||||
//! From GLM_GTX_int_10_10_10_2 extension.
|
||||
uint uint10_10_10_2_cast(glm::vec4 const & v);
|
||||
|
||||
}//namespace integer
|
||||
}//namespace gtx
|
||||
}//namespace glm
|
||||
|
||||
#include "int_10_10_10_2.inl"
|
||||
|
||||
namespace glm{using namespace gtx::int_10_10_10_2;}
|
||||
|
||||
#endif//glm_gtx_int_10_10_10_2
|
28
glm/gtx/int_10_10_10_2.inl
Normal file
28
glm/gtx/int_10_10_10_2.inl
Normal file
@ -0,0 +1,28 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net)
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Created : 2010-07-07
|
||||
// Updated : 2010-07-07
|
||||
// Licence : This source is under MIT License
|
||||
// File : glm/gtx/int_10_10_10_2.inl
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm{
|
||||
namespace gtx{
|
||||
namespace int_10_10_10_2
|
||||
{
|
||||
//! From GLM_GTX_int_10_10_10_2 extension.
|
||||
int int10_10_10_2_cast(glm::vec4 const & v)
|
||||
{
|
||||
return int(v.x * 2047.f) << 0 | int(v.y * 2047.f) << 10 | int(v.z * 2047.f) << 20 | int(v.w * 3.f) << 30;
|
||||
}
|
||||
|
||||
//! From GLM_GTX_int_10_10_10_2 extension.
|
||||
uint uint10_10_10_2_cast(glm::vec4 const & v)
|
||||
{
|
||||
return uint(v.x * 2047.f) << 0 | uint(v.y * 2047.f) << 10 | uint(v.z * 2047.f) << 20 | uint(v.w * 3.f) << 30;
|
||||
}
|
||||
|
||||
}//namespace int_10_10_10_2
|
||||
}//namespace gtx
|
||||
}//namespace glm
|
Loading…
Reference in New Issue
Block a user