summaryrefslogtreecommitdiffstats
path: root/Common/interface
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-06-15 03:04:44 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-06-15 03:04:44 +0000
commit2ce1ebb226769ff4ec9e28efbacb12ea81035d62 (patch)
treeb73c69b73152fa03e41323f6ce2dcffee227dc91 /Common/interface
parentMathlib: added double2, double3, and double4 typedefs (diff)
downloadDiligentCore-2ce1ebb226769ff4ec9e28efbacb12ea81035d62.tar.gz
DiligentCore-2ce1ebb226769ff4ec9e28efbacb12ea81035d62.zip
Mat lib: added floor & ceil vector operations
Diffstat (limited to 'Common/interface')
-rw-r--r--Common/interface/BasicMath.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/Common/interface/BasicMath.h b/Common/interface/BasicMath.h
index 29f67d7f..e41e6f9f 100644
--- a/Common/interface/BasicMath.h
+++ b/Common/interface/BasicMath.h
@@ -1802,6 +1802,68 @@ namespace std
template<typename T>
+ Diligent::Vector2<T> floor( const Diligent::Vector2<T>& vec )
+ {
+ return Diligent::Vector2<T>(
+ std::floor( vec.x ),
+ std::floor( vec.y )
+ );
+ }
+
+ template<typename T>
+ Diligent::Vector3<T> floor( const Diligent::Vector3<T>& vec )
+ {
+ return Diligent::Vector3<T>(
+ std::floor( vec.x ),
+ std::floor( vec.y ),
+ std::floor( vec.z )
+ );
+ }
+
+ template<typename T>
+ Diligent::Vector4<T> floor( const Diligent::Vector4<T>& vec )
+ {
+ return Diligent::Vector4<T>(
+ std::floor( vec.x ),
+ std::floor( vec.y ),
+ std::floor( vec.z ),
+ std::floor( vec.w )
+ );
+ }
+
+
+ template<typename T>
+ Diligent::Vector2<T> ceil( const Diligent::Vector2<T>& vec )
+ {
+ return Diligent::Vector2<T>(
+ std::ceil( vec.x ),
+ std::ceil( vec.y )
+ );
+ }
+
+ template<typename T>
+ Diligent::Vector3<T> ceil( const Diligent::Vector3<T>& vec )
+ {
+ return Diligent::Vector3<T>(
+ std::ceil( vec.x ),
+ std::ceil( vec.y ),
+ std::ceil( vec.z )
+ );
+ }
+
+ template<typename T>
+ Diligent::Vector4<T> ceil( const Diligent::Vector4<T>& vec )
+ {
+ return Diligent::Vector4<T>(
+ std::ceil( vec.x ),
+ std::ceil( vec.y ),
+ std::ceil( vec.z ),
+ std::ceil( vec.w )
+ );
+ }
+
+
+ template<typename T>
struct hash<Diligent::Vector2<T>>
{
size_t operator()( const Diligent::Vector2<T> &v2 ) const