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

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

?? ogreorientedbox.h

?? opcode是功能強大
?? H
字號:
///////////////////////////////////////////////////////////////////////////////
///  @file OgreOBB.h
///  @brief This class represents an Oriented Bounding Box, which is composed by 
///
///  @author The OgreOpcode Team
///  
///////////////////////////////////////////////////////////////////////////////
///  
///  This file is part of OgreOpcode.
///  
///  A lot of the code is based on the Nebula Opcode Collision module, see docs/Nebula_license.txt
///  
///  OgreOpcode is free software; you can redistribute it and/or
///  modify it under the terms of the GNU Lesser General Public
///  License as published by the Free Software Foundation; either
///  version 2.1 of the License, or (at your option) any later version.
///  
///  OgreOpcode 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
///  Lesser General Public License for more details.
///  
///  You should have received a copy of the GNU Lesser General Public
///  License along with OgreOpcode; if not, write to the Free Software
///  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
///  
///////////////////////////////////////////////////////////////////////////////
#ifndef __OgreOrientedBoundingBoxes_h__
#define __OgreOrientedBoundingBoxes_h__

#include "OgreOpcodeMath.h"

namespace OgreOpcode
{
	namespace Details
	{
		/// Defines an Oriented Bounding Box (OBB). Courtesy from Gilvan Maia :P
		/// Differently from AABB's (Axis-Aligned Bounding-Boxes), OBBs are not
		/// limited to be aligned with the coordinate axes. Thus, it can fit objects
		/// much more tightly just because it is adaptive to the object's orientation,
		/// ie, its orientation can be adjusted in order to reduce its volume - this is.
		/// why it would be preferred for collision detection.
		class _OgreOpcode_Export OrientedBox
		{
		public:

			/// Builds an unitary box at origin, aligned with the coordinated axes. 
			OrientedBox():center(),extents(0.5,0.5,0.5),rot(Ogre::Matrix3::IDENTITY)
			{
			}

			OrientedBox( const Details::bbox3& box ):rot(Ogre::Matrix3::IDENTITY)
			{ 
				extents = (box.vmax - box.vmin)*0.5;
				center = box.vmin + extents;
			}

			/// Copy-constructor
			OrientedBox(const OrientedBox& obb ):center(obb.center),extents(obb.extents),rot(obb.rot)
			{
			}

			/// "Complete" constructor
			OrientedBox(const Ogre::Vector3& c, const Ogre::Vector3& ex, const Ogre::Matrix3& axes  ):center(c),extents(ex),rot(axes)
			{
			}

			/// Gets the volume of this OBB
			inline Ogre::Real volume() const
			{
				return extents.x *extents.y *extents.z * 8.0;
			}

			/// returns true if the given point is inside this box
			bool contains(const Ogre::Vector3& point ) const
			{
				Ogre::Vector3 L = point - center;

				Ogre::Real coord = rot.GetColumn(0).dotProduct( L );
				if( coord > extents.x || coord < -extents.x ) return false;

				coord = rot.GetColumn(1).dotProduct( L );
				if( coord > extents.y || coord < -extents.y ) return false;

				coord = rot.GetColumn(2).dotProduct( L );
				if( coord > extents.z || coord < -extents.z ) return false;

				return true;
			}

			/** Checks intersection againts an Axis-Aligned Bounding Box
			 */
			bool intersects( const bbox3& box ) const;

			/** Is this oriented box intersecting the given one?
			 */
			bool intersects( const OrientedBox& obb ) const;

