Panda3D
Loading...
Searching...
No Matches
physxContactPoint.cxx
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.cxx
10 * @author enn0x
11 * @date 2009-12-20
12 */
13
14#include "physxContactPoint.h"
15#include "physxManager.h"
16#include "physxShape.h"
17
18TypeHandle PhysxContactPoint::_type_handle;
19
20/**
21 *
22 */
23void PhysxContactPoint::
24set(NxContactStreamIterator it) {
25
26 _point = it.getPoint();
27 _normal = it.getPatchNormal();
28 _normal_force = it.getPointNormalForce();
29 _separation = it.getSeparation();
30 _feature_index0 = it.getFeatureIndex0();
31 _feature_index1 = it.getFeatureIndex1();
32}
33
34/**
35 *
36 */
37PhysxContactPoint PhysxContactPoint::
38empty() {
39
40 return PhysxContactPoint();
41}
42
43
44/**
45 * Returns the contact point position.
46 */
48get_point() const {
49
50 return PhysxManager::nxVec3_to_point3(_point);
51}
52
53/**
54 * Retrieves the patch normal.
55 */
57get_normal() const {
58
59 return PhysxManager::nxVec3_to_vec3(_normal);
60}
61
62/**
63 * Retrieves the point normal force.
64 */
66get_normal_force() const {
67
68 return _normal_force;
69}
70
71/**
72 * Return the separation for the contact point.
73 */
75get_separation() const {
76
77 return _separation;
78}
79
80/**
81 * Retrieves the feature index.
82 */
84get_feature_index0() const {
85
86 return _feature_index0;
87}
88
89/**
90 * Retrieves the feature index.
91 */
93get_feature_index1() const {
94
95 return _feature_index1;
96}
A helper structure for iterating over contact streams reported by PhysxContactPair.
LPoint3f get_point() const
Returns the contact point position.
unsigned int get_feature_index0() const
Retrieves the feature index.
unsigned int get_feature_index1() const
Retrieves the feature index.
float get_normal_force() const
Retrieves the point normal force.
LVector3f get_normal() const
Retrieves the patch normal.
float get_separation() const
Return the separation for the contact point.
static LPoint3f nxVec3_to_point3(const NxVec3 &p)
Converts from NxVec3 to LPoint3f.
static LVector3f nxVec3_to_vec3(const NxVec3 &v)
Converts from NxVec3 to LVector3f.
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.