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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? box.h

?? Direct3D游戲編程入門教程源代碼.rar
?? H
字號:
/*   ColDet - C++ 3D Collision Detection Library
 *   Copyright (C) 2000   Amir Geva
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 * 
 * This library 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
 * Library General Public License for more details.
 * 
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA  02111-1307, USA.
 *
 * Any comments, questions and bug reports send to:
 *   photon@photoneffect.com
 *
 * Or visit the home page: http://photoneffect.com/coldet/
 */
#ifndef H_BOX
#define H_BOX

#include <vector>
#include "math3d.h"
#include "sysdep.h"

__CD__BEGIN

/** Stores rotation vectors used in the intersection tests, 
    to avoid recalculating them each time. */
class RotationState
{
public:
  RotationState(const Matrix3D& transform);
  Vector3D N[3];
  Matrix3D t;
};

/** AABB class, with support for testing against OBBs. */
class Box
{
public:
  /** Default constructor */
  Box() {}
  /** Construct from scalar corner position and size */
  Box(float x, float y, float z, float sx, float sy, float sz) 
    : m_Pos(x,y,z), m_Size(sx,sy,sz), 
      m_Center(x+0.5f*sx,y+0.5f*sy,z+0.5f*sz) {}
  /** Construct from corner position and size */
  Box(const Vector3D& pos, const Vector3D& size) 
    : m_Pos(pos), m_Size(size), m_Center(pos+0.5f*size) {}
  /** Copy constructor */
  Box(const Box& b) : m_Pos(b.m_Pos), m_Size(b.m_Size), m_Center(b.m_Center) {}
  virtual ~Box() {}
  /** Returns the box's position */
  const Vector3D& getPosition() const { return m_Pos; }
  /** Returns the sizes of the box's edges */
  const Vector3D& getSize() const { return m_Size; }
  /** Returns the center position of the box */
  const Vector3D& getCenter() const { return m_Center; }
  /** Returns the volume of the box */
  float getVolume() const { return m_Size.x*m_Size.y*m_Size.z; }
  /** Ray intersection */
  bool intersect(const Vector3D& O, const Vector3D& D);
  /** Line segment intersection */
  bool intersect(const Vector3D& O, const Vector3D& D, float segmax);
  /** Sphere intersection */
  bool intersect(const Vector3D& O, float radius);
  /** Point in box */
  bool intersect(const Vector3D& p) const;
  /** Aligned box intersection */
  bool intersect(const Box& b);
  /** Oriented box intersection. */
  bool intersect(const Box& b, RotationState& rs);

  /** Position of box corner */
  Vector3D m_Pos;
  /** Size of box box edges */
  Vector3D m_Size;
  /** Position of box center.  m_Pos+0.5f*m_Size;  */
  Vector3D m_Center;
};

/** A single triangle in the model */
class Triangle
{
public:
  /** Default constructor */
  Triangle() {}
  /** Constructor to build a triangle from 3 points */
  Triangle(const Vector3D& _1, const Vector3D& _2, const Vector3D& _3);
  /** Tests for intersection with another triangle. */
  bool intersect(const Triangle& t) const;
  /** Tests for intersection with a ray (O origin, D direction)
      Returns true if collision occured.
      Outputs collision point in cp
      Outputs the distance from the origin to the collision point in tparm
      This distance is relative to the magnitude of D
      Allows testing against a finite segment, by specifying 
      the maximum length of the ray in segmax
      This length is also relative to the magnitude of D
  */
  bool intersect(const Vector3D& O, const Vector3D& D, Vector3D& cp, 
                 float& tparm, float segmax);
  /** Test for intersection with a sphere (O origin) 
      Returns true if collision occured.
      Outputs collision point in cp
  */
  bool intersect(const Vector3D& O, float radius, Vector3D& cp);

  Vector3D v1,v2,v3;
  Vector3D center;
};

class BoxedTriangle;

/** Base class for hierarchy tree nodes. */
class BoxTreeNode : public Box
{
public:
  /** Default constructor */
  BoxTreeNode() : Box() {}
  /** Constructor for a box from position and size */
  BoxTreeNode(const Vector3D& pos, const Vector3D& size) 
    : Box(pos,size) {}
  /** Returns true if the node is a leaf node. */
  virtual bool isLeaf() const  = 0;
  /** Returns the number of sons this node has */
  virtual int            getSonsNumber() = 0;
  /** Returns a son node, by index */ 
  virtual BoxTreeNode*   getSon(int which) = 0;
  /** Returns the number of triangles in this node.
      Only non-zero for leaf nodes. */
  virtual int            getTrianglesNumber() = 0;
  /** Returns the boxed triangle contained in this node
      by its index 
  */
  virtual BoxedTriangle* getTriangle(int which) = 0;
};