			/** Is this oriented box intersecting the given sphere?
			 */
			bool intersects( const sphere& s )
			{
				//  Modified from Magic-Software http://www.magic-software.com
				Ogre::Vector3 kCDiff = s.p - center;

				Ogre::Real fAx = Ogre::Math::Abs(kCDiff.dotProduct(rot.GetColumn(0)) );
				Ogre::Real fAy = Ogre::Math::Abs(kCDiff.dotProduct(rot.GetColumn(1)) );
				Ogre::Real fAz = Ogre::Math::Abs(kCDiff.dotProduct(rot.GetColumn(2)) );
				Ogre::Real fDx = fAx - extents.x;
				Ogre::Real fDy = fAy - extents.y;
				Ogre::Real fDz = fAz - extents.z;

				if ( fAx <= extents[0] )
				{
					if ( fAy <= extents[1] )
					{
						if ( fAz <= extents[2] )
							// sphere center inside box
							return true;
						else
							// potential sphere-face intersection with face z
							return fDz <= s.r;
					}
					else
					{
						if ( fAz <= extents[2] )
							// potential sphere-face intersection with face y
							return fDy <= s.r;
						else
							// potential sphere-edge intersection with edge formed
							// by faces y and z							
							return fDy*fDy + fDz*fDz <= (s.r*s.r);
					}
				}
				else
				{
					if ( fAy <= extents[1] )
					{
						if ( fAz <= extents[2] )
							// potential sphere-face intersection with face x
							return fDx <= s.r;
						else
							// potential sphere-edge intersection with edge formed
							// by faces x and z
							return fDx*fDx + fDz*fDz <= (s.r*s.r);
					}
					else
					{
						if ( fAz <= extents[2] )
							// potential sphere-edge intersection with edge formed
							// by faces x and y
							return fDx*fDx + fDy*fDy <= (s.r*s.r);
						else
							// potential sphere-vertex intersection at corner formed
							// by faces x,y,z
							return fDx*fDx + fDy*fDy + fDz*fDz <= (s.r*s.r);
					}
				}
			}

			/// Gets the extents of this oriented box
			const Ogre::Vector3& getExtents() const
			{
				return extents;
			}

			/// Gets the center of this oriented box
			const Ogre::Vector3& getCenter() const
			{
				return center;
			}

			const Ogre::Matrix3& getOrientation() const
			{
				return rot;
			}


		public:

			/// Center of this box
			Ogre::Vector3 center;

			/// The extents of this box, ie, the semi-lengths of this box 0.5*(width,height,depth )
			Ogre::Vector3 extents;

			/// A rotation matrix describing the orientation of this box.
			/// Each of its collumns define the axes corresponding to the orientation of this box.
			Ogre::Matrix3 rot;
		};

		/// Just for ease of use, let OrientedBox be an OBB. :P
		typedef OrientedBox OBB;	


	} // namespace Details
} // namespace OgreOpcode


