Panda3D
Loading...
Searching...
No Matches
physxControllerShapeHit.I
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 physxControllerShapeHit.I
10 * @author enn0x
11 * @date 2012-11-28
12 */
13
14/**
15 *
16 */
17INLINE PhysxControllerShapeHit::
18PhysxControllerShapeHit(const NxControllerShapeHit &hit) :
19 _hit(hit) {
20
21}
22
23/**
24 *
25 */
26INLINE PhysxController *PhysxControllerShapeHit::
27get_controller() const {
28
29 if (_hit.controller) {
30 return (PhysxController *)(_hit.controller->getUserData());
31 }
32 else {
33 return nullptr;
34 }
35}
36
37/**
38 *
39 */
40INLINE PhysxShape *PhysxControllerShapeHit::
41get_shape() const {
42
43 if (_hit.shape) {
44 return (PhysxShape *)(_hit.shape->userData);
45 }
46 else {
47 return nullptr;
48 }
49}
50
51/**
52 *
53 */
54INLINE LPoint3 PhysxControllerShapeHit::
55get_world_pos() const {
56
57 return PhysxManager::nxExtVec3_to_point3(_hit.worldPos);
58}
59
60/**
61 *
62 */
63INLINE LVector3 PhysxControllerShapeHit::
64get_world_normal() const {
65
66 return PhysxManager::nxVec3_to_vec3(_hit.worldNormal);
67}
68
69/**
70 *
71 */
72INLINE LVector3 PhysxControllerShapeHit::
73get_dir() const {
74
75 return PhysxManager::nxVec3_to_vec3(_hit.dir);
76}
77
78/**
79 *
80 */
81INLINE PN_stdfloat PhysxControllerShapeHit::
82get_length() const {
83
84 return (PN_stdfloat)_hit.length;
85}
Abstract base class for character controllers.
static LPoint3f nxExtVec3_to_point3(const NxExtendedVec3 &p)
Converts from NxExtendedVec3 to LPoint3f.
static LVector3f nxVec3_to_vec3(const NxVec3 &v)
Converts from NxVec3 to LVector3f.
Abstract base class for shapes.
Definition physxShape.h:39