diff options
Diffstat (limited to 'intern/moto')
-rw-r--r-- | intern/moto/include/GEN_Map.h | 13 | ||||
-rw-r--r-- | intern/moto/include/MT_Matrix4x4.h | 1 | ||||
-rw-r--r-- | intern/moto/include/MT_Matrix4x4.inl | 14 |
3 files changed, 21 insertions, 7 deletions
diff --git a/intern/moto/include/GEN_Map.h b/intern/moto/include/GEN_Map.h index 9f56924419e..d85e9af175b 100644 --- a/intern/moto/include/GEN_Map.h +++ b/intern/moto/include/GEN_Map.h @@ -50,6 +50,19 @@ public: m_buckets[i] = 0; } } + + GEN_Map(const GEN_Map& map) + { + m_num_buckets = map.m_num_buckets; + m_buckets = new Entry *[m_num_buckets]; + + for (int i = 0; i < m_num_buckets; ++i) { + m_buckets[i] = 0; + + for(Entry *entry = map.m_buckets[i]; entry; entry=entry->m_next) + insert(entry->m_key, entry->m_value); + } + } int size() { int count=0; diff --git a/intern/moto/include/MT_Matrix4x4.h b/intern/moto/include/MT_Matrix4x4.h index 823541347b7..b4ee84a718b 100644 --- a/intern/moto/include/MT_Matrix4x4.h +++ b/intern/moto/include/MT_Matrix4x4.h @@ -212,6 +212,7 @@ public: MT_Matrix4x4 transposed() const; void transpose(); + MT_Matrix4x4 inverse() const; void invert(); protected: diff --git a/intern/moto/include/MT_Matrix4x4.inl b/intern/moto/include/MT_Matrix4x4.inl index a2aa893a6b3..074bd6e4b05 100644 --- a/intern/moto/include/MT_Matrix4x4.inl +++ b/intern/moto/include/MT_Matrix4x4.inl @@ -52,14 +52,14 @@ GEN_INLINE void MT_Matrix4x4::invert() { } } -/* We do things slightly different here, because the invert() modifies - * the buffer itself. This makes it impossible to make this op right - * away. Like other, still missing facilities, I will repair this - * later. */ -/* GEN_INLINE T_Matrix4x4 MT_Matrix4x4::inverse() const */ -/* { */ -/* } */ +GEN_INLINE MT_Matrix4x4 MT_Matrix4x4::inverse() const +{ + MT_Matrix4x4 invmat = *this; + + invmat.invert(); + return invmat; +} GEN_INLINE MT_Matrix4x4& MT_Matrix4x4::operator*=(const MT_Matrix4x4& m) { |