usata-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Usata-commits] Changes to usata2/src/math/vector.hpp


From: Chong Kai Xiong
Subject: [Usata-commits] Changes to usata2/src/math/vector.hpp
Date: Fri, 31 Dec 2004 00:29:48 -0500

Index: usata2/src/math/vector.hpp
diff -u usata2/src/math/vector.hpp:1.5 usata2/src/math/vector.hpp:1.6
--- usata2/src/math/vector.hpp:1.5      Mon Dec 27 01:30:16 2004
+++ usata2/src/math/vector.hpp  Fri Dec 31 05:14:41 2004
@@ -10,7 +10,7 @@
 // included in the software distribution, or visit
 // http://www.fsf.org/licenses/gpl.html.
 //
-// $Id: vector.hpp,v 1.5 2004/12/27 01:30:16 Descender Exp $
+// $Id: vector.hpp,v 1.6 2004/12/31 05:14:41 Descender Exp $
 
 #ifndef USATA_MATH_VECTOR_HPP
 #define USATA_MATH_VECTOR_HPP
@@ -54,6 +54,14 @@
                                v[3] = w;
                        }
 
+                       //! \brief Index operator
+                       //! \param index Index of component.
+                       T
+                       operator[] (int index) const
+                       {
+                               return v[index];
+                       }
+
                        //! \brief Output stream operator
                        friend std::ostream&
                        operator << (std::ostream& out, const Vector4& vector)
@@ -214,7 +222,7 @@
                        //! \brief Returns cross product
                        //! \param[in] rhs Right operand.
                        T
-                       cross(const Vector4& rhs)
+                       cross(const Vector4& rhs) const
                        {
                                return Vector4(v[1] * rhs.v[2] - v[2] * 
rhs.v[1],
                                                           v[2] * rhs.v[0] - 
v[0] * rhs.v[2],




reply via email to

[Prev in Thread] Current Thread [Next in Thread]