00001 /*************************************************************************** 00002 * Copyright (C) 2005 by the G System Team * 00003 * http://www.g-system.at * 00004 * * 00005 * Permission is hereby granted, free of charge, to any person obtaining * 00006 * a copy of this software and associated documentation files (the * 00007 * "Software"), to deal in the Software without restriction, including * 00008 * without limitation the rights to use, copy, modify, merge, publish, * 00009 * distribute, sublicense, and/or sell copies of the Software, and to * 00010 * permit persons to whom the Software is furnished to do so, subject to * 00011 * the following conditions: * 00012 * * 00013 * The above copyright notice and this permission notice shall be * 00014 * included in all copies or substantial portions of the Software. * 00015 * * 00016 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * 00017 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 00018 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.* 00019 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR * 00020 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * 00021 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * 00022 * OTHER DEALINGS IN THE SOFTWARE. * 00023 ***************************************************************************/ 00024 00025 #ifndef GBEGPHYSICSUTILS_H 00026 #define GBEGPHYSICSUTILS_H 00027 00028 #include <GMatrix44.h> 00029 #include <GVector3.h> 00030 #include <GPlane.h> 00031 00032 #include <qobject.h> 00033 00034 namespace GBE { 00035 00039 class GPhysicsUtils 00040 { 00041 00042 public: 00043 00044 GPhysicsUtils(); 00045 00046 ~GPhysicsUtils(); 00047 static bool PointHitsAABox(const GCS::GVector3& point, const GCS::GVector3& boxMin, const GCS::GVector3& boxMax); 00051 00052 00056 static bool PointHitsBox(const GCS::GVector3& point, const GCS::GPlane* boxPlanes); 00057 00058 static GCS::GPlane* ComputeBoxPlanes(const GCS::GVector3& boxMin, 00059 const GCS::GVector3& boxMax, 00060 const GCS::GMatrix44& boxTransformation); 00061 00065 static bool PointHitsBox(const GCS::GVector3& point, const GCS::GVector3& boxMin, const GCS::GVector3& boxMax, const GCS::GMatrix44& boxTransformation); 00066 00067 }; 00068 00069 }; 00070 00071 #endif
1.4.7