00001 /*************************************************************************** 00002 00003 This source file is part of OGREBULLET 00004 (Object-oriented Graphics Rendering Engine Bullet Wrapper) 00005 For the latest info, see http://www.ogre3d.org/phpBB2addons/viewforum.php?f=10 00006 00007 Copyright (c) 2007 tuan.kuranes@gmail.com (Use it Freely, even Statically, but have to contribute any changes) 00008 00009 00010 00011 Permission is hereby granted, free of charge, to any person obtaining a copy 00012 of this software and associated documentation files (the "Software"), to deal 00013 in the Software without restriction, including without limitation the rights 00014 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00015 copies of the Software, and to permit persons to whom the Software is 00016 furnished to do so, subject to the following conditions: 00017 00018 The above copyright notice and this permission notice shall be included in 00019 all copies or substantial portions of the Software. 00020 00021 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00022 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00023 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00024 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00025 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00026 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00027 THE SOFTWARE. 00028 ----------------------------------------------------------------------------- 00029 */ 00030 #ifndef _OgreBulletCollisions_DEBUGLines_H_ 00031 #define _OgreBulletCollisions_DEBUGLines_H_ 00032 00033 #include "OgreBulletCollisionsPreRequisites.h" 00034 00035 namespace OgreBulletCollisions 00036 { 00037 //------------------------------------------------------------------------------------------------ 00038 class DebugLines:public Ogre::SimpleRenderable 00039 { 00040 public: 00041 DebugLines(void); 00042 ~DebugLines(void); 00043 00044 void addLine (const Ogre::Vector3 &start,const Ogre::Vector3 &end) 00045 { 00046 clear (); 00047 00048 _points.push_back (start); 00049 _points.push_back (end); 00050 } 00051 00052 void addLine(Ogre::Real start_x, Ogre::Real start_y, Ogre::Real start_z, 00053 Ogre::Real end_x, Ogre::Real end_y, Ogre::Real end_z) 00054 { 00055 addLine (Ogre::Vector3(start_x,start_y,start_z), 00056 Ogre::Vector3(end_x,end_y,end_z)); 00057 } 00058 00059 void addPoint (const Ogre::Vector3 &pt) 00060 { 00061 clear(); 00062 00063 _points.push_back(pt); 00064 } 00065 00066 void addPoint (Ogre::Real x, Ogre::Real y, Ogre::Real z) 00067 { 00068 addPoint (Ogre::Vector3(x, y, z)); 00069 } 00070 00071 void draw (); 00072 void clear (); 00073 00074 Ogre::Real getSquaredViewDepth (const Ogre::Camera *cam) const; 00075 Ogre::Real getBoundingRadius (void) const; 00076 00077 protected: 00078 00079 Vector3Array _points; 00080 bool _drawn; 00081 00082 static bool _materials_created; 00083 }; 00084 } 00085 #endif //_OgreBulletCollisions_DEBUGLines_H_ 00086
1.7.1