#endif // __OgreCollisionTypes_h__

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区在线视频观看| 国产精品青草综合久久久久99| www.亚洲精品| 成人性生交大合| 成人激情黄色小说| 国产成人日日夜夜| 成人精品鲁一区一区二区| 国产真实乱对白精彩久久| 精品中文字幕一区二区| 美女一区二区视频| 久久成人18免费观看| 激情欧美一区二区三区在线观看| 久久精品二区亚洲w码| 久久99久久精品| 国产成人午夜高潮毛片| 成人丝袜视频网| 色综合天天综合给合国产| 在线一区二区三区四区| 欧美福利电影网| 久久久久综合网| 成人免费小视频| 亚洲国产一区二区a毛片| 美腿丝袜在线亚洲一区 | 亚洲欧美一区二区三区极速播放| 国产精品全国免费观看高清| 一区二区在线观看视频| 人人狠狠综合久久亚洲| 国产一区二区导航在线播放| 成人动漫精品一区二区| 欧美日韩一级二级| 国产午夜亚洲精品理论片色戒 | 91美女精品福利| 欧美一区二区三区四区高清| 亚洲国产精品激情在线观看| 夜夜精品视频一区二区 | 色94色欧美sute亚洲线路一久| 制服丝袜在线91| 欧美激情一区二区三区蜜桃视频| 亚洲精品综合在线| 美国十次了思思久久精品导航| k8久久久一区二区三区| 欧美精三区欧美精三区| 中文字幕av不卡| 美女视频免费一区| 91免费小视频| 久久综合狠狠综合久久综合88 | 美国欧美日韩国产在线播放| 91麻豆精品视频| 精品久久国产老人久久综合| 亚洲美女淫视频| 国产夫妻精品视频| 51精品国自产在线| 亚洲精品你懂的| 不卡av免费在线观看| 欧美不卡123| 日韩国产精品久久久| 99精品久久免费看蜜臀剧情介绍| 精品美女被调教视频大全网站| 夜夜操天天操亚洲| 成人在线视频一区| 亚洲精品一区二区三区香蕉| 午夜成人免费电影| 色欧美片视频在线观看在线视频| 国产午夜精品一区二区| 麻豆精品一区二区综合av| 色天天综合色天天久久| 亚洲色图在线播放| 成人性生交大片免费看在线播放| 久久久久久夜精品精品免费| 精品一区二区三区免费观看| 日韩视频免费观看高清在线视频| 亚洲福利电影网| 色婷婷久久久久swag精品| 亚洲欧美日韩国产综合在线| 粉嫩高潮美女一区二区三区 | www.日韩在线| 中文字幕精品—区二区四季| 国产一区二区三区免费观看| 久久亚洲捆绑美女| 麻豆免费看一区二区三区| 日韩免费高清电影| 久久精品99久久久| 久久蜜桃一区二区| 丁香啪啪综合成人亚洲小说 | 高清av一区二区| 国产欧美精品一区二区色综合朱莉| 国产乱人伦偷精品视频免下载| 2014亚洲片线观看视频免费| 国产很黄免费观看久久| 国产精品毛片a∨一区二区三区| 99v久久综合狠狠综合久久| 国产精品视频在线看| 99久久精品国产一区| 亚洲精品视频在线观看免费| 欧美人与性动xxxx| 婷婷成人激情在线网| 日韩免费一区二区| 成人免费看片app下载| 亚洲中国最大av网站| 欧美久久久久久久久| 国产一本一道久久香蕉| 中文字幕视频一区| 欧美日韩不卡视频| 蜜桃视频一区二区| 亚洲欧洲日韩一区二区三区| 欧美精品18+| 国产suv一区二区三区88区| 亚洲婷婷综合色高清在线| 欧美日韩国产一区| 国产精品一二二区| 亚洲国产一区二区三区| 久久精品在这里| 欧美性受xxxx| 国产成人综合网| 五月天久久比比资源色| 国产性天天综合网| 欧美日韩在线不卡| 国产91综合一区在线观看| 亚洲电影第三页| 欧美国产激情二区三区| 欧美午夜精品一区二区蜜桃| 国产一区二区h| 香蕉影视欧美成人| 国产精品视频一二| 91精品国产综合久久久蜜臀图片 | 一区二区三区波多野结衣在线观看 | 懂色av噜噜一区二区三区av| 亚洲国产一区在线观看| 中文成人综合网| 91精品国产综合久久久蜜臀图片 | 国产一区二区不卡| 亚洲成人动漫一区| 自拍偷拍国产精品| 久久一日本道色综合| 欧美日韩国产综合一区二区| 97久久精品人人澡人人爽| 久久超碰97中文字幕| 亚洲成人av电影| 亚洲精品亚洲人成人网在线播放| 欧美激情资源网| 久久嫩草精品久久久久| 欧美变态tickle挠乳网站| 欧美精品久久久久久久多人混战 | 欧美sm美女调教| 欧美裸体bbwbbwbbw| 一本大道久久精品懂色aⅴ| 高清av一区二区| 国产**成人网毛片九色 | 久99久精品视频免费观看| 亚洲成精国产精品女| 一区二区三区免费网站| 中文字幕乱码一区二区免费| 欧美激情在线观看视频免费| 精品奇米国产一区二区三区| 精品国产污污免费网站入口| 欧美一级免费大片| 欧美一区二区三区四区五区 | 在线亚洲精品福利网址导航| av网站一区二区三区| aaa欧美色吧激情视频| 成人激情图片网| av在线不卡免费看| 一本色道久久综合亚洲91 | 亚洲国产精品av| 中文字幕中文字幕一区二区| 综合av第一页| 亚洲va国产天堂va久久en| 午夜激情一区二区三区| 日韩成人精品在线观看| 精久久久久久久久久久| 懂色av一区二区在线播放| 99精品偷自拍| 欧美精品久久99| xfplay精品久久| 国产精品久久久久一区二区三区| 亚洲男帅同性gay1069| 亚洲一区免费观看| 日韩av网站免费在线| 国产在线看一区| 91在线观看视频| 91精品综合久久久久久| 久久久亚洲高清| 中文字幕制服丝袜一区二区三区| 亚洲电影欧美电影有声小说| 精品亚洲porn| 91豆麻精品91久久久久久| 69p69国产精品| 国产农村妇女毛片精品久久麻豆 | 日韩美女一区二区三区四区| 国产精品免费丝袜| 亚洲欧美色图小说| 精油按摩中文字幕久久| aaa亚洲精品一二三区| 91精品国产91热久久久做人人| 久久美女艺术照精彩视频福利播放| 中文字幕亚洲欧美在线不卡| 麻豆成人在线观看| 91免费看视频| 久久精品欧美一区二区三区不卡 | 视频一区二区三区在线|