00001 // Filename: physxBoxForceFieldShapeDesc.cxx 00002 // Created by: enn0x (06Nov09) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #include "physxBoxForceFieldShapeDesc.h" 00016 #include "physxManager.h" 00017 00018 //////////////////////////////////////////////////////////////////// 00019 // Function: PhysxBoxForceFieldShapeDesc::set_dimensions 00020 // Access: Published 00021 // Description: Sets the dimensions of the box. 00022 // 00023 // The dimensions are the 'radii' of the box, 00024 // meaning 1/2 extents in x dimension, 1/2 extents 00025 // in y dimension, 1/2 extents in z dimension. 00026 //////////////////////////////////////////////////////////////////// 00027 void PhysxBoxForceFieldShapeDesc:: 00028 set_dimensions(const LVector3f &dimensions) { 00029 00030 nassertv(!dimensions.is_nan()); 00031 _desc.dimensions = PhysxManager::vec3_to_nxVec3(dimensions); 00032 } 00033 00034 //////////////////////////////////////////////////////////////////// 00035 // Function: PhysxBoxForceFieldShapeDesc::get_dimensions 00036 // Access: Published 00037 // Description: Returns the dimensions of the box. 00038 //////////////////////////////////////////////////////////////////// 00039 LVector3f PhysxBoxForceFieldShapeDesc:: 00040 get_dimensions() const { 00041 00042 return PhysxManager::nxVec3_to_vec3(_desc.dimensions); 00043 } 00044