Panda3D
 All Classes Functions Variables Enumerations
physxContactPoint.h
1 // Filename: physxContactPoint.h
2 // Created by: enn0x (20Dec09)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef PHYSXCONTACTPOINT_H
16 #define PHYSXCONTACTPOINT_H
17 
18 #include "pandabase.h"
19 #include "luse.h"
20 #include "typedObject.h"
21 
22 #include "config_physx.h"
23 
24 class PhysxShape;
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : PhysxContactPoint
28 // Description : A helper structure for iterating over contact
29 // streams reported by PhysxContactPair.
30 ////////////////////////////////////////////////////////////////////
31 class EXPCL_PANDAPHYSX PhysxContactPoint : public TypedObject {
32 
33 PUBLISHED:
34  INLINE PhysxContactPoint();
35  INLINE ~PhysxContactPoint();
36 
37  LPoint3f get_point() const;
38  LVector3f get_normal() const;
39  float get_normal_force() const;
40  float get_separation() const;
41  unsigned int get_feature_index0() const;
42  unsigned int get_feature_index1() const;
43 
44 public:
45  static PhysxContactPoint empty();
46 
47  void set(NxContactStreamIterator it);
48 
49 private:
50  NxVec3 _point;
51  NxVec3 _normal;
52  NxReal _normal_force;
53  NxReal _separation;
54  NxU32 _feature_index0;
55  NxU32 _feature_index1;
56 
57 ////////////////////////////////////////////////////////////////////
58 public:
59  static TypeHandle get_class_type() {
60  return _type_handle;
61  }
62  static void init_type() {
63  TypedReferenceCount::init_type();
64  register_type(_type_handle, "PhysxContactPoint",
65  TypedReferenceCount::get_class_type());
66  }
67  virtual TypeHandle get_type() const {
68  return get_class_type();
69  }
70  virtual TypeHandle force_init_type() {
71  init_type();
72  return get_class_type();
73  }
74 
75 private:
76  static TypeHandle _type_handle;
77 };
78 
79 #include "physxContactPoint.I"
80 
81 #endif // PHYSXCONTACTPOINT_H
static void init_type()
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Definition: typedObject.cxx:52
Abstract base class for shapes.
Definition: physxShape.h:41
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
Definition: typedObject.h:98
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
A helper structure for iterating over contact streams reported by PhysxContactPair.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85