Panda3D
physxContactPair.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file physxContactPair.h
10  * @author enn0x
11  * @date 2009-12-19
12  */
13 
14 #ifndef PHYSXCONTACTPAIR_H
15 #define PHYSXCONTACTPAIR_H
16 
17 #include "pandabase.h"
18 #include "luse.h"
19 #include "typedReferenceCount.h"
20 #include "pvector.h"
21 
22 #include "config_physx.h"
23 
24 class PhysxShape;
25 class PhysxContactPoint;
26 
27 /**
28  * An instance of this class is send with contact reporting events. It
29  * contains detailed information on the contact.
30  */
31 class EXPCL_PANDAPHYSX PhysxContactPair : public TypedReferenceCount {
32 
33 PUBLISHED:
34  INLINE ~PhysxContactPair();
35 
36  bool is_deleted_a() const;
37  bool is_deleted_b() const;
38  PhysxActor *get_actor_a() const;
39  PhysxActor *get_actor_b() const;
40  LVector3f get_sum_normal_force() const;
41  LVector3f get_sum_friction_force() const;
42 
43  unsigned int get_num_contact_points();
44  PhysxContactPoint get_contact_point(unsigned int idx) const;
45  MAKE_SEQ(get_contact_points, get_num_contact_points, get_contact_point);
46 
47 public:
48  INLINE PhysxContactPair(const NxContactPair pair);
49 
50 private:
51  NxContactPair _pair;
53 
54 public:
55  static TypeHandle get_class_type() {
56  return _type_handle;
57  }
58  static void init_type() {
59  TypedReferenceCount::init_type();
60  register_type(_type_handle, "PhysxContactPair",
61  TypedReferenceCount::get_class_type());
62  }
63  virtual TypeHandle get_type() const {
64  return get_class_type();
65  }
66  virtual TypeHandle force_init_type() {
67  init_type();
68  return get_class_type();
69  }
70 
71 private:
72  static TypeHandle _type_handle;
73 };
74 
75 #include "physxContactPair.I"
76 
77 #endif // PHYSXCONTACTPAIR_H
PhysxActor
Actors are the main simulation objects.
Definition: physxActor.h:44
pvector< PhysxContactPoint >
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pvector.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
TypedReferenceCount
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
Definition: typedReferenceCount.h:31
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
luse.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxContactPair.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PhysxContactPair
An instance of this class is send with contact reporting events.
Definition: physxContactPair.h:31
PhysxContactPoint
A helper structure for iterating over contact streams reported by PhysxContactPair.
Definition: physxContactPoint.h:29
PhysxShape
Abstract base class for shapes.
Definition: physxShape.h:39
typedReferenceCount.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
config_physx.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.