Panda3D

Loading...
Searching...
No Matches
physxContactPoint.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 physxContactPoint.h
10 * @author enn0x
11 * @date 2009-12-20
12 */
13
14#ifndef PHYSXCONTACTPOINT_H
15#define PHYSXCONTACTPOINT_H
16
17#include "pandabase.h"
18#include "luse.h"
19#include "typedObject.h"
20
21#include "config_physx.h"
22
23 class PhysxShape;
24
25/**
26 * A helper structure for iterating over contact streams reported by
27 * PhysxContactPair.
28 */
29 class EXPCL_PANDAPHYSX PhysxContactPoint : public TypedObject {
30
31PUBLISHED:
32 INLINE PhysxContactPoint();
33 INLINE ~PhysxContactPoint();
34
35 LPoint3f get_point() const;
36 LVector3f get_normal() const;
37 float get_normal_force() const;
38 float get_separation() const;
39 unsigned int get_feature_index0() const;
40 unsigned int get_feature_index1() const;
41
42 public:
43 static PhysxContactPoint empty();
44
45 void set(NxContactStreamIterator it);
46
47 private:
48 NxVec3 _point;
49 NxVec3 _normal;
50 NxReal _normal_force;
51 NxReal _separation;
52 NxU32 _feature_index0;
53 NxU32 _feature_index1;
54
55 public:
56 static TypeHandle get_class_type() {
57 return _type_handle;
58 }
59 static void init_type() {
60 TypedReferenceCount::init_type();
61 register_type(_type_handle, "PhysxContactPoint",
62 TypedReferenceCount::get_class_type());
63 }
64 virtual TypeHandle get_type() const {
65 return get_class_type();
66 }
67 virtual TypeHandle force_init_type() {
68 init_type();
69 return get_class_type();
70 }
71
72 private:
73 static TypeHandle _type_handle;
74};
75
76#include "physxContactPoint.I"
77
78#endif // PHYSXCONTACTPOINT_H
PhysxContactPoint::get_point
LPoint3f get_point() const
Returns the contact point position.
Definition physxContactPoint.cxx:48
PhysxContactPoint::get_feature_index0
unsigned int get_feature_index0() const
Retrieves the feature index.
Definition physxContactPoint.cxx:84
PhysxContactPoint::get_feature_index1
unsigned int get_feature_index1() const
Retrieves the feature index.
Definition physxContactPoint.cxx:93
PhysxContactPoint::get_normal_force
float get_normal_force() const
Retrieves the point normal force.
Definition physxContactPoint.cxx:66
PhysxContactPoint::get_normal
LVector3f get_normal() const
Retrieves the patch normal.
Definition physxContactPoint.cxx:57
PhysxContactPoint::get_separation
float get_separation() const
Return the separation for the contact point.
Definition physxContactPoint.cxx:75
PhysxShape
Abstract base class for shapes.
Definition physxShape.h:39
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
TypedObject::init_type
static void init_type()
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Definition typedObject.cxx:44
config_physx.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
luse.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxContactPoint.I
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
typedObject.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.