Browse Source

Further cleanup of the Container & Math library API & internal functions.

Lasse Öörni 14 years ago
parent
commit
5f7b64d6e7

+ 9 - 9
Engine/Container/List.h

@@ -115,18 +115,18 @@ public:
     List() :
     List() :
         ListBase()
         ListBase()
     {
     {
-        // Allocate the tail node
+        // Reserve the tail node
         allocator_ = AllocatorInitialize(sizeof(Node));
         allocator_ = AllocatorInitialize(sizeof(Node));
-        head_ = tail_ = AllocateNode();
+        head_ = tail_ = ReserveNode();
     }
     }
     
     
     /// Construct from another list
     /// Construct from another list
     List(const List<T>& list) :
     List(const List<T>& list) :
         ListBase()
         ListBase()
     {
     {
-        // Allocate the tail node
+        // Reserve the tail node
         allocator_ = AllocatorInitialize(sizeof(Node));
         allocator_ = AllocatorInitialize(sizeof(Node));
-        head_ = tail_ = AllocateNode();
+        head_ = tail_ = ReserveNode();
         
         
         // Then assign the other list
         // Then assign the other list
         *this = list;
         *this = list;
@@ -282,7 +282,7 @@ private:
         if (!dest)
         if (!dest)
             return;
             return;
         
         
-        Node* newNode = AllocateNode(value);
+        Node* newNode = ReserveNode(value);
         Node* prev = dest->GetPrev();
         Node* prev = dest->GetPrev();
         newNode->next_ = dest;
         newNode->next_ = dest;
         newNode->prev_ = prev;
         newNode->prev_ = prev;
@@ -321,16 +321,16 @@ private:
         return next;
         return next;
     }
     }
     
     
-    /// Allocate a node
-    Node* AllocateNode()
+    /// Reserve a node
+    Node* ReserveNode()
     {
     {
         Node* newNode = static_cast<Node*>(AllocatorReserve(allocator_));
         Node* newNode = static_cast<Node*>(AllocatorReserve(allocator_));
         new(newNode) Node();
         new(newNode) Node();
         return newNode;
         return newNode;
     }
     }
     
     
