Skip to content

Commit

Permalink
Fix the EvelationGrid height used for ODE (#6412)
Browse files Browse the repository at this point in the history
* Fix the EvelationGrid height used for ODE

* Update changelog-r2023.md
  • Loading branch information
TonyWelte authored Oct 11, 2023
1 parent d76e17a commit a9888b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/reference/changelog-r2023.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Released on XXX XXth, 2023.
- Fixed a crash when [IndexedLineSet](indexedlineset.md) has `coord` but no `coordIndex` ([#6359](https://github.com/cyberbotics/webots/pull/6359)).
- Fixed values returned by the [Receiver.getEmitterDirection](https://cyberbotics.com/doc/reference/receiver?tab-language=python#wb_receiver_get_emitter_direction) Python method ([#6394](https://github.com/cyberbotics/webots/pull/6394)).
- Fixed recognition of omnidirectional cameras with fov > pi/2 in [WbObjectDetection] ([#6396](https://github.com/cyberbotics/webots/pull/6396)).
- Fixed [ElevationGrid](elevationgrid.md) collisions not matching the displayed when the x and y dimensions are different ([#6412](https://github.com/cyberbotics/webots/pull/6412))

## Webots R2023b
Released on June 28th, 2023.
Expand Down
10 changes: 5 additions & 5 deletions src/webots/nodes/WbElevationGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,11 @@ bool WbElevationGrid::setOdeHeightfieldData() {
mHeight->copyItemsTo(mData, xdyd);

// Inverse mData lines for ODE
for (int i = 0; i < xd / 2; i++) { // integer division
for (int j = 0; j < yd; j++) {
double temp = mData[i * yd + j];
mData[i * yd + j] = mData[(xd - 1 - i) * yd + j];
mData[(xd - 1 - i) * yd + j] = temp;
for (int i = 0; i < yd / 2; i++) { // integer division
for (int j = 0; j < xd; j++) {
double temp = mData[i * xd + j];
mData[i * xd + j] = mData[(yd - 1 - i) * xd + j];
mData[(yd - 1 - i) * xd + j] = temp;
}
}

Expand Down

0 comments on commit a9888b1

Please sign in to comment.