Panda3D
physxBoxShapeDesc.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 physxBoxShapeDesc.cxx
10  * @author enn0x
11  * @date 2009-09-08
12  */
13 
14 #include "physxBoxShapeDesc.h"
15 #include "physxManager.h"
16 
17 /**
18  * Sets the dimensions of the box.
19  *
20  * The dimensions are the 'radii' of the box, meaning 1/2 extents in x
21  * dimension, 1/2 extents in y dimension, 1/2 extents in z dimension.
22  */
24 set_dimensions(const LVector3f &dimensions) {
25 
26  nassertv(!dimensions.is_nan());
27  _desc.dimensions = PhysxManager::vec3_to_nxVec3(dimensions);
28 }
29 
30 /**
31  * Returns the dimensions of the box.
32  */
33 LVector3f PhysxBoxShapeDesc::
34 get_dimensions() const {
35 
36  return PhysxManager::nxVec3_to_vec3(_desc.dimensions);
37 }
LVector3f get_dimensions() const
Returns the dimensions of the box.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static NxVec3 vec3_to_nxVec3(const LVector3f &v)
Converts from LVector3f to NxVec3.
Definition: physxManager.I:27
static LVector3f nxVec3_to_vec3(const NxVec3 &v)
Converts from NxVec3 to LVector3f.
Definition: physxManager.I:36
void set_dimensions(const LVector3f &dimensions)
Sets the dimensions of the box.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.