Panda3D
|
00001 // Filename: bulletClosestHitRayResult.h 00002 // Created by: enn0x (21Feb10) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef __BULLET_CLOSEST_HIT_RAY_RESULT_H__ 00016 #define __BULLET_CLOSEST_HIT_RAY_RESULT_H__ 00017 00018 #include "pandabase.h" 00019 00020 #include "bullet_includes.h" 00021 #include "bullet_utils.h" 00022 00023 #include "luse.h" 00024 #include "pandaNode.h" 00025 #include "collideMask.h" 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Class : BulletClosestHitRayResult 00029 // Description : 00030 //////////////////////////////////////////////////////////////////// 00031 struct EXPCL_PANDABULLET BulletClosestHitRayResult : public btCollisionWorld::ClosestRayResultCallback { 00032 00033 PUBLISHED: 00034 INLINE static BulletClosestHitRayResult empty(); 00035 00036 LPoint3 get_from_pos() const; 00037 LPoint3 get_to_pos() const; 00038 00039 bool has_hit() const; 00040 00041 PandaNode *get_node() const; 00042 LPoint3 get_hit_pos() const; 00043 LVector3 get_hit_normal() const; 00044 PN_stdfloat get_hit_fraction() const; 00045 00046 public: 00047 virtual bool needsCollision(btBroadphaseProxy* proxy0) const; 00048 00049 private: 00050 BulletClosestHitRayResult(const btVector3 &from_pos, const btVector3 &to_pos, const CollideMask &mask); 00051 00052 CollideMask _mask; 00053 00054 friend class BulletWorld; 00055 }; 00056 00057 #include "bulletClosestHitRayResult.I" 00058 00059 #endif // __BULLET_CLOSEST_HIT_RAY_RESULT_H__