Panda3D
Loading...
Searching...
No Matches
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
24class PhysxShape;
26
27/**
28 * An instance of this class is send with contact reporting events. It
29 * contains detailed information on the contact.
30 */
31class EXPCL_PANDAPHYSX PhysxContactPair : public TypedReferenceCount {
32
33PUBLISHED:
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
47public:
48 INLINE PhysxContactPair(const NxContactPair pair);
49
50private:
51 NxContactPair _pair;
52 pvector<PhysxContactPoint> _contacts;
53
54public:
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
71private:
72 static TypeHandle _type_handle;
73};
74
75#include "physxContactPair.I"
76
77#endif // PHYSXCONTACTPAIR_H
Actors are the main simulation objects.
Definition physxActor.h:44
LVector3f get_sum_friction_force() const
Returns the total tangential force that was applied for this pair.
PhysxActor * get_actor_a() const
Returns the first of the two actors that makes up this pair.
get_num_contact_points
Returns the total number of contact points reported in this pair's contact stream.
LVector3f get_sum_normal_force() const
Returns the total contact normal force that was applied for this pair, to maintain nonpenetration con...
bool is_deleted_b() const
Returns true if the second of the two actors is deleted.
PhysxActor * get_actor_b() const
Returns the second of the two actors that make up his pair.
bool is_deleted_a() const
Returns true if the first of the two actors is deleted.
get_contact_point
Returns an instance of PhysxContactPoint, which represents a single entry of this pair's contact stre...
A helper structure for iterating over contact streams reported by PhysxContactPair.
Abstract base class for shapes.
Definition physxShape.h:39
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
STL class.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.