-    /// Allocate a node with initial value
-    Node* AllocateNode(const T& value)
+    /// Reserve a node with initial value
+    Node* ReserveNode(const T& value)
     {
     {
         Node* newNode = static_cast<Node*>(AllocatorReserve(allocator_));
         Node* newNode = static_cast<Node*>(AllocatorReserve(allocator_));
         new(newNode) Node(value);
         new(newNode) Node(value);

+ 33 - 33
Engine/Container/Map.h

@@ -68,18 +68,18 @@ public:
     /// Map node
     /// Map node
     struct Node : public TreeNodeBase
     struct Node : public TreeNodeBase
     {
     {
-        // Construct undefined
+        /// Construct undefined
         Node()
         Node()
         {
         {
         }
         }
         
         
-        // Construct with key
+        /// Construct with key
         Node(const T& key) :
         Node(const T& key) :
             pair_(key)
             pair_(key)
         {
         {
         }
         }
         
         
-        // Construct with key and value
+        /// Construct with key and value
         Node(const T& key, const U& value) :
         Node(const T& key, const U& value) :
             pair_(key, value)
             pair_(key, value)
         {
         {
@@ -89,9 +89,9 @@ public:
         KeyValue pair_;
         KeyValue pair_;
         
         
         /// Return parent node
         /// Return parent node
-        Node* GetParent() const { return static_cast<Node*>(parent_); }
+        Node* Parent() const { return static_cast<Node*>(parent_); }
         /// Return the left or right child
         /// Return the left or right child
-        Node* GetChild(unsigned dir) const { return static_cast<Node*>(link_[dir]); }
+        Node* Child(unsigned dir) const { return static_cast<Node*>(link_[dir]); }
     };
     };
     
     
     /// Map node iterator
     /// Map node iterator
@@ -123,13 +123,13 @@ public:
     class ConstIterator : public TreeIteratorBase
     class ConstIterator : public TreeIteratorBase
     {
     {
     public:
     public:
-        // Construct
+        /// Construct
         ConstIterator(Node* ptr) :
         ConstIterator(Node* ptr) :
             TreeIteratorBase(ptr)
             TreeIteratorBase(ptr)
         {
         {
         }
         }
         
         
-        // Construct from a non-const iterator
+        /// Construct from a non-const iterator
         ConstIterator(const Iterator& it) :
         ConstIterator(const Iterator& it) :
             TreeIteratorBase(it.ptr_)
             TreeIteratorBase(it.ptr_)
         {
         {
@@ -157,7 +157,7 @@ public:
     {
     {
     }
     }
     
     
-    /// Construct with another map
+    /// Construct from another map
     Map(const Map<T, U>& map)
     Map(const Map<T, U>& map)
     {
     {
         allocator_ = AllocatorInitialize(sizeof(Node), map.Size());
         allocator_ = AllocatorInitialize(sizeof(Node), map.Size());
@@ -248,7 +248,7 @@ public:
     /// Clear the map
     /// Clear the map
     void Clear()
     void Clear()
     {
     {
-        Node* root = GetRoot();
+        Node* root = Root();
         if (!root)
         if (!root)
             return;
             return;
         EraseNodes(root);
         EraseNodes(root);
@@ -329,36 +329,36 @@ public:
     
     
 private:
 private:
     /// Return the root pointer with correct type
     /// Return the root pointer with correct type
-    Node* GetRoot() const { return reinterpret_cast<Node*>(root_); }
+    Node* Root() const { return reinterpret_cast<Node*>(root_); }
     
     
     /// Find the node with smallest key
     /// Find the node with smallest key
     Node* FindFirst() const
     Node* FindFirst() const
     {
     {
-        Node* node = GetRoot();
+        Node* node = Root();
         while ((node) && (node->link_[0]))
         while ((node) && (node->link_[0]))
-            node = node->GetChild(0);
+            node = node->Child(0);
         return node;
         return node;
     }
     }
     
     
     /// Find the node with largest key
     /// Find the node with largest key
     Node* FindLast() const
     Node* FindLast() const
     {
     {
-        Node* node = GetRoot();
+        Node* node = Root();
         while ((node) && (node->link_[1]))
         while ((node) && (node->link_[1]))
-            node = node->GetChild(1);
+            node = node->Child(1);
         return node;
         return node;
     }
     }
     
     
     /// Find a node with key. Return null if not found
     /// Find a node with key. Return null if not found
     Node* FindNode(const T& key) const
     Node* FindNode(const T& key) const
     {
     {
-        Node* node = GetRoot();
+        Node* node = Root();
         while (node)
         while (node)
         {
         {
             if (node->pair_.first_ == key)
             if (node->pair_.first_ == key)
                 return node;
                 return node;
             else
             else
-                node = node->GetChild(node->pair_.first_ < key);
+                node = node->Child(node->pair_.first_ < key);
         }
         }
         return 0;
         return 0;
     }
     }
@@ -383,8 +383,8 @@ private:
             
             
             t = &head;
             t = &head;
             g = p = 0;
             g = p = 0;
-            q = GetRoot();
-            t->SetChild(1, GetRoot());
+            q = Root();
+            t->SetChild(1, Root());
             
             
             for (;;)
             for (;;)
             {
             {
@@ -423,10 +423,10 @@ private:
                     t = g;
                     t = g;
                 g = p;
                 g = p;
                 p = q;
                 p = q;
-                q = q->GetChild(dir);
+                q = q->Child(dir);
             }
             }
             
             
-            root_ = head.GetChild(1);
+            root_ = head.Child(1);
         }
         }
         
         
         root_->isRed_ = false;
         root_->isRed_ = false;
@@ -449,14 +449,14 @@ private:
         
         
         q = &head;
         q = &head;
         g = p = 0;
         g = p = 0;
-        q->SetChild(1, GetRoot());
+        q->SetChild(1, Root());
         
         
         while (q->link_[dir])
         while (q->link_[dir])
         {
         {
             unsigned last = dir;
             unsigned last = dir;
             g = p;
             g = p;
             p = q;
             p = q;
-            q = q->GetChild(dir);
+            q = q->Child(dir);
             dir = q->pair_.first_ < key;
             dir = q->pair_.first_ < key;
             
             
             if (q->pair_.first_ == key)
             if (q->pair_.first_ == key)
@@ -467,11 +467,11 @@ private:
                 if (IsRed(q->link_[!dir]))
                 if (IsRed(q->link_[!dir]))
                 {
                 {
                     p->SetChild(last, RotateSingle(q, dir));
                     p->SetChild(last, RotateSingle(q, dir));
-                    p = p->GetChild(last);
+                    p = p->Child(last);
                 }
                 }
                 else if (!IsRed(q->link_[!dir]))
                 else if (!IsRed(q->link_[!dir]))
                 {
                 {
-                    Node* s = p->GetChild(!last);
+                    Node* s = p->Child(!last);
                     
                     
                     if (s)
                     if (s)
                     {
                     {
@@ -489,7 +489,7 @@ private:
                             else if (IsRed(s->link_[!last]))
                             else if (IsRed(s->link_[!last]))
                                 g->SetChild(dir2, RotateSingle(p, last));
                                 g->SetChild(dir2, RotateSingle(p, last));
                             
                             
-                            Node* t = g->GetChild(dir2);
+                            Node* t = g->Child(dir2);
                             q->isRed_ = t->isRed_ = true;
                             q->isRed_ = t->isRed_ = true;
                             t->link_[0]->isRed_ = false;
                             t->link_[0]->isRed_ = false;
                             t->link_[1]->isRed_ = false;
                             t->link_[1]->isRed_ = false;
@@ -503,13 +503,13 @@ private:
         {
         {
             const_cast<T&>(f->pair_.first_) = q->pair_.first_;
             const_cast<T&>(f->pair_.first_) = q->pair_.first_;
             f->pair_.second_ = q->pair_.second_;
             f->pair_.second_ = q->pair_.second_;
-            p->SetChild(p->GetChild(1) == q, q->link_[q->GetChild(0) == 0]);
+            p->SetChild(p->Child(1) == q, q->link_[q->Child(0) == 0]);
             delete q;
             delete q;
             --size_;
             --size_;
             removed = true;
             removed = true;
         }
         }
         
         
-        root_ = head.GetChild(1);
+        root_ = head.Child(1);
         if (root_)
         if (root_)
         {
         {
             root_->isRed_ = false;
             root_->isRed_ = false;
@@ -522,8 +522,8 @@ private:
     /// Erase the nodes recursively
     /// Erase the nodes recursively
     void EraseNodes(Node* node)
     void EraseNodes(Node* node)
     {
     {
-        Node* left = node->GetChild(0);
-        Node* right = node->GetChild(1);
+        Node* left = node->Child(0);
+        Node* right = node->Child(1);
         delete node;
         delete node;
         --size_;
         --size_;
         
         
@@ -533,8 +533,8 @@ private:
             EraseNodes(right);
             EraseNodes(right);
     }
     }
     
     
-    /// Allocate a node
-    Node* AllocateNode()
+    /// Reserve a node
+    Node* ReserveNode()
     {
     {
         if (!allocator_)
         if (!allocator_)
             allocator_ = AllocatorInitialize(sizeof(Node));
             allocator_ = AllocatorInitialize(sizeof(Node));
@@ -543,8 +543,8 @@ private:
         return newNode;
         return newNode;
     }
     }
     
     
-    /// Allocate a node with specified key and value
-    Node* AllocateNode(const T& key, const U& value)
+    /// Reserve a node with specified key and value
+    Node* ReserveNode(const T& key, const U& value)
     {
     {
         if (!allocator_)
         if (!allocator_)
             allocator_ = AllocatorInitialize(sizeof(Node));
             allocator_ = AllocatorInitialize(sizeof(Node));

+ 29 - 29
Engine/Container/Set.h

@@ -50,9 +50,9 @@ public:
         T key_;
         T key_;
         
         
         /// Return parent node
         /// Return parent node
-        Node* GetParent() const { return static_cast<Node*>(parent_); }
+        Node* Parent() const { return static_cast<Node*>(parent_); }
         /// Return the left or right child
         /// Return the left or right child
-        Node* GetChild(unsigned dir) const { return static_cast<Node*>(link_[dir]); }
+        Node* Child(unsigned dir) const { return static_cast<Node*>(link_[dir]); }
     };
     };
     
     
     /// Set node iterator
     /// Set node iterator
@@ -118,7 +118,7 @@ public:
     {
     {
     }
     }
     
     
-    /// Construct with another set
+    /// Construct from another set
     Set(const Set<T>& set)
     Set(const Set<T>& set)
     {
     {
         allocator_ = AllocatorInitialize(sizeof(Node), set.Size());
         allocator_ = AllocatorInitialize(sizeof(Node), set.Size());
@@ -196,7 +196,7 @@ public:
     /// Clear the set
     /// Clear the set
     void Clear()
     void Clear()
     {
     {
-        Node* root = GetRoot();
+        Node* root = Root();
         if (!root)
         if (!root)
             return;
             return;
         EraseNodes(root);
         EraseNodes(root);
@@ -270,36 +270,36 @@ public:
     
     
 private:
 private:
     /// Return the root pointer with correct type
     /// Return the root pointer with correct type
-    Node* GetRoot() const { return reinterpret_cast<Node*>(root_); }
+    Node* Root() const { return reinterpret_cast<Node*>(root_); }
     
     
     /// Find the node with smallest key
     /// Find the node with smallest key
     Node* FindFirst() const
     Node* FindFirst() const
     {
     {
-        Node* node = GetRoot();
+        Node* node = Root();
         while ((node) && (node->link_[0]))
         while ((node) && (node->link_[0]))
-            node = node->GetChild(0);
+            node = node->Child(0);
         return node;
         return node;
     }
     }
     
     
     /// Find the node with largest key
     /// Find the node with largest key
     Node* FindLast() const
     Node* FindLast() const
     {
     {
-        Node* node = GetRoot();
+        Node* node = Root();
         while ((node) && (node->link_[1]))
         while ((node) && (node->link_[1]))
-            node = node->GetChild(1);
+            node = node->Child(1);
         return node;
         return node;
     }
     }
     
     
     /// Find a node with key. Return null if not found
     /// Find a node with key. Return null if not found
     Node* FindNode(const T& key) const
     Node* FindNode(const T& key) const
     {
     {
-        Node* node = GetRoot();
+        Node* node = Root();
         while (node)
         while (node)
         {
         {
             if (node->key_ == key)
             if (node->key_ == key)
                 return node;
                 return node;
             else
             else
-                node = node->GetChild(node->key_ < key);
+                node = node->Child(node->key_ < key);
         }
         }
         return 0;
         return 0;
     }
     }
@@ -311,7 +311,7 @@ private:
         
         
         if (!root_)
         if (!root_)
         {
         {
-            root_ = ret = AllocateNode(key);
+            root_ = ret = ReserveNode(key);
             ++size_;
             ++size_;
         }
         }
         else
         else
@@ -324,14 +324,14 @@ private:
             
             
             t = &head;
             t = &head;
             g = p = 0;
             g = p = 0;
-            q = GetRoot();
-            t->SetChild(1, GetRoot());
+            q = Root();
+            t->SetChild(1, Root());
             
             
             for (;;)
             for (;;)
             {
             {
                 if (!q)
                 if (!q)
                 {
                 {
-                    p->SetChild(dir, q = ret = AllocateNode(key));
+                    p->SetChild(dir, q = ret = ReserveNode(key));
                     ++size_;
                     ++size_;
                 }
                 }
                 else if ((IsRed(q->link_[0])) && (IsRed(q->link_[1])))
                 else if ((IsRed(q->link_[0])) && (IsRed(q->link_[1])))
@@ -363,10 +363,10 @@ private:
                     t = g;
                     t = g;
                 g = p;
                 g = p;
                 p = q;
                 p = q;
-                q = q->GetChild(dir);
+                q = q->Child(dir);
             }
             }
             
             
-            root_ = head.GetChild(1);
+            root_ = head.Child(1);
         }
         }
         
         
         root_->isRed_ = false;
         root_->isRed_ = false;
@@ -389,14 +389,14 @@ private:
         
         
         q = &head;
         q = &head;
         g = p = 0;
         g = p = 0;
-        q->SetChild(1, GetRoot());
+        q->SetChild(1, Root());
         
         
         while (q->link_[dir])
         while (q->link_[dir])
         {
         {
             unsigned last = dir;
             unsigned last = dir;
             g = p;
             g = p;
             p = q;
             p = q;
-            q = q->GetChild(dir);
+            q = q->Child(dir);
             dir = q->key_ < key;
             dir = q->key_ < key;
             
             
             if (q->key_ == key)
             if (q->key_ == key)
@@ -407,11 +407,11 @@ private:
                 if (IsRed(q->link_[!dir]))
                 if (IsRed(q->link_[!dir]))
                 {
                 {
                     p->SetChild(last, RotateSingle(q, dir));
                     p->SetChild(last, RotateSingle(q, dir));
-                    p = p->GetChild(last);
+                    p = p->Child(last);
                 }
                 }
                 else if (!IsRed(q->link_[!dir]))
                 else if (!IsRed(q->link_[!dir]))
                 {
                 {
-                    Node* s = p->GetChild(!last);
+                    Node* s = p->Child(!last);
                     
                     
                     if (s)
                     if (s)
                     {
                     {
@@ -429,7 +429,7 @@ private:
                             else if (IsRed(s->link_[!last]))
                             else if (IsRed(s->link_[!last]))
                                 g->SetChild(dir2, RotateSingle(p, last));
                                 g->SetChild(dir2, RotateSingle(p, last));
                             
                             
-                            Node* t = g->GetChild(dir2);
+                            Node* t = g->Child(dir2);
                             q->isRed_ = t->isRed_ = true;
                             q->isRed_ = t->isRed_ = true;
                             t->link_[0]->isRed_ = false;
                             t->link_[0]->isRed_ = false;
                             t->link_[1]->isRed_ = false;
                             t->link_[1]->isRed_ = false;
@@ -448,7 +448,7 @@ private:
             removed = true;
             removed = true;
         }
         }
         
         
-        root_ = head.GetChild(1);
+        root_ = head.Child(1);
         if (root_)
         if (root_)
         {
         {
             root_->isRed_ = false;
             root_->isRed_ = false;
@@ -461,8 +461,8 @@ private:
     /// Erase the nodes recursively
     /// Erase the nodes recursively
     void EraseNodes(Node* node)
     void EraseNodes(Node* node)
     {
     {
-        Node* left = node->GetChild(0);
-        Node* right = node->GetChild(1);
+        Node* left = node->Child(0);
+        Node* right = node->Child(1);
         FreeNode(node);
         FreeNode(node);
         --size_;
         --size_;
         
         
@@ -472,8 +472,8 @@ private:
             EraseNodes(right);
             EraseNodes(right);
     }
     }
     
     
-    /// Allocate a node
-    Node* AllocateNode()
+    /// Reserve a node
+    Node* ReserveNode()
     {
     {
         if (!allocator_)
         if (!allocator_)
             allocator_ = AllocatorInitialize(sizeof(Node));
             allocator_ = AllocatorInitialize(sizeof(Node));
@@ -483,8 +483,8 @@ private:
         return newNode;
         return newNode;
     }
     }
     
     
-    /// Allocate a node with specified key
-    Node* AllocateNode(const T& key)
+    /// Reserve a node with specified key
+    Node* ReserveNode(const T& key)
     {
     {
         if (!allocator_)
         if (!allocator_)
             allocator_ = AllocatorInitialize(sizeof(Node));
             allocator_ = AllocatorInitialize(sizeof(Node));

+ 54 - 54
Engine/Container/Vector.h

@@ -63,7 +63,7 @@ public:
     Vector<T>& operator = (const Vector<T>& rhs)
     Vector<T>& operator = (const Vector<T>& rhs)
     {
     {
         Clear();
         Clear();
-        Resize(rhs.size_, rhs.GetBuffer());
+        Resize(rhs.size_, rhs.Buffer());
         
         
         return *this;
         return *this;
     }
     }
@@ -106,8 +106,8 @@ public:
         if (rhs.size_ != size_)
         if (rhs.size_ != size_)
             return false;
             return false;
         
         
-        T* buffer = GetBuffer();
-        T* rhsBuffer = rhs.GetBuffer();
+        T* buffer = Buffer();
+        T* rhsBuffer = rhs.Buffer();
         for (unsigned i = 0; i < size_; ++i)
         for (unsigned i = 0; i < size_; ++i)
         {
         {
             if (buffer[i] != rhsBuffer[i])
             if (buffer[i] != rhsBuffer[i])
@@ -123,8 +123,8 @@ public:
         if (rhs.size_ != size_)
         if (rhs.size_ != size_)
             return true;
             return true;
         
         
-        T* buffer = GetBuffer();
-        T* rhsBuffer = rhs.GetBuffer();
+        T* buffer = Buffer();
+        T* rhsBuffer = rhs.Buffer();
         for (unsigned i = 0; i < size_; ++i)
         for (unsigned i = 0; i < size_; ++i)
         {
         {
             if (buffer[i] != rhsBuffer[i])
             if (buffer[i] != rhsBuffer[i])
@@ -135,13 +135,13 @@ public:
     }
     }
     
     
     /// Return element at index
     /// Return element at index
-    T& operator [] (unsigned index) { return GetBuffer()[index]; }
+    T& operator [] (unsigned index) { return Buffer()[index]; }
     /// Return const element at index
     /// Return const element at index
-    const T& operator [] (unsigned index) const { return GetBuffer()[index]; }
+    const T& operator [] (unsigned index) const { return Buffer()[index]; }
     /// Return element at index
     /// Return element at index
-    T& At(unsigned index) { return GetBuffer()[index]; }
+    T& At(unsigned index) { return Buffer()[index]; }
     /// Return const element at index
     /// Return const element at index
-    const T& At(unsigned index) const { return GetBuffer()[index]; }
+    const T& At(unsigned index) const { return Buffer()[index]; }
 
 
     /// Add an element at the end
     /// Add an element at the end
     void Push(const T& value)
     void Push(const T& value)
@@ -152,7 +152,7 @@ public:
     /// Add another vector at the end
     /// Add another vector at the end
     void Push(const Vector<T>& vector)
     void Push(const Vector<T>& vector)
     {
     {
-        Resize(size_ + vector.size_, vector.GetBuffer());
+        Resize(size_ + vector.size_, vector.Buffer());
     }
     }
     
     
     /// Remove the last element
     /// Remove the last element
@@ -171,7 +171,7 @@ public:
         unsigned oldSize = size_;
         unsigned oldSize = size_;
         Resize(size_ + 1, 0);
         Resize(size_ + 1, 0);
         MoveRange(pos + 1, pos, oldSize - pos);
         MoveRange(pos + 1, pos, oldSize - pos);
-        GetBuffer()[pos] = value;
+        Buffer()[pos] = value;
     }
     }
     
     
     /// Insert another vector at position
     /// Insert another vector at position
@@ -183,7 +183,7 @@ public:
         unsigned oldSize = size_;
         unsigned oldSize = size_;
         Resize(size_ + vector.size_, 0);
         Resize(size_ + vector.size_, 0);
         MoveRange(pos + vector.size_, pos, oldSize - pos);
         MoveRange(pos + vector.size_, pos, oldSize - pos);
-        CopyElements(GetBuffer() + pos, vector.GetBuffer(), vector.size_);
+        CopyElements(Buffer() + pos, vector.Buffer(), vector.size_);
     }
     }
     
     
     /// Insert an element using an iterator
     /// Insert an element using an iterator
@@ -218,7 +218,7 @@ public:
         Resize(size_ + length, 0);
         Resize(size_ + length, 0);
         MoveRange(pos + length, pos, size_ - pos - length);
         MoveRange(pos + length, pos, size_ - pos - length);
         
         
-        T* destPtr = GetBuffer() + pos;
+        T* destPtr = Buffer() + pos;
         for (Iterator i = start; i != end; ++i)
         for (Iterator i = start; i != end; ++i)
             *destPtr++ = *i;
             *destPtr++ = *i;
         
         
@@ -286,11 +286,11 @@ public:
             {
             {
                 newBuffer = reinterpret_cast<T*>(new unsigned char[capacity_ * sizeof(T)]);
                 newBuffer = reinterpret_cast<T*>(new unsigned char[capacity_ * sizeof(T)]);
                 // Move the data into the new buffer
                 // Move the data into the new buffer
-                ConstructElements(newBuffer, GetBuffer(), size_);
+                ConstructElements(newBuffer, Buffer(), size_);
             }
             }
             
             
             // Delete the old buffer
             // Delete the old buffer
-            DestructElements(GetBuffer(), size_);
+            DestructElements(Buffer(), size_);
             delete[] buffer_;
             delete[] buffer_;
             buffer_ = reinterpret_cast<unsigned char*>(newBuffer);
             buffer_ = reinterpret_cast<unsigned char*>(newBuffer);
         }
         }
@@ -303,21 +303,21 @@ public:
     }
     }
     
     
     /// Return iterator to the beginning
     /// Return iterator to the beginning
-    Iterator Begin() { return Iterator(GetBuffer()); }
+    Iterator Begin() { return Iterator(Buffer()); }
     /// Return const iterator to the beginning
     /// Return const iterator to the beginning
-    ConstIterator Begin() const { return ConstIterator(GetBuffer()); }
+    ConstIterator Begin() const { return ConstIterator(Buffer()); }
     /// Return iterator to the end
     /// Return iterator to the end
-    Iterator End() { return Iterator(GetBuffer() + size_); }
+    Iterator End() { return Iterator(Buffer() + size_); }
     /// Return const iterator to the end
     /// Return const iterator to the end
-    ConstIterator End() const { return ConstIterator(GetBuffer() + size_); }
+    ConstIterator End() const { return ConstIterator(Buffer() + size_); }
     /// Return first element
     /// Return first element
-    T& Front() { return GetBuffer()[0]; }
+    T& Front() { return Buffer()[0]; }
     /// Return const first element
     /// Return const first element
-    const T& Front() const { return GetBuffer()[0]; }
+    const T& Front() const { return Buffer()[0]; }
     /// Return last element
     /// Return last element
-    T& Back() { return GetBuffer()[size_ - 1]; }
+    T& Back() { return Buffer()[size_ - 1]; }
     /// Return const last element
     /// Return const last element
-    const T& Back() const { return GetBuffer()[size_ - 1]; }
+    const T& Back() const { return Buffer()[size_ - 1]; }
     /// Return size of vector
     /// Return size of vector
     unsigned Size() const { return size_; }
     unsigned Size() const { return size_; }
     /// Return capacity of vector
     /// Return capacity of vector
@@ -328,14 +328,14 @@ public:
     
     
 private:
 private:
     /// Return the buffer with right type
     /// Return the buffer with right type
-    T* GetBuffer() const { return reinterpret_cast<T*>(buffer_); }
+    T* Buffer() const { return reinterpret_cast<T*>(buffer_); }
     
     
    /// Resize the vector and create/remove new elements as necessary
    /// Resize the vector and create/remove new elements as necessary
     void Resize(unsigned newSize, const T* src)
     void Resize(unsigned newSize, const T* src)
     {
     {
         // If size shrinks, destruct the removed elements
         // If size shrinks, destruct the removed elements
         if (newSize < size_)
         if (newSize < size_)
-            DestructElements(GetBuffer() + newSize, size_ - newSize);
+            DestructElements(Buffer() + newSize, size_ - newSize);
         else
         else
         {
         {
             // Allocate new buffer if necessary and copy the current elements
             // Allocate new buffer if necessary and copy the current elements
@@ -352,15 +352,15 @@ private:
                 unsigned char* newBuffer = new unsigned char[capacity_ * sizeof(T)];
                 unsigned char* newBuffer = new unsigned char[capacity_ * sizeof(T)];
                 if (buffer_)
                 if (buffer_)
                 {
                 {
-                    ConstructElements(reinterpret_cast<T*>(newBuffer), GetBuffer(), size_);
-                    DestructElements(GetBuffer(), size_);
+                    ConstructElements(reinterpret_cast<T*>(newBuffer), Buffer(), size_);
+                    DestructElements(Buffer(), size_);
                     delete[] buffer_;
                     delete[] buffer_;
                 }
                 }
                 buffer_ = newBuffer;
                 buffer_ = newBuffer;
             }
             }
             
             
             // Initialize the new elements
             // Initialize the new elements
-            ConstructElements(GetBuffer() + size_, src, newSize - size_);
+            ConstructElements(Buffer() + size_, src, newSize - size_);
         }
         }
         
         
         size_ = newSize;
         size_ = newSize;
@@ -369,7 +369,7 @@ private:
     /// Move a range of elements within the vector
     /// Move a range of elements within the vector
     void MoveRange(unsigned dest, unsigned src, unsigned count)
     void MoveRange(unsigned dest, unsigned src, unsigned count)
     {
     {
-        T* buffer = GetBuffer();
+        T* buffer = Buffer();
         if (src < dest)
         if (src < dest)
         {
         {
             for (unsigned i = count - 1; i < count; --i)
             for (unsigned i = count - 1; i < count; --i)
@@ -446,7 +446,7 @@ public:
     PODVector<T>& operator = (const PODVector<T>& rhs)
     PODVector<T>& operator = (const PODVector<T>& rhs)
     {
     {
         Resize(rhs.size_);
         Resize(rhs.size_);
-        CopyElements(GetBuffer(), rhs.GetBuffer(), rhs.size_);
+        CopyElements(Buffer(), rhs.Buffer(), rhs.size_);
         
         
         return *this;
         return *this;
     }
     }
@@ -489,8 +489,8 @@ public:
         if (rhs.size_ != size_)
         if (rhs.size_ != size_)
             return false;
             return false;
         
         
-        T* buffer = GetBuffer();
-        T* rhsBuffer = rhs.GetBuffer();
+        T* buffer = Buffer();
+        T* rhsBuffer = rhs.Buffer();
         for (unsigned i = 0; i < size_; ++i)
         for (unsigned i = 0; i < size_; ++i)
         {
         {
             if (buffer[i] != rhsBuffer[i])
             if (buffer[i] != rhsBuffer[i])
@@ -506,8 +506,8 @@ public:
         if (rhs.size_ != size_)
         if (rhs.size_ != size_)
             return true;
             return true;
         
         
-        T* buffer = GetBuffer();
-        T* rhsBuffer = rhs.GetBuffer();
+        T* buffer = Buffer();
+        T* rhsBuffer = rhs.Buffer();
         for (unsigned i = 0; i < size_; ++i)
         for (unsigned i = 0; i < size_; ++i)
         {
         {
             if (buffer[i] != rhsBuffer[i])
             if (buffer[i] != rhsBuffer[i])
@@ -518,13 +518,13 @@ public:
     }
     }
     
     
     /// Return element at index
     /// Return element at index
-    T& operator [] (unsigned index) { return GetBuffer()[index]; }
+    T& operator [] (unsigned index) { return Buffer()[index]; }
     /// Return const element at index
     /// Return const element at index
-    const T& operator [] (unsigned index) const { return GetBuffer()[index]; }
+    const T& operator [] (unsigned index) const { return Buffer()[index]; }
     /// Return element at index
     /// Return element at index
-    T& At(unsigned index) { return GetBuffer()[index]; }
+    T& At(unsigned index) { return Buffer()[index]; }
     /// Return const element at index
     /// Return const element at index
-    const T& At(unsigned index) const { return GetBuffer()[index]; }
+    const T& At(unsigned index) const { return Buffer()[index]; }
     
     
     /// Add an element at the end
     /// Add an element at the end
     void Push(const T& value)
     void Push(const T& value)
@@ -541,7 +541,7 @@ public:
     {
     {
         unsigned oldSize = size_;
         unsigned oldSize = size_;
         Resize(size_ + vector.size_);
         Resize(size_ + vector.size_);
-        CopyElements(GetBuffer() + oldSize, vector.GetBuffer(), vector.size_);
+        CopyElements(Buffer() + oldSize, vector.Buffer(), vector.size_);
     }
     }
     
     
     /// Remove the last element
     /// Remove the last element
@@ -560,7 +560,7 @@ public:
         unsigned oldSize = size_;
         unsigned oldSize = size_;
         Resize(size_ + 1);
         Resize(size_ + 1);
         MoveRange(pos + 1, pos, oldSize - pos);
         MoveRange(pos + 1, pos, oldSize - pos);
-        GetBuffer()[pos] = value;
+        Buffer()[pos] = value;
     }
     }
     
     
     /// Insert another vector at position
     /// Insert another vector at position
@@ -572,7 +572,7 @@ public:
         unsigned oldSize = size_;
         unsigned oldSize = size_;
         Resize(size_ + vector.size_);
         Resize(size_ + vector.size_);
         MoveRange(pos + vector.size_, pos, oldSize - pos);
         MoveRange(pos + vector.size_, pos, oldSize - pos);
-        CopyElements(GetBuffer() + pos, vector.GetBuffer(), vector.size_);
+        CopyElements(Buffer() + pos, vector.Buffer(), vector.size_);
     }
     }
     
     
     /// Insert an element using an iterator
     /// Insert an element using an iterator
@@ -606,7 +606,7 @@ public:
         unsigned length = end - start;
         unsigned length = end - start;
         Resize(size_ + length);
         Resize(size_ + length);
         MoveRange(pos + length, pos, size_ - pos - length);
         MoveRange(pos + length, pos, size_ - pos - length);
-        CopyElements(GetBuffer() + pos, &(*start), length);
+        CopyElements(Buffer() + pos, &(*start), length);
         
         
         return Begin() + pos;
         return Begin() + pos;
     }
     }
@@ -668,7 +668,7 @@ public:
             // Move the data into the new buffer and delete the old
             // Move the data into the new buffer and delete the old
             if (buffer_)
             if (buffer_)
             {
             {
-                CopyElements(reinterpret_cast<T*>(newBuffer), GetBuffer(), size_);
+                CopyElements(reinterpret_cast<T*>(newBuffer), Buffer(), size_);
                 delete[] buffer_;
                 delete[] buffer_;
             }
             }
             buffer_ = newBuffer;
             buffer_ = newBuffer;
@@ -692,7 +692,7 @@ public:
             {
             {
                 newBuffer = new unsigned char[capacity_ * sizeof(T)];
                 newBuffer = new unsigned char[capacity_ * sizeof(T)];
                 // Move the data into the new buffer
                 // Move the data into the new buffer
-                CopyElements(reinterpret_cast<T*>(newBuffer), GetBuffer(), size_);
+                CopyElements(reinterpret_cast<T*>(newBuffer), Buffer(), size_);
             }
             }
             
             
             // Delete the old buffer
             // Delete the old buffer
@@ -708,21 +708,21 @@ public:
     }
     }
     
     
     /// Return iterator to the beginning
     /// Return iterator to the beginning
-    Iterator Begin() { return Iterator(GetBuffer()); }
+    Iterator Begin() { return Iterator(Buffer()); }
     /// Return const iterator to the beginning
     /// Return const iterator to the beginning
-    ConstIterator Begin() const { return ConstIterator(GetBuffer()); }
+    ConstIterator Begin() const { return ConstIterator(Buffer()); }
     /// Return iterator to the end
     /// Return iterator to the end
-    Iterator End() { return Iterator(GetBuffer() + size_); }
+    Iterator End() { return Iterator(Buffer() + size_); }
     /// Return const iterator to the end
     /// Return const iterator to the end
-    ConstIterator End() const { return ConstIterator(GetBuffer() + size_); }
+    ConstIterator End() const { return ConstIterator(Buffer() + size_); }
     /// Return first element
     /// Return first element
-    T& Front() { return GetBuffer()[0]; }
+    T& Front() { return Buffer()[0]; }
     /// Return const first element
     /// Return const first element
-    const T& Front() const { return GetBuffer()[0]; }
+    const T& Front() const { return Buffer()[0]; }
     /// Return last element
     /// Return last element
-    T& Back() { return GetBuffer()[size_ - 1]; }
+    T& Back() { return Buffer()[size_ - 1]; }
     /// Return const last element
     /// Return const last element
-    const T& Back() const { return GetBuffer()[size_ - 1]; }
+    const T& Back() const { return Buffer()[size_ - 1]; }
     /// Return size of vector
     /// Return size of vector
     unsigned Size() const { return size_; }
     unsigned Size() const { return size_; }
     /// Return capacity of vector
     /// Return capacity of vector
@@ -732,13 +732,13 @@ public:
     
     
 private:
 private:
     /// Return the buffer with right type
     /// Return the buffer with right type
-    T* GetBuffer() const { return reinterpret_cast<T*>(buffer_); }
+    T* Buffer() const { return reinterpret_cast<T*>(buffer_); }
     
     
     /// Move a range of elements within the vector
     /// Move a range of elements within the vector
     void MoveRange(unsigned dest, unsigned src, unsigned count)
     void MoveRange(unsigned dest, unsigned src, unsigned count)
     {
     {
         if (count)
         if (count)
-            memmove(GetBuffer() + dest, GetBuffer() + src, count * sizeof(T));
+            memmove(Buffer() + dest, Buffer() + src, count * sizeof(T));
     }
     }
     
     
     /// Copy elements from one buffer to another
     /// Copy elements from one buffer to another

+ 1 - 1
Engine/Engine/MathAPI.cpp

@@ -362,7 +362,7 @@ static void RegisterQuaternion(asIScriptEngine* engine)
     engine->RegisterObjectMethod("Quaternion", "Quaternion Nlerp(const Quaternion&in, float) const", asMETHOD(Quaternion, Nlerp), asCALL_THISCALL);
     engine->RegisterObjectMethod("Quaternion", "Quaternion Nlerp(const Quaternion&in, float) const", asMETHOD(Quaternion, Nlerp), asCALL_THISCALL);
     engine->RegisterObjectMethod("Quaternion", "Quaternion Slerp(const Quaternion&in, float) const", asMETHOD(Quaternion, Slerp), asCALL_THISCALL);
     engine->RegisterObjectMethod("Quaternion", "Quaternion Slerp(const Quaternion&in, float) const", asMETHOD(Quaternion, Slerp), asCALL_THISCALL);
     engine->RegisterObjectMethod("Quaternion", "String ToString() const", asMETHOD(Quaternion, ToString), asCALL_THISCALL);
     engine->RegisterObjectMethod("Quaternion", "String ToString() const", asMETHOD(Quaternion, ToString), asCALL_THISCALL);
-    engine->RegisterObjectMethod("Quaternion", "Vector3 get_euler() const", asMETHOD(Quaternion, ToEuler), asCALL_THISCALL);
+    engine->RegisterObjectMethod("Quaternion", "Vector3 get_eulerAngles() const", asMETHOD(Quaternion, EulerAngles), asCALL_THISCALL);
     engine->RegisterObjectMethod("Quaternion", "float get_yaw() const", asMETHOD(Quaternion, YawAngle), asCALL_THISCALL);
     engine->RegisterObjectMethod("Quaternion", "float get_yaw() const", asMETHOD(Quaternion, YawAngle), asCALL_THISCALL);
     engine->RegisterObjectMethod("Quaternion", "float get_pitch() const", asMETHOD(Quaternion, PitchAngle), asCALL_THISCALL);
     engine->RegisterObjectMethod("Quaternion", "float get_pitch() const", asMETHOD(Quaternion, PitchAngle), asCALL_THISCALL);
     engine->RegisterObjectMethod("Quaternion", "float get_roll() const", asMETHOD(Quaternion, RollAngle), asCALL_THISCALL);
     engine->RegisterObjectMethod("Quaternion", "float get_roll() const", asMETHOD(Quaternion, RollAngle), asCALL_THISCALL);

+ 2 - 2
Engine/Graphics/Batch.cpp

@@ -130,7 +130,7 @@ void Batch::Prepare(Graphics* graphics, bool SetModelTransform) const
         graphics->SetVertexShaderParameter(VSP_CAMERAPOS, camera_->GetWorldPosition());
         graphics->SetVertexShaderParameter(VSP_CAMERAPOS, camera_->GetWorldPosition());
     
     
     if (vertexShader_->NeedParameterUpdate(VSP_CAMERAROT, camera_))
     if (vertexShader_->NeedParameterUpdate(VSP_CAMERAROT, camera_))
-        graphics->SetVertexShaderParameter(VSP_CAMERAROT, camera_->GetWorldTransform().ToRotationMatrix());
+        graphics->SetVertexShaderParameter(VSP_CAMERAROT, camera_->GetWorldTransform().RotationMatrix());
     
     
     if (vertexShader_->NeedParameterUpdate(VSP_DEPTHMODE, camera_))
     if (vertexShader_->NeedParameterUpdate(VSP_DEPTHMODE, camera_))
     {
     {
@@ -164,7 +164,7 @@ void Batch::Prepare(Graphics* graphics, bool SetModelTransform) const
     if ((light_) && (vertexShader_->NeedParameterUpdate(VSP_SPOTPROJ, light_)))
     if ((light_) && (vertexShader_->NeedParameterUpdate(VSP_SPOTPROJ, light_)))
     {
     {
         const Matrix3x4& transform = light_->GetWorldTransform();
         const Matrix3x4& transform = light_->GetWorldTransform();
-        Matrix3x4 spotView(transform.GetTranslation(), transform.GetRotation(), 1.0f);
+        Matrix3x4 spotView(transform.Translation(), transform.Rotation(), 1.0f);
         
         
         Matrix4 spotProj(Matrix4::ZERO);
         Matrix4 spotProj(Matrix4::ZERO);
         // Make the projected light slightly smaller than the shadow map to prevent light spill
         // Make the projected light slightly smaller than the shadow map to prevent light spill

+ 2 - 2
Engine/Graphics/BillboardSet.cpp

@@ -295,7 +295,7 @@ void BillboardSet::OnWorldBoundingBoxUpdate()
     
     
     unsigned enabledBillboards = 0;
     unsigned enabledBillboards = 0;
     const Matrix3x4& worldTransform = GetWorldTransform();
     const Matrix3x4& worldTransform = GetWorldTransform();
-    const Vector3& worldScale = worldTransform.GetScale();
+    const Vector3& worldScale = worldTransform.Scale();
     
     
     for (unsigned i = 0; i < billboards_.Size(); ++i)
     for (unsigned i = 0; i < billboards_.Size(); ++i)
     {
     {
@@ -419,7 +419,7 @@ void BillboardSet::UpdateVertexBuffer(const FrameInfo& frame)
     float* dest = (float*)vertexBuffer_->Lock(0, enabledBillboards * 4, LOCK_DISCARD);
     float* dest = (float*)vertexBuffer_->Lock(0, enabledBillboards * 4, LOCK_DISCARD);
     if (!dest)
     if (!dest)
         return;
         return;
-    const Vector3& worldScale = GetWorldTransform().GetScale();
+    const Vector3& worldScale = GetWorldTransform().Scale();
     
     
     for (unsigned i = 0; i < enabledBillboards; ++i)
     for (unsigned i = 0; i < enabledBillboards; ++i)
     {
     {

+ 3 - 3
Engine/Graphics/Camera.cpp

@@ -286,17 +286,17 @@ float Camera::GetHalfViewSize() const
 
 
 Vector3 Camera::GetForwardVector()
 Vector3 Camera::GetForwardVector()
 {
 {
-    return GetWorldTransform().ToRotationMatrix() * Vector3::FORWARD;
+    return GetWorldTransform().RotationMatrix() * Vector3::FORWARD;
 }
 }
 
 
 Vector3 Camera::GetRightVector()
 Vector3 Camera::GetRightVector()
 {
 {
-    return GetWorldTransform().ToRotationMatrix() * Vector3::RIGHT;
+    return GetWorldTransform().RotationMatrix() * Vector3::RIGHT;
 }
 }
 
 
 Vector3 Camera::GetUpVector()
 Vector3 Camera::GetUpVector()
 {
 {
-    return GetWorldTransform().ToRotationMatrix() * Vector3::UP;
+    return GetWorldTransform().RotationMatrix() * Vector3::UP;
 }
 }
 
 
 float Camera::GetDistance(const Vector3& worldPos)
 float Camera::GetDistance(const Vector3& worldPos)

+ 4 - 4
Engine/Graphics/Light.cpp

@@ -328,7 +328,7 @@ void Light::copyFrom(Light* original)
 Frustum Light::GetFrustum() const
 Frustum Light::GetFrustum() const
 {
 {
     const Matrix3x4& transform = GetWorldTransform();
     const Matrix3x4& transform = GetWorldTransform();
-    Matrix3x4 frustumTransform(transform.GetTranslation(), transform.GetRotation(), 1.0f);
+    Matrix3x4 frustumTransform(transform.Translation(), transform.Rotation(), 1.0f);
     Frustum ret;
     Frustum ret;
     ret.Define(fov_, aspectRatio_, 1.0f, M_MIN_NEARCLIP, range_, transform);
     ret.Define(fov_, aspectRatio_, 1.0f, M_MIN_NEARCLIP, range_, transform);
     return ret;
     return ret;
@@ -392,19 +392,19 @@ const Matrix3x4& Light::GetVolumeTransform(Camera& camera)
         break;
         break;
         
         
     case LIGHT_POINT:
     case LIGHT_POINT:
-        volumeTransform_ = Matrix3x4(transform.GetTranslation(), Quaternion::IDENTITY, range_);
+        volumeTransform_ = Matrix3x4(transform.Translation(), Quaternion::IDENTITY, range_);
         break;
         break;
         
         
     case LIGHT_SPOT:
     case LIGHT_SPOT:
         {
         {
             float yScale = tan(fov_ * M_DEGTORAD * 0.5f) * range_;
             float yScale = tan(fov_ * M_DEGTORAD * 0.5f) * range_;
             float xScale = aspectRatio_ * yScale;
             float xScale = aspectRatio_ * yScale;
-            volumeTransform_ = Matrix3x4(transform.GetTranslation(), transform.GetRotation(), Vector3(xScale, yScale, range_));
+            volumeTransform_ = Matrix3x4(transform.Translation(), transform.Rotation(), Vector3(xScale, yScale, range_));
         }
         }
         break;
         break;
         
         
     case LIGHT_SPLITPOINT:
     case LIGHT_SPLITPOINT:
-        volumeTransform_ = Matrix3x4(transform.GetTranslation(), transform.GetRotation(), range_);
+        volumeTransform_ = Matrix3x4(transform.Translation(), transform.Rotation(), range_);
         break;
         break;
     }
     }
     
     

+ 1 - 1
Engine/Graphics/View.cpp

@@ -1037,7 +1037,7 @@ void View::RenderBatchesDeferred()
         graphics_->SetTexture(TU_DIFFBUFFER, graphics_->GetScreenBuffer(jitterCounter_ & 1));
         graphics_->SetTexture(TU_DIFFBUFFER, graphics_->GetScreenBuffer(jitterCounter_ & 1));
         graphics_->SetTexture(TU_NORMALBUFFER, graphics_->GetScreenBuffer((jitterCounter_ + 1) & 1));
         graphics_->SetTexture(TU_NORMALBUFFER, graphics_->GetScreenBuffer((jitterCounter_ + 1) & 1));
         graphics_->SetTexture(TU_DEPTHBUFFER, graphics_->GetDepthBuffer());
         graphics_->SetTexture(TU_DEPTHBUFFER, graphics_->GetDepthBuffer());
-        graphics_->SetVertexShaderParameter(VSP_CAMERAROT, camera_->GetWorldTransform().ToRotationMatrix());
+        graphics_->SetVertexShaderParameter(VSP_CAMERAROT, camera_->GetWorldTransform().RotationMatrix());
         graphics_->SetVertexShaderParameter(VSP_DEPTHMODE, depthMode);
         graphics_->SetVertexShaderParameter(VSP_DEPTHMODE, depthMode);
         graphics_->SetPixelShaderParameter(PSP_CAMERAPOS, camera_->GetWorldPosition());
         graphics_->SetPixelShaderParameter(PSP_CAMERAPOS, camera_->GetWorldPosition());
         graphics_->SetPixelShaderParameter(PSP_ANTIALIASWEIGHTS, Vector4(thisFrameWeight, 1.0f - thisFrameWeight, 0.0f, 0.0f));
         graphics_->SetPixelShaderParameter(PSP_ANTIALIASWEIGHTS, Vector4(thisFrameWeight, 1.0f - thisFrameWeight, 0.0f, 0.0f));

+ 1 - 1
Engine/Math/Matrix3.h

@@ -185,7 +185,7 @@ public:
     }
     }
     
     
     /// Return the scaling part
     /// Return the scaling part
-    Vector3 GetScale() const
+    Vector3 Scale() const
     {
     {
         return Vector3(
         return Vector3(
             sqrtf(m00_ * m00_ + m10_ * m10_ + m20_ * m20_),
             sqrtf(m00_ * m00_ + m10_ * m10_ + m20_ * m20_),

+ 2 - 2
Engine/Math/Matrix3x4.cpp

@@ -36,13 +36,13 @@ const Matrix3x4 Matrix3x4::IDENTITY(
 
 
 Matrix3x4::Matrix3x4(const Vector3& translation, const Quaternion& rotation, float scale)
 Matrix3x4::Matrix3x4(const Vector3& translation, const Quaternion& rotation, float scale)
 {
 {
-    SetRotation(rotation.ToRotationMatrix() * scale);
+    SetRotation(rotation.RotationMatrix() * scale);
     SetTranslation(translation);
     SetTranslation(translation);
 }
 }
 
 
 Matrix3x4::Matrix3x4(const Vector3& translation, const Quaternion& rotation, const Vector3& scale)
 Matrix3x4::Matrix3x4(const Vector3& translation, const Quaternion& rotation, const Vector3& scale)
 {
 {
-    SetRotation(rotation.ToRotationMatrix().Scaled(scale));
+    SetRotation(rotation.RotationMatrix().Scaled(scale));
     SetTranslation(translation);
     SetTranslation(translation);
 }
 }
 
 

+ 5 - 5
Engine/Math/Matrix3x4.h

@@ -321,7 +321,7 @@ public:
     }
     }
     
     
     /// Return the rotation matrix with scaling removed
     /// Return the rotation matrix with scaling removed
-    Matrix3 ToRotationMatrix() const
+    Matrix3 RotationMatrix() const
     {
     {
         Vector3 invScale(
         Vector3 invScale(
             1.0f / sqrtf(m00_ * m00_ + m10_ * m10_ + m20_ * m20_),
             1.0f / sqrtf(m00_ * m00_ + m10_ * m10_ + m20_ * m20_),
@@ -333,7 +333,7 @@ public:
     }
     }
     
     
     /// Return the translation part
     /// Return the translation part
-    Vector3 GetTranslation() const
+    Vector3 Translation() const
     {
     {
         return Vector3(
         return Vector3(
             m03_,
             m03_,
@@ -343,13 +343,13 @@ public:
     }
     }
     
     
     /// Return the rotation part
     /// Return the rotation part
-    Quaternion GetRotation() const
+    Quaternion Rotation() const
     {
     {
-        return Quaternion(ToRotationMatrix());
+        return Quaternion(RotationMatrix());
     }
     }
     
     
     /// Return the scaling part
     /// Return the scaling part
-    Vector3 GetScale() const
+    Vector3 Scale() const
     {
     {
         return Vector3(
         return Vector3(
             sqrtf(m00_ * m00_ + m10_ * m10_ + m20_ * m20_),
             sqrtf(m00_ * m00_ + m10_ * m10_ + m20_ * m20_),

+ 5 - 5
Engine/Math/Matrix4.h

@@ -338,7 +338,7 @@ public:
     }
     }
     
     
     /// Return the rotation matrix with scaling removed
     /// Return the rotation matrix with scaling removed
-    Matrix3 ToRotationMatrix() const
+    Matrix3 RotationMatrix() const
     {
     {
         Vector3 invScale(
         Vector3 invScale(
             1.0f / sqrtf(m00_ * m00_ + m10_ * m10_ + m20_ * m20_),
             1.0f / sqrtf(m00_ * m00_ + m10_ * m10_ + m20_ * m20_),
@@ -350,7 +350,7 @@ public:
     }
     }
     
     
     /// Return the translation part
     /// Return the translation part
-    Vector3 GetTranslation() const
+    Vector3 Translation() const
     {
     {
         return Vector3(
         return Vector3(
             m03_,
             m03_,
@@ -360,13 +360,13 @@ public:
     }
     }
     
     
     /// Return the rotation part
     /// Return the rotation part
-    Quaternion GetRotation() const
+    Quaternion Rotation() const
     {
     {
-        return Quaternion(ToRotationMatrix());
+        return Quaternion(RotationMatrix());
     }
     }
     
     
     /// Return the scaling part
     /// Return the scaling part
-    Vector3 GetScale() const
+    Vector3 Scale() const
     {
     {
         return Vector3(
         return Vector3(
             sqrtf(m00_ * m00_ + m10_ * m10_ + m20_ * m20_),
             sqrtf(m00_ * m00_ + m10_ * m10_ + m20_ * m20_),

+ 5 - 5
Engine/Math/Quaternion.cpp

@@ -141,7 +141,7 @@ Quaternion::Quaternion(const Matrix3& matrix)
     }
     }
 }
 }
 
 
-Vector3 Quaternion::ToEuler() const
+Vector3 Quaternion::EulerAngles() const
 {
 {
     // Derivation from http://www.geometrictools.com/Documentation/EulerAngles.pdf
     // Derivation from http://www.geometrictools.com/Documentation/EulerAngles.pdf
     // Order of rotations: Z first, then X, then Y
     // Order of rotations: Z first, then X, then Y
@@ -175,20 +175,20 @@ Vector3 Quaternion::ToEuler() const
 
 
 float Quaternion::YawAngle() const
 float Quaternion::YawAngle() const
 {
 {
-    return ToEuler().y_;
+    return EulerAngles().y_;
 }
 }
 
 
 float Quaternion::PitchAngle() const
 float Quaternion::PitchAngle() const
 {
 {
-    return ToEuler().x_;
+    return EulerAngles().x_;
 }
 }
 
 
 float Quaternion::RollAngle() const
 float Quaternion::RollAngle() const
 {
 {
-    return ToEuler().z_;
+    return EulerAngles().z_;
 }
 }
 
 
-Matrix3 Quaternion::ToRotationMatrix() const
+Matrix3 Quaternion::RotationMatrix() const
 {
 {
     return Matrix3(
     return Matrix3(
         1.0f - 2.0f * y_ * y_ - 2.0f * z_ * z_,
         1.0f - 2.0f * y_ * y_ - 2.0f * z_ * z_,

+ 3 - 3
Engine/Math/Quaternion.h

@@ -203,15 +203,15 @@ public:
     Quaternion NlerpFast(const Quaternion& rhs, float t) const { return (*this * (1.0f - t) + rhs * t).NormalizedFast(); }
     Quaternion NlerpFast(const Quaternion& rhs, float t) const { return (*this * (1.0f - t) + rhs * t).NormalizedFast(); }
     
     
     /// Return Euler angles in degrees
     /// Return Euler angles in degrees
-    Vector3 ToEuler() const;
+    Vector3 EulerAngles() const;
     /// Return yaw angle in degrees
     /// Return yaw angle in degrees
     float YawAngle() const;
     float YawAngle() const;
     /// Return pitch angle in degrees
     /// Return pitch angle in degrees
     float PitchAngle() const;
     float PitchAngle() const;
     /// Return roll angle in degrees
     /// Return roll angle in degrees
     float RollAngle() const;
     float RollAngle() const;
-    /// Convert to rotation matrix
-    Matrix3 ToRotationMatrix() const;
+    /// Return the rotation matrix that corresponds to this quaternion
+    Matrix3 RotationMatrix() const;
     /// Spherical interpolation with another quaternion
     /// Spherical interpolation with another quaternion
     Quaternion Slerp(Quaternion rhs, float t) const;
     Quaternion Slerp(Quaternion rhs, float t) const;
     /// Return float data
     /// Return float data

+ 3 - 3
Engine/Scene/Component.h

@@ -66,19 +66,19 @@ public:
     /// Return parent node's world position
     /// Return parent node's world position
     Vector3 GetWorldPosition() const
     Vector3 GetWorldPosition() const
     {
     {
-        return GetWorldTransform().GetTranslation();
+        return GetWorldTransform().Translation();
     }
     }
     
     
     /// Return parent node's world rotation
     /// Return parent node's world rotation
     Quaternion GetWorldRotation() const
     Quaternion GetWorldRotation() const
     {
     {
-        return GetWorldTransform().GetRotation();
+        return GetWorldTransform().Rotation();
     }
     }
     
     
     /// Return parent node's world scale
     /// Return parent node's world scale
     Vector3 GetWorldScale() const
     Vector3 GetWorldScale() const
     {
     {
-        return GetWorldTransform().GetScale();
+        return GetWorldTransform().Scale();
     }
     }
     
     
     /// Return components in the same scene node by type
     /// Return components in the same scene node by type

+ 4 - 4
Engine/Scene/Node.h

@@ -152,7 +152,7 @@ public:
         if (dirty_)
         if (dirty_)
             UpdateWorldTransform();
             UpdateWorldTransform();
         
         
-        return worldTransform_.GetTranslation();
+        return worldTransform_.Translation();
     }
     }
     
     
     /// Return world-space rotation
     /// Return world-space rotation
@@ -161,7 +161,7 @@ public:
         if (dirty_)
         if (dirty_)
             UpdateWorldTransform();
             UpdateWorldTransform();
         
         
-        return worldTransform_.GetRotation();
+        return worldTransform_.Rotation();
     }
     }
     
     
     /// Return world-space direction
     /// Return world-space direction
@@ -170,7 +170,7 @@ public:
         if (dirty_)
         if (dirty_)
             UpdateWorldTransform();
             UpdateWorldTransform();
         
         
-        return worldTransform_.ToRotationMatrix() * Vector3::FORWARD;
+        return worldTransform_.RotationMatrix() * Vector3::FORWARD;
     }
     }
     
     
     /// Return world-space scale
     /// Return world-space scale
@@ -179,7 +179,7 @@ public:
         if (dirty_)
         if (dirty_)
             UpdateWorldTransform();
             UpdateWorldTransform();
         
         
-        return worldTransform_.GetScale();
+        return worldTransform_.Scale();
     }
     }
     
     
     /// Return world-space transform
     /// Return world-space transform

+ 2 - 2
Tools/AssetImporter/AssetImporter.cpp

@@ -657,7 +657,7 @@ void BuildAndSaveModel(OutModel& model)
             Quaternion rot;
             Quaternion rot;
             GetPosRotScale(GetMeshBakingTransform(model.meshNodes_[i], model.rootNode_), pos, rot, scale);
             GetPosRotScale(GetMeshBakingTransform(model.meshNodes_[i], model.rootNode_), pos, rot, scale);
             vertexTransform = Matrix3x4(pos, rot, scale);
             vertexTransform = Matrix3x4(pos, rot, scale);
-            normalTransform = rot.ToRotationMatrix();
+            normalTransform = rot.RotationMatrix();
             
             
             SharedPtr<IndexBuffer> ib(new IndexBuffer(context_));
             SharedPtr<IndexBuffer> ib(new IndexBuffer(context_));
             SharedPtr<VertexBuffer> vb(new VertexBuffer(context_));
             SharedPtr<VertexBuffer> vb(new VertexBuffer(context_));
@@ -740,7 +740,7 @@ void BuildAndSaveModel(OutModel& model)
             Quaternion rot;
             Quaternion rot;
             GetPosRotScale(GetMeshBakingTransform(model.meshNodes_[i], model.rootNode_), pos, rot, scale);
             GetPosRotScale(GetMeshBakingTransform(model.meshNodes_[i], model.rootNode_), pos, rot, scale);
             vertexTransform = Matrix3x4(pos, rot, scale);
             vertexTransform = Matrix3x4(pos, rot, scale);
-            normalTransform = rot.ToRotationMatrix();
+            normalTransform = rot.RotationMatrix();
             
             
             SharedPtr<Geometry> geom(new Geometry(context_));
             SharedPtr<Geometry> geom(new Geometry(context_));