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 "luse.h" 00020 #include "typedObject.h" 00021 00022 #include "config_physx.h" 00023 00024 class PhysxShape; 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : PhysxContactPoint 00028 // Description : A helper structure for iterating over contact 00029 // streams reported by PhysxContactPair. 00030 //////////////////////////////////////////////////////////////////// 00031 class EXPCL_PANDAPHYSX PhysxContactPoint : public TypedObject { 00032 00033 PUBLISHED: 00034 INLINE PhysxContactPoint(); 00035 INLINE ~PhysxContactPoint(); 00036 00037 LPoint3f get_point() const; 00038 LVector3f get_normal() const; 00039 float get_normal_force() const; 00040 float get_separation() const; 00041 unsigned int get_feature_index0() const; 00042 unsigned int get_feature_index1() const; 00043 00044 public: 00045 static PhysxContactPoint empty(); 00046 00047 void set(NxContactStreamIterator it); 00048 00049 private: 00050 NxVec3 _point; 00051 NxVec3 _normal; 00052 NxReal _normal_force; 00053 NxReal _separation; 00054 NxU32 _feature_index0; 00055 NxU32 _feature_index1; 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, "PhysxContactPoint", 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 "physxContactPoint.I" 00080 00081 #endif // PHYSXCONTACTPOINT_H