Panda3D
|
00001 // Filename: physxContactPoint.h 00002 // Created by: enn0x (20Dec09) 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 PHYSXCONTACTPOINT_H 00016 #define PHYSXCONTACTPOINT_H 00017 00018 #include "pandabase.h" 00019 #include "lvector3.h" 00020 #include "lpoint3.h" 00021 #include "typedObject.h" 00022 00023 #include "config_physx.h" 00024 00025 class PhysxShape; 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Class : PhysxContactPoint 00029 // Description : A helper structure for iterating over contact 00030 // streams reported by PhysxContactPair. 00031 //////////////////////////////////////////////////////////////////// 00032 class EXPCL_PANDAPHYSX PhysxContactPoint : public TypedObject { 00033 00034 PUBLISHED: 00035 INLINE PhysxContactPoint(); 00036 INLINE ~PhysxContactPoint(); 00037 00038 LPoint3f get_point() const; 00039 LVector3f get_normal() const; 00040 float get_normal_force() const; 00041 float get_separation() const; 00042 unsigned int get_feature_index0() const; 00043 unsigned int get_feature_index1() const; 00044 00045 public: 00046 static PhysxContactPoint empty(); 00047 00048 void set(NxContactStreamIterator it); 00049 00050 private: 00051 NxVec3 _point; 00052 NxVec3 _normal; 00053 NxReal _normal_force; 00054 NxReal _separation; 00055 NxU32 _feature_index0; 00056 NxU32 _feature_index1; 00057 00058 //////////////////////////////////////////////////////////////////// 00059 public: 00060 static TypeHandle get_class_type() { 00061 return _type_handle; 00062 } 00063 static void init_type() { 00064 TypedReferenceCount::init_type(); 00065 register_type(_type_handle, "PhysxContactPoint", 00066 TypedReferenceCount::get_class_type()); 00067 } 00068 virtual TypeHandle get_type() const { 00069 return get_class_type(); 00070 } 00071 virtual TypeHandle force_init_type() { 00072 init_type(); 00073 return get_class_type(); 00074 } 00075 00076 private: 00077 static TypeHandle _type_handle; 00078 }; 00079 00080 #include "physxContactPoint.I" 00081 00082 #endif // PHYSXCONTACTPOINT_H