Back to index

supertuxkart  0.5+dfsg1
btConvexCast.h
Go to the documentation of this file.
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 CONVEX_CAST_H
00018 #define 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 
00043               CastResult()
00044                      :m_fraction(btScalar(1e30)),
00045                      m_debugDrawer(0)
00046               {
00047               }
00048 
00049 
00050               virtual ~CastResult() {};
00051 
00052               btVector3     m_normal;
00053               btVector3   m_hitPoint;
00054               btScalar      m_fraction;
00055               btTransform   m_hitTransformA;
00056               btTransform   m_hitTransformB;
00057 
00058               btIDebugDraw* m_debugDrawer;
00059 
00060        };
00061 
00062 
00064        virtual bool  calcTimeOfImpact(
00065                                    const btTransform& fromA,
00066                                    const btTransform& toA,
00067                                    const btTransform& fromB,
00068                                    const btTransform& toB,
00069                                    CastResult& result) = 0;
00070 };
00071 
00072 #endif //CONVEX_CAST_H