Panda3D
|
00001 // Filename: physxContactPair.h 00002 // Created by: enn0x (19Dec09) 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 PHYSXCONTACTPAIR_H 00016 #define PHYSXCONTACTPAIR_H 00017 00018 #include "pandabase.h" 00019 #include "luse.h" 00020 #include "typedReferenceCount.h" 00021 #include "pvector.h" 00022 00023 #include "config_physx.h" 00024 00025 class PhysxShape; 00026 class PhysxContactPoint; 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Class : PhysxContactPair 00030 // Description : An instance of this class is send with contact 00031 // reporting events. It contains detailed information 00032 // on the contact. 00033 //////////////////////////////////////////////////////////////////// 00034 class EXPCL_PANDAPHYSX PhysxContactPair : public TypedReferenceCount { 00035 00036 PUBLISHED: 00037 INLINE ~PhysxContactPair(); 00038 00039 bool is_deleted_a() const; 00040 bool is_deleted_b() const; 00041 PhysxActor *get_actor_a() const; 00042 PhysxActor *get_actor_b() const; 00043 LVector3f get_sum_normal_force() const; 00044 LVector3f get_sum_friction_force() const; 00045 00046 unsigned int get_num_contact_points(); 00047 PhysxContactPoint get_contact_point(unsigned int idx) const; 00048 MAKE_SEQ(get_contact_points, get_num_contact_points, get_contact_point); 00049 00050 public: 00051 INLINE PhysxContactPair(const NxContactPair pair); 00052 00053 private: 00054 NxContactPair _pair; 00055 pvector<PhysxContactPoint> _contacts; 00056 00057 //////////////////////////////////////////////////////////////////// 00058 public: 00059 static TypeHandle get_class_type() { 00060 return _type_handle; 00061 } 00062 static void init_type() { 00063 TypedReferenceCount::init_type(); 00064 register_type(_type_handle, "PhysxContactPair", 00065 TypedReferenceCount::get_class_type()); 00066 } 00067 virtual TypeHandle get_type() const { 00068 return get_class_type(); 00069 } 00070 virtual TypeHandle force_init_type() { 00071 init_type(); 00072 return get_class_type(); 00073 } 00074 00075 private: 00076 static TypeHandle _type_handle; 00077 }; 00078 00079 #include "physxContactPair.I" 00080 00081 #endif // PHYSXCONTACTPAIR_H