Panda3D
 All Classes Functions Variables Enumerations
physxContactPair.h
1 // Filename: physxContactPair.h
2 // Created by: enn0x (19Dec09)
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 PHYSXCONTACTPAIR_H
16 #define PHYSXCONTACTPAIR_H
17 
18 #include "pandabase.h"
19 #include "luse.h"
20 #include "typedReferenceCount.h"
21 #include "pvector.h"
22 
23 #include "config_physx.h"
24 
25 class PhysxShape;
26 class PhysxContactPoint;
27 
28 ////////////////////////////////////////////////////////////////////
29 // Class : PhysxContactPair
30 // Description : An instance of this class is send with contact
31 // reporting events. It contains detailed information
32 // on the contact.
33 ////////////////////////////////////////////////////////////////////
34 class EXPCL_PANDAPHYSX PhysxContactPair : public TypedReferenceCount {
35 
36 PUBLISHED:
37  INLINE ~PhysxContactPair();
38 
39  bool is_deleted_a() const;
40  bool is_deleted_b() const;
41  PhysxActor *get_actor_a() const;
42  PhysxActor *get_actor_b() const;
43  LVector3f get_sum_normal_force() const;
44  LVector3f get_sum_friction_force() const;
45 
46  unsigned int get_num_contact_points();
47  PhysxContactPoint get_contact_point(unsigned int idx) const;
48  MAKE_SEQ(get_contact_points, get_num_contact_points, get_contact_point);
49 
50 public:
51  INLINE PhysxContactPair(const NxContactPair pair);
52 
53 private:
54  NxContactPair _pair;
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, "PhysxContactPair",
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 "physxContactPair.I"
80 
81 #endif // PHYSXCONTACTPAIR_H
Abstract base class for shapes.
Definition: physxShape.h:41
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
A helper structure for iterating over contact streams reported by PhysxContactPair.
Actors are the main simulation objects.
Definition: physxActor.h:48
An instance of this class is send with contact reporting events.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85