Panda3D

bulletContactResult.h

00001 // Filename: bulletContactResult.h
00002 // Created by:  enn0x (08Mar10)
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_CONTACT_RESULT_H__
00016 #define __BULLET_CONTACT_RESULT_H__
00017 
00018 #include "pandabase.h"
00019 
00020 #include "bullet_includes.h"
00021 #include "bulletManifoldPoint.h"
00022 
00023 #include "pvector.h"
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : BulletContact
00027 // Description : 
00028 ////////////////////////////////////////////////////////////////////
00029 struct EXPCL_PANDABULLET BulletContact {
00030 
00031 PUBLISHED:
00032   INLINE const BulletManifoldPoint *get_manifold_point() const;
00033   INLINE PandaNode *get_node0() const;
00034   INLINE PandaNode *get_node1() const;
00035   INLINE const int get_idx0() const;
00036   INLINE const int get_idx1() const;
00037   INLINE const int get_part_id0() const;
00038   INLINE const int get_part_id1() const;
00039 
00040 private:
00041   btManifoldPoint *_mp;
00042   const btCollisionObject *_obj0;
00043   const btCollisionObject *_obj1;
00044   int _part_id0;
00045   int _part_id1;
00046   int _idx0;
00047   int _idx1;
00048 
00049   friend struct BulletContactResult;
00050 };
00051 
00052 ////////////////////////////////////////////////////////////////////
00053 //       Class : BulletContactResult
00054 // Description : 
00055 ////////////////////////////////////////////////////////////////////
00056 struct EXPCL_PANDABULLET BulletContactResult : public btCollisionWorld::ContactResultCallback {
00057 
00058 PUBLISHED:
00059   INLINE int get_num_contacts() const;
00060   INLINE const BulletContact &get_contact(int idx) const;
00061   MAKE_SEQ(get_contacts, get_num_contacts, get_contact);
00062 
00063 public:
00064   virtual btScalar addSingleResult(btManifoldPoint &mp,
00065       const btCollisionObject *obj0, int part_id0, int idx0,
00066       const btCollisionObject *obj1, int part_id1, int idx1);
00067 
00068 protected:
00069   BulletContactResult();
00070 
00071 private:
00072   static BulletContact _empty;
00073 
00074   pvector<BulletContact> _contacts;
00075 
00076   friend class BulletWorld;
00077 };
00078 
00079 #include "bulletContactResult.I"
00080 
00081 #endif // __BULLET_CONTACT_RESULT_H__
 All Classes Functions Variables Enumerations