Panda3D
 All Classes Functions Variables Enumerations
physxBoxForceFieldShapeDesc.cxx
1 // Filename: physxBoxForceFieldShapeDesc.cxx
2 // Created by: enn0x (06Nov09)
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 "physxBoxForceFieldShapeDesc.h"
16 #include "physxManager.h"
17 
18 ////////////////////////////////////////////////////////////////////
19 // Function: PhysxBoxForceFieldShapeDesc::set_dimensions
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_dimensions(const LVector3f &dimensions) {
29 
30  nassertv(!dimensions.is_nan());
31  _desc.dimensions = PhysxManager::vec3_to_nxVec3(dimensions);
32 }
33 
34 ////////////////////////////////////////////////////////////////////
35 // Function: PhysxBoxForceFieldShapeDesc::get_dimensions
36 // Access: Published
37 // Description: Returns the dimensions of the box.
38 ////////////////////////////////////////////////////////////////////
40 get_dimensions() const {
41 
42  return PhysxManager::nxVec3_to_vec3(_desc.dimensions);
43 }
44 
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
bool is_nan() const
Returns true if any component of the vector is not-a-number, false otherwise.
Definition: lvecBase3.h:463
void set_dimensions(const LVector3f &dimensions)
Sets the dimensions of the box.
LVector3f get_dimensions() const
Returns the dimensions of the box.
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