mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
parent
2b537d2263
commit
86cbdddd76
@ -30,8 +30,8 @@ BulletHeightfieldShape(const BulletHeightfieldShape ©) :
|
|||||||
_num_rows(copy._num_rows),
|
_num_rows(copy._num_rows),
|
||||||
_num_cols(copy._num_cols) {
|
_num_cols(copy._num_cols) {
|
||||||
|
|
||||||
_data = new float[_num_rows * _num_cols];
|
_data = new btScalar[_num_rows * _num_cols];
|
||||||
memcpy(_data, copy._data, _num_rows * _num_cols * sizeof(float));
|
memcpy(_data, copy._data, _num_rows * _num_cols * sizeof(btScalar));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,6 +44,6 @@ operator = (const BulletHeightfieldShape ©) {
|
|||||||
_num_rows = copy._num_rows;
|
_num_rows = copy._num_rows;
|
||||||
_num_cols = copy._num_cols;
|
_num_cols = copy._num_cols;
|
||||||
|
|
||||||
_data = new float[_num_rows * _num_cols];
|
_data = new btScalar[_num_rows * _num_cols];
|
||||||
memcpy(_data, copy._data, _num_rows * _num_cols * sizeof(float));
|
memcpy(_data, copy._data, _num_rows * _num_cols * sizeof(btScalar));
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ BulletHeightfieldShape(const PNMImage &image, PN_stdfloat max_height, BulletUpAx
|
|||||||
_num_rows = image.get_x_size();
|
_num_rows = image.get_x_size();
|
||||||
_num_cols = image.get_y_size();
|
_num_cols = image.get_y_size();
|
||||||
|
|
||||||
_data = new float[_num_rows * _num_cols];
|
_data = new btScalar[_num_rows * _num_cols];
|
||||||
|
|
||||||
for (int row=0; row < _num_rows; row++) {
|
for (int row=0; row < _num_rows; row++) {
|
||||||
for (int column=0; column < _num_cols; column++) {
|
for (int column=0; column < _num_cols; column++) {
|
||||||
@ -75,10 +75,10 @@ BulletHeightfieldShape(Texture *tex, PN_stdfloat max_height, BulletUpAxis up) {
|
|||||||
|
|
||||||
_num_rows = tex->get_x_size() + 1;
|
_num_rows = tex->get_x_size() + 1;
|
||||||
_num_cols = tex->get_y_size() + 1;
|
_num_cols = tex->get_y_size() + 1;
|
||||||
_data = new float[_num_rows * _num_cols];
|
_data = new btScalar[_num_rows * _num_cols];
|
||||||
|
|
||||||
PN_stdfloat step_x = 1.0 / (PN_stdfloat)tex->get_x_size();
|
btScalar step_x = 1.0 / (btScalar)tex->get_x_size();
|
||||||
PN_stdfloat step_y = 1.0 / (PN_stdfloat)tex->get_y_size();
|
btScalar step_y = 1.0 / (btScalar)tex->get_y_size();
|
||||||
|
|
||||||
PT(TexturePeeker) peeker = tex->peek();
|
PT(TexturePeeker) peeker = tex->peek();
|
||||||
LColor sample;
|
LColor sample;
|
||||||
@ -100,4 +100,4 @@ BulletHeightfieldShape(Texture *tex, PN_stdfloat max_height, BulletUpAxis up) {
|
|||||||
up,
|
up,
|
||||||
true, false);
|
true, false);
|
||||||
_shape->setUserPointer(this);
|
_shape->setUserPointer(this);
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
int _num_rows;
|
int _num_rows;
|
||||||
int _num_cols;
|
int _num_cols;
|
||||||
float *_data;
|
btScalar *_data;
|
||||||
btHeightfieldTerrainShape *_shape;
|
btHeightfieldTerrainShape *_shape;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user