/** Inner node, containing other nodes. */
class BoxTreeInnerNode : public BoxTreeNode
{
public:
  BoxTreeInnerNode(const Vector3D& pos, const Vector3D& size, int logdepth) 
    : BoxTreeNode(pos,size), m_First(NULL), m_Second(NULL), 
      m_logdepth(logdepth) {};
  virtual bool isLeaf() const { return false; }
  /** Create the sons that will divide this box */
  int  createSons(const Vector3D& center);
  /** Recalculate the bounds of this box to fully contain
      all of its triangles
  */
  void recalcBounds(Vector3D& center);
  /** Recursively divide this box */
  int  divide(int p_depth);

  int getSonsNumber()
  {
    int n=0;
    if (m_First!=NULL) n++;
    if (m_Second!=NULL) n++;
    return n;
  }

  int getTrianglesNumber();
  BoxedTriangle* getTriangle(int which);

  BoxTreeNode* getSon(int which)
  {
    if (which==0) return m_First;
    if (which==1) return m_Second;
    return NULL;
  }

  BoxTreeNode*                m_First;
  BoxTreeNode*                m_Second;
  int                         m_logdepth;
  std::vector<BoxedTriangle*> m_Boxes;
};

/** Leaf node, containing 1 triangle. */
class BoxedTriangle : public BoxTreeNode, public Triangle
{
public:
  BoxedTriangle(const Vector3D& _1, const Vector3D& _2, const Vector3D& _3);
  virtual bool isLeaf() const { return true; }
  int getSonsNumber() { return 0; }
  BoxTreeNode* getSon(int which) { return NULL; }
  int getTrianglesNumber() { return 1; }
  BoxedTriangle* getTriangle(int which)
  {
    if (which==0) return this;
    return NULL;
  }

};

__CD__END

#endif // H_BOX

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费看欧美女人艹b| 中文字幕一区二区三区在线不卡 | 91一区在线观看| 中文一区在线播放| 色综合天天综合狠狠| 亚洲一区在线观看免费观看电影高清| 日本韩国欧美在线| 日本视频一区二区| 国产欧美一区二区精品久导航 | 色播五月激情综合网| 一区二区三区蜜桃网| 337p亚洲精品色噜噜| 麻豆高清免费国产一区| 国产农村妇女毛片精品久久麻豆 | 91在线国产福利| 亚洲一区二区三区小说| 欧美videos大乳护士334| 成人免费电影视频| 亚洲成人av电影在线| 久久先锋影音av鲁色资源| thepron国产精品| 日韩精品亚洲一区二区三区免费| 久久久99久久精品欧美| 色综合久久综合网欧美综合网 | 欧美亚一区二区| 狠狠v欧美v日韩v亚洲ⅴ| 亚洲日本中文字幕区| 91精品国产乱| 99国产精品视频免费观看| 日韩精品一级中文字幕精品视频免费观看 | 国产在线乱码一区二区三区| 中文欧美字幕免费| 欧美日产在线观看| 成人伦理片在线| 免费观看30秒视频久久| 亚洲欧洲精品一区二区精品久久久 | 精品一区二区免费视频| 亚洲综合男人的天堂| 久久综合久久综合久久| 欧美性色黄大片| 成人app软件下载大全免费| 天天综合网天天综合色| 国产精品免费视频观看| 精品国内片67194| 欧美最新大片在线看| 国产不卡免费视频| 久久 天天综合| 婷婷久久综合九色综合绿巨人| 国产精品久久久久久亚洲毛片 | 久久久一区二区三区捆绑**| 欧美日韩在线播放一区| 成人av网址在线观看| 精品系列免费在线观看| 天使萌一区二区三区免费观看| 国产精品第四页| 久久香蕉国产线看观看99| 欧美一区二区在线看| 在线精品视频一区二区三四| 成人动漫视频在线| 国产成人在线视频播放| 国内精品伊人久久久久影院对白| 亚洲gay无套男同| 亚洲福利视频一区| 亚洲国产精品尤物yw在线观看| 国产精品久久夜| 国产午夜精品一区二区三区嫩草 | 色哟哟精品一区| 成人性生交大片免费看在线播放| 国产最新精品免费| 久久国产精品一区二区| 男女视频一区二区| 日韩影院免费视频| 美女mm1313爽爽久久久蜜臀| 日本在线不卡一区| 日日夜夜免费精品视频| 五月天亚洲婷婷| 麻豆91在线播放| 久久激情综合网| 韩日欧美一区二区三区| 国产精品综合视频| 成人国产亚洲欧美成人综合网| 高清shemale亚洲人妖| 国产宾馆实践打屁股91| a亚洲天堂av| 在线观看免费一区| 在线成人午夜影院| 欧美成人a在线| 久久先锋资源网| 中文字幕一区二区5566日韩| 亚洲婷婷综合色高清在线| 亚洲一区二区偷拍精品| 日韩电影在线免费| 国产一区 二区| 色综合久久中文字幕| 欧美色涩在线第一页| 欧美一区二区免费| 国产日产精品1区| 亚洲激情欧美激情| 青青草原综合久久大伊人精品优势 | 欧美精品一区二区在线观看| 国产亚洲一区二区三区在线观看| 中文字幕精品—区二区四季| 一区二区在线观看不卡| 日韩高清电影一区| 丰满亚洲少妇av| 欧美亚一区二区| 精品福利一二区| 亚洲视频一二三区| 奇米四色…亚洲| proumb性欧美在线观看| 3d成人h动漫网站入口| 国产欧美一区二区精品秋霞影院 | 91精品国产免费| 国产精品美女久久福利网站| 一区2区3区在线看| 国内欧美视频一区二区| 成人国产精品免费| 666欧美在线视频| 亚洲欧洲日韩在线| 久久99精品国产麻豆婷婷洗澡| 成人av影院在线| 日韩欧美在线一区二区三区| 国产精品久久久久久妇女6080| 午夜av一区二区三区| www.欧美日韩| 久久综合精品国产一区二区三区 | 91精品在线麻豆| 国产亚洲婷婷免费| 日本中文一区二区三区| 97精品久久久久中文字幕| 欧美成人精品高清在线播放| 一区二区三区四区在线免费观看| 久久精品国产精品亚洲红杏| 91福利在线看| 国产日产欧美一区| 久久精品国产一区二区三| 欧美亚洲国产怡红院影院| 中文字幕av一区二区三区免费看 | av电影一区二区| 精品粉嫩超白一线天av| 午夜精品久久久久久不卡8050| 不卡大黄网站免费看| 久久理论电影网| 久久超级碰视频| 欧美日韩成人在线一区| 亚洲精品一卡二卡| 北条麻妃一区二区三区| 国产三级精品三级在线专区| 免费观看日韩av| 欧美一区二区视频在线观看2020 | 91麻豆精品国产91| 亚洲一区二区欧美激情| 色婷婷亚洲精品| 亚洲色图视频免费播放| av欧美精品.com| 国产精品网站在线播放| 精品一区二区影视| 欧美tk—视频vk| 精品系列免费在线观看| 精品久久免费看| 九九久久精品视频| 欧美精品一区在线观看| 国产精品一区二区免费不卡| 2017欧美狠狠色| 国产麻豆午夜三级精品| 国产亚洲一区字幕| 成人黄色免费短视频| 国产精品久久久久久久久免费丝袜| 国产精品资源在线观看| 欧美大片拔萝卜| 国产成人亚洲综合a∨婷婷| 国产欧美一区二区精品性| 成人综合婷婷国产精品久久免费| 国产亚洲综合性久久久影院| 成人午夜视频在线观看| 亚洲啪啪综合av一区二区三区| 91日韩一区二区三区| 自拍偷自拍亚洲精品播放| 91国产福利在线| 午夜私人影院久久久久| 日韩一级二级三级精品视频| 免费人成黄页网站在线一区二区| 欧美变态凌虐bdsm| 成人网页在线观看| 亚洲品质自拍视频| 3d动漫精品啪啪一区二区竹菊| 国内精品伊人久久久久av一坑 | 欧美一区二区网站| 国产成人福利片| 亚洲嫩草精品久久| 69堂精品视频| 成人听书哪个软件好| 亚洲精品成人在线| 日韩一区二区三区av| 成人av免费在线观看| 亚洲国产日日夜夜| 欧美成人一级视频| 97久久精品人人做人人爽| 日本最新不卡在线| 国产精品国产自产拍高清av王其|