00001 // Filename: bulletHeightfieldShape.I 00002 // Created by: enn0x (05Feb10) 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 //////////////////////////////////////////////////////////////////// 00016 // Function: BulletHeightfieldShape::Destructor 00017 // Access: Published 00018 // Description: 00019 //////////////////////////////////////////////////////////////////// 00020 INLINE BulletHeightfieldShape:: 00021 ~BulletHeightfieldShape() { 00022 00023 delete _shape; 00024 delete _data; 00025 } 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Function: BulletHeightfieldShape::Copy Constructor 00029 // Access: Published 00030 // Description: 00031 //////////////////////////////////////////////////////////////////// 00032 INLINE BulletHeightfieldShape:: 00033 BulletHeightfieldShape(const BulletHeightfieldShape ©) : 00034 _shape(copy._shape), 00035 _num_rows(copy._num_rows), 00036 _num_cols(copy._num_cols) { 00037 00038 _data = new float[_num_rows * _num_cols]; 00039 memcpy(_data, copy._data, _num_rows * _num_cols * sizeof(float)); 00040 } 00041 00042 //////////////////////////////////////////////////////////////////// 00043 // Function: BulletHeightfieldShape::Copy Assignment Operator 00044 // Access: Published 00045 // Description: 00046 //////////////////////////////////////////////////////////////////// 00047 INLINE void BulletHeightfieldShape:: 00048 operator = (const BulletHeightfieldShape ©) { 00049 00050 _shape = copy._shape; 00051 _num_rows = copy._num_rows; 00052 _num_cols = copy._num_cols; 00053 00054 _data = new float[_num_rows * _num_cols]; 00055 memcpy(_data, copy._data, _num_rows * _num_cols * sizeof(float)); 00056 } 00057