Panda3D
Loading...
Searching...
No Matches
physxRaycastHit.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 physxRaycastHit.cxx
10 * @author enn0x
11 * @date 2009-10-21
12 */
13
14#include "physxRaycastHit.h"
15#include "physxManager.h"
16#include "physxShape.h"
17
18/**
19 *
20 */
21bool PhysxRaycastHit::
22is_empty() const {
23
24 return (_hit.shape == nullptr);
25}
26
27/**
28 *
29 */
30PhysxShape *PhysxRaycastHit::
31get_shape() const {
32
33 nassertr_always(_hit.shape, nullptr);
34 return (PhysxShape *)_hit.shape->userData;
35}
36
37/**
38 *
39 */
40LPoint3f PhysxRaycastHit::
41get_impact_pos() const {
42
43 return PhysxManager::nxVec3_to_point3(_hit.worldImpact);
44}
45
46/**
47 *
48 */
49LVector3f PhysxRaycastHit::
50get_impact_normal() const {
51
52 return PhysxManager::nxVec3_to_vec3(_hit.worldNormal);
53}
54
55/**
56 *
57 */
58float PhysxRaycastHit::
59get_distance() const {
60
61 return _hit.distance;
62}
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.
Abstract base class for shapes.
Definition physxShape.h:39
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.