Panda3D
physxBoxControllerDesc.cxx
1 // Filename: physxBoxControllerDesc.cxx
2 // Created by: enn0x (22Sep09)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "physxBoxControllerDesc.h"
16 #include "physxManager.h"
17 
18 ////////////////////////////////////////////////////////////////////
19 // Function: PhysxBoxControllerDesc::set_extents
20 // Access: Published
21 // Description: Sets the dimensions of the box.
22 //
23 // The dimensions are the 'radii' of the box,
24 // meaning 1/2 extents in x dimension, 1/2 extents
25 // in y dimension, 1/2 extents in z dimension.
26 ////////////////////////////////////////////////////////////////////
28 set_extents(const LVector3f &extents) {
29 
30  _desc.extents = PhysxManager::vec3_to_nxVec3(extents);
31 }
32 
33 ////////////////////////////////////////////////////////////////////
34 // Function: PhysxBoxControllerDesc::get_extents
35 // Access: Published
36 // Description: Returns the dimensions of the box.
37 ////////////////////////////////////////////////////////////////////
39 get_extents() const {
40 
41  return PhysxManager::nxVec3_to_vec3(_desc.extents);
42 }
43 
LVector3f get_extents() const
Returns the dimensions of the box.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
static NxVec3 vec3_to_nxVec3(const LVector3f &v)
Converts from LVector3f to NxVec3.
Definition: physxManager.I:33
static LVector3f nxVec3_to_vec3(const NxVec3 &v)
Converts from NxVec3 to LVector3f.
Definition: physxManager.I:44
void set_extents(const LVector3f &extents)
Sets the dimensions of the box.