亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? vector3.hh

?? 2007年機器人足球世界杯3D仿真組亞軍
?? HH
字號:
/* *  Little Green BATS (2006) * *  Authors: 	Martin Klomp (martin@ai.rug.nl) *		Mart van de Sanden (vdsanden@ai.rug.nl) *		Sander van Dijk (sgdijk@ai.rug.nl) *		A. Bram Neijt (bneijt@gmail.com) *		Matthijs Platje (mplatje@gmail.com) * *  Date: 	September 14, 2006 * *  Website:	http://www.littlegreenbats.nl * *  Comment:	Please feel free to contact us if you have any  *		problems or questions about the code. * * *  License: 	This program is free software; you can redistribute  *		it and/or modify it under the terms of the GNU General *		Public License as published by the Free Software  *		Foundation; either version 2 of the License, or (at  *		your option) any later version. * *   		This program is distributed in the hope that it will *		be useful, but WITHOUT ANY WARRANTY; without even the *		implied warranty of MERCHANTABILITY or FITNESS FOR A *		PARTICULAR PURPOSE.  See the GNU General Public *		License for more details. * *   		You should have received a copy of the GNU General *		Public License along with this program; if not, write *		to the Free Software Foundation, Inc., 59 Temple Place -  *		Suite 330, Boston, MA  02111-1307, USA. * */#ifndef __INC_BATS_VECTOR3_HH_#define __INC_BATS_VECTOR3_HH_#include <cstring>#include <cassert>#include <ostream>#include <cmath>namespace bats {  template <class T>  class Matrix9;  /** \brief 3 element vector   *   *  The Vector3 class is a three dimensional vector class (3 values).   */  template <class T>  class Vector3  {    template <class K> friend std::ostream &operator<<(std::ostream &, Vector3<K> const &);    friend class Matrix9<T>;    T d_values[3];    void destroy()    {    }    void copy(Vector3<T> const &other)    {      memcpy(reinterpret_cast<char*>(d_values),	     reinterpret_cast<char const *>(other.d_values),	     sizeof(T)*3);    }    Vector3(double values[])    {      memcpy(reinterpret_cast<char*>(d_values),	     reinterpret_cast<char const *>(values),	     sizeof(T)*3);    }      public:    Vector3(Vector3<T> const &other) { copy(other); }    /**     *  A vector initalizes to zero.     */    Vector3() { d_values[0] = d_values[1] = d_values[2] = 0; }    /**     *  Initializes the vector to (x,y,z).     */    Vector3(T x, T y, T z)    {      d_values[0] = x;      d_values[1] = y;      d_values[2] = z;    }    ~Vector3() { destroy(); }    /**     *  @returns a pointer to the array of values.     */    T const *ptr() const { return d_values; }    /**     *  @returns a pointer to the array of values. This is an auto     *           conversion function and makes it posible to     *           use the vector in places where you normaly would     *           have used a array of 3 values.     */    operator T /*const*/ *() /*const*/ { return d_values; }    Vector3 &operator=(Vector3 const &other)    {      if (this != &other) {        destroy();        copy(other);      }      return *this;    }    /*T &operator[](unsigned index)    {      assert(index < 3);      return d_values[index];    }*/    /** Set member \a idx to \a value */    void set(unsigned idx, T value) { d_values[idx] = value; }        /** Set X-coordinate to \a value */    void setX(T value) { d_values[0] = value; }    /** Set Y-coordinate to \a value */    void setY(T value) { d_values[1] = value; }    /** Set Z-coordinate to \a value */    void setZ(T value) { d_values[2] = value; }        /** Get member \a idx */    T get(unsigned idx) const    {      assert(idx < 3);      return d_values[idx];    }    /** Get X-coordinate */    T getX() const{ return d_values[0]; }    /** Get Y-coordinate */    T getY() const { return d_values[1]; }    /** Get Z-coordinate */    T getZ() const { return d_values[2]; }    /** Calculate vector length     *     * \f$ |\vec V| = \sqrt{X^2 + Y^2 + Z^2} \f$     */    T length() const    {      return sqrt(d_values[0]*d_values[0] +		  d_values[1]*d_values[1] + 		  d_values[2]*d_values[2]);    }    /**     *  @returns a normalized vector. A vector is normalized when its euclidian length is one.     */    Vector3<T> normalize() const    {      return (*this)/length();    }    /** Calculate the cross product of this vector with another vector     *     * \f$ \vec c = \vec a \times \vec b \f$ <BR>     * \f$ c_0 = a_1 \cdot b_2 - a_2 \cdot a_1 \f$ <BR>     * \f$ c_1 = a_2 \cdot b_0 - a_0 \cdot a_2 \f$ <BR>     * \f$ c_2 = a_3 \cdot b_1 - a_1 \cdot a_0 \f$      */    Vector3<T> crossProduct(Vector3<T> const &other) const    {      Vector3<T> res(        (d_values[1] * other.d_values[2] - d_values[2] * other.d_values[1]),        (d_values[2] * other.d_values[0] - d_values[0] * other.d_values[2]),        (d_values[0] * other.d_values[1] - d_values[1] * other.d_values[0])      );      return res;    }    /** Calculate the dot product of this vector with another vector     *     * \f$ \vec c = \vec a \cdot \vec b \f$ <BR>     * \f$ c_i = a_i \cdot b_i \f$     */    T dotProduct(Vector3<T> const &other) const    {      return (d_values[0]*other.d_values[0] +	      d_values[1]*other.d_values[1] +	      d_values[2]*other.d_values[2]);    }    /**     *  Performs a dot (or inner) product.     */    T operator*(Vector3<T> const &other) const    {      return dotProduct(other);    }        /** Add another vector to this vector*/    Vector3<T> operator+(Vector3 const &other) const    {      Vector3<T> res(        d_values[0] + other.d_values[0],        d_values[1] + other.d_values[1],        d_values[2] + other.d_values[2]      );      return res;    }    /** Subtract another vector from this vector */    Vector3<T> operator-(Vector3 const &other) const    {      Vector3<T> res(        d_values[0] - other.d_values[0],        d_values[1] - other.d_values[1],        d_values[2] - other.d_values[2]      );      return res;    }    /** Multiply this vector with a scalar value */    Vector3<T> operator*(T value) const    {      Vector3<T> res(        d_values[0] * value,        d_values[1] * value,        d_values[2] * value      );      return res;    }    /** Divide this vector by a scalar value */    Vector3<T> operator/(T value) const    {      Vector3<T> res(        d_values[0] / value,        d_values[1] / value,        d_values[2] / value      );      return res;    }    /**     *  @returns the negative version of the vector.     */    Vector3<T> operator-()    {      Vector3<T> res(        -d_values[0],        -d_values[1],        -d_values[2]      );      return res;    }    /**     *  Adds other to this one.     */    Vector3<T> &operator+=(Vector3 const &other)    {      d_values[0] += other.d_values[0];      d_values[1] += other.d_values[1];      d_values[2] += other.d_values[2];      return *this;    }    /**     *  Substracts other from this one.     */    Vector3<T> &operator-=(Vector3 const &other)    {      d_values[0] -= other.d_values[0];      d_values[1] -= other.d_values[1];      d_values[2] -= other.d_values[2];      return *this;    }    /** Divide this vector by a scalar value */    Vector3<T> &operator/=(T value)    {      d_values[0] /= value;      d_values[1] /= value;      d_values[2] /= value;      return *this;    }    /** Multiply this vector by a scalar value */    Vector3<T> &operator*=(T value)    {      d_values[0] *= value;      d_values[1] *= value;      d_values[2] *= value;      return *this;    }    /** Compare this vector to another vector */    bool operator==(Vector3 const &other) const    {      return d_values[0] == other.d_values[0] &&             d_values[1] == other.d_values[1] &&             d_values[2] == other.d_values[2];    }        bool operator!=(Vector3 const &other) const    {      return !(*this == other);    }    bool operator<(Vector3 const& other) const    {      return length() < other.length();    }        /** Calculate angle between this vector and another vector     *     * \f$ cos(\alpha) = {{\vec a \cdot \vec b} \over {| \vec a | | \vec b | }}\f$ <BR>     *     */    double angle(Vector3 &other) const    {      double dp = dotProduct(other);      return acos(dp / (length() * other.length()));    }    /**     *  Rotates the vector around the Z-ax by an angle of angle.     *     *  Might not be used anymore.     */    Vector3<T> rotateZ(double angle)    {      Matrix9<T> rotMat;      rotMat.set(0,0, cos(angle));      rotMat.set(0,1, sin(angle));      rotMat.set(1,0, -sin(angle));      rotMat.set(1,1, cos(angle));      rotMat.set(2, 2, 1.0);      Vector3<T> res;      Matrix9<T>::mul(res, rotMat, *this);      return res;    }    /**     *  @returns false is one of the values is NaN.     */    bool isValid()    {    	return !std::isnan(d_values[0]) && !std::isnan(d_values[1]) && !std::isnan(d_values[2]);    }  };  /**   *  A vector of doubles.   */  typedef Vector3<double> Vector3D;  /**   *  A vector of floats.   */  typedef Vector3<float>  Vector3F;  template <class K>  std::ostream &operator<<(std::ostream &_os, Vector3<K> const &_vect)  {    return _os << "(" << _vect.d_values[0] << "," << _vect.d_values[1] << "," << _vect.d_values[2] << ")";  }};#endif // __INC_BATS_VECTOR3_HH_

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久国产精品99精品国产| 国产欧美一区二区三区在线看蜜臀 | 日韩一区二区视频| 日韩国产成人精品| 久久综合五月天婷婷伊人| 国产福利精品导航| 亚洲欧美日韩电影| 欧美乱妇23p| 韩国欧美一区二区| ●精品国产综合乱码久久久久| 欧美亚洲图片小说| 伦理电影国产精品| 自拍偷拍国产精品| 欧美片在线播放| 国产一区三区三区| 伊人婷婷欧美激情| 精品美女在线播放| 色八戒一区二区三区| 91麻豆精品在线观看| 欧美色涩在线第一页| 日本亚洲一区二区| 中文字幕 久热精品 视频在线| 欧美在线观看18| 狠狠色狠狠色合久久伊人| 亚洲精品乱码久久久久久久久| 日韩欧美在线影院| 91首页免费视频| 免费人成网站在线观看欧美高清| 日本一区二区三区国色天香 | 精品久久久久久无| 91亚洲精品久久久蜜桃| 精品亚洲免费视频| 午夜a成v人精品| 国产片一区二区| 91超碰这里只有精品国产| 成人黄色国产精品网站大全在线免费观看| 精品区一区二区| 99视频一区二区| 久久成人羞羞网站| 一区二区欧美视频| 久久久久9999亚洲精品| 欧美一区三区四区| 色婷婷综合在线| 丁香啪啪综合成人亚洲小说| 午夜电影一区二区三区| 1024成人网| 久久久精品蜜桃| 欧美大片一区二区三区| 欧美午夜精品免费| 日本道精品一区二区三区| 国产91露脸合集magnet| 精品一区二区三区av| 奇米一区二区三区av| 亚洲国产wwwccc36天堂| 一区二区日韩电影| 亚洲女人****多毛耸耸8| 国产婷婷色一区二区三区| 91精品国产91热久久久做人人| 色狠狠一区二区| 91视频一区二区三区| 成人丝袜18视频在线观看| 国产成人精品免费| 国产乱人伦偷精品视频免下载| 乱一区二区av| 久久99这里只有精品| 久久精品国产亚洲一区二区三区| 日本91福利区| 男人的j进女人的j一区| 日韩电影在线看| 热久久一区二区| 美国三级日本三级久久99| 久热成人在线视频| 美女视频免费一区| 久草在线在线精品观看| 久久99深爱久久99精品| 国产一区在线精品| 国产91丝袜在线18| 99国产精品久久久久久久久久久| www.欧美精品一二区| 91在线视频免费91| 色偷偷88欧美精品久久久| 欧美日韩精品高清| 日韩精品一区二区三区四区| 精品国产91乱码一区二区三区 | 亚洲激情图片小说视频| 樱桃视频在线观看一区| 亚洲成人一区在线| 人人超碰91尤物精品国产| 麻豆国产欧美日韩综合精品二区| 精品一区二区精品| 成人蜜臀av电影| 欧美性猛交xxxxxxxx| 日韩欧美成人午夜| 国产欧美日韩精品在线| 亚洲激情中文1区| 蜜桃av一区二区| 成人午夜激情视频| 欧美中文字幕一区二区三区| 91精品国产福利在线观看| 国产色91在线| 亚洲免费观看高清完整版在线观看| 亚洲.国产.中文慕字在线| 精品亚洲欧美一区| 91亚洲男人天堂| 欧美成人艳星乳罩| 亚洲视频在线观看三级| 婷婷开心激情综合| 国产精品资源网站| 91福利社在线观看| 久久久久久久性| 亚洲一区二区三区不卡国产欧美| 麻豆久久久久久| 色综合天天综合| 欧美不卡视频一区| 亚洲桃色在线一区| 麻豆精品新av中文字幕| 色噜噜狠狠色综合欧洲selulu| 欧美美女网站色| 亚洲天堂免费在线观看视频| 久久99精品久久久久久国产越南 | 精品一区二区在线观看| 日韩国产欧美三级| 韩日欧美一区二区三区| 99久久精品国产一区| 日韩午夜电影在线观看| 中文字幕亚洲在| 精品一区二区免费视频| 91搞黄在线观看| 国产欧美日韩麻豆91| 日韩精品亚洲专区| 色综合色综合色综合| 久久久99久久| 秋霞国产午夜精品免费视频| 91在线视频在线| 国产亚洲欧美日韩日本| 首页国产丝袜综合| 91豆麻精品91久久久久久| 久久精品亚洲国产奇米99| 日韩在线一区二区三区| 91成人国产精品| 中文字幕亚洲视频| 豆国产96在线|亚洲| 日韩欧美卡一卡二| 日韩国产欧美三级| 欧美亚洲国产一区二区三区va | 国产精品你懂的在线欣赏| 麻豆国产欧美一区二区三区| 欧美日韩精品专区| 亚洲少妇最新在线视频| 成人激情校园春色| 国产精品青草综合久久久久99| 黑人巨大精品欧美一区| 欧美一区二区免费观在线| 午夜电影网一区| 欧美在线视频全部完| 亚洲精品你懂的| 日本韩国精品一区二区在线观看| 中文字幕一区在线| 成人综合婷婷国产精品久久| 国产亚洲精品精华液| 国产成人精品网址| 国产欧美日韩卡一| 国产91精品免费| 欧美激情一区二区三区蜜桃视频| 国产成a人亚洲| 国产女同性恋一区二区| 成人av资源网站| 国产精品福利在线播放| 99re热这里只有精品免费视频| 国产亚洲欧美色| www.综合网.com| 亚洲婷婷综合久久一本伊一区 | 久久不见久久见免费视频7| 51久久夜色精品国产麻豆| 麻豆91在线看| 欧美r级在线观看| 国产精品影音先锋| 国产精品成人一区二区艾草| 91欧美一区二区| 亚洲高清中文字幕| 日韩三级.com| 成人综合日日夜夜| 一区二区三区四区视频精品免费| 91精彩视频在线| 香蕉av福利精品导航| 精品人在线二区三区| 成人一区二区三区中文字幕| 亚洲女同ⅹxx女同tv| 欧美剧情片在线观看| 激情小说亚洲一区| 国产精品系列在线| 欧美性感一区二区三区| 激情综合五月天| 18欧美亚洲精品| 欧美肥妇free| 国产精品自拍毛片| 亚洲一卡二卡三卡四卡无卡久久| 欧美成人性福生活免费看| 成人午夜av在线| 香蕉av福利精品导航|