00001 /* 00002 Bullet Continuous Collision Detection and Physics Library 00003 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ 00004 00005 This software is provided 'as-is', without any express or implied warranty. 00006 In no event will the authors be held liable for any damages arising from the use of this software. 00007 Permission is granted to anyone to use this software for any purpose, 00008 including commercial applications, and to alter it and redistribute it freely, 00009 subject to the following restrictions: 00010 00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 00013 3. This notice may not be removed or altered from any source distribution. 00014 */ 00015 00016 00017 #ifndef BT_CONVEX_CAST_H 00018 #define BT_CONVEX_CAST_H 00019 00020 #include "LinearMath/btTransform.h" 00021 #include "LinearMath/btVector3.h" 00022 #include "LinearMath/btScalar.h" 00023 class btMinkowskiSumShape; 00024 #include "LinearMath/btIDebugDraw.h" 00025 00027 class btConvexCast 00028 { 00029 public: 00030 00031 00032 virtual ~btConvexCast(); 00033 00036 struct CastResult 00037 { 00038 //virtual bool addRayResult(const btVector3& normal,btScalar fraction) = 0; 00039 00040 virtual void DebugDraw(btScalar fraction) {(void)fraction;} 00041 virtual void drawCoordSystem(const btTransform& trans) {(void)trans;} 00042 virtual void reportFailure(int errNo, int numIterations) {(void)errNo;(void)numIterations;} 00043 CastResult() 00044 :m_fraction(btScalar(BT_LARGE_FLOAT)), 00045 m_debugDrawer(0), 00046 m_allowedPenetration(btScalar(0)) 00047 { 00048 } 00049 00050 00051 virtual ~CastResult() {}; 00052 00053 btTransform m_hitTransformA; 00054 btTransform m_hitTransformB; 00055 btVector3 m_normal; 00056 btVector3 m_hitPoint; 00057 btScalar m_fraction; //input and output 00058 btIDebugDraw* m_debugDrawer; 00059 btScalar m_allowedPenetration; 00060 00061 }; 00062 00063 00065 virtual bool calcTimeOfImpact( 00066 const btTransform& fromA, 00067 const btTransform& toA, 00068 const btTransform& fromB, 00069 const btTransform& toB, 00070 CastResult& result) = 0; 00071 }; 00072 00073 #endif //BT_CONVEX_CAST_H