Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 2D heightfield scale and docs #343

Merged
merged 1 commit into from
Mar 1, 2024
Merged

Fix 2D heightfield scale and docs #343

merged 1 commit into from
Mar 1, 2024

Conversation

Jondolf
Copy link
Owner

@Jondolf Jondolf commented Mar 1, 2024

Objective

Fixes #342.

The 2D heightfield only has a scalar scale argument instead of allowing different scaling along each coordinate axis. The docs are also incorrect.

Solution

Take a Vec2 instead of a scalar value for the 2D Collider::heightfield and fix the heightfield docs.


Migration Guide

The 2D Collider::heightfield method now takes a Vec2 scale instead of a single float. This way, it now supports non-uniform scaling.

// Before
let collider = Collider::heightfield(heights, 2.0);

// After
let collider = Collider::heightfield(heights, Vec2::new(2.0, 2.0));

@Jondolf Jondolf added C-Docs Improvements or additions to documentation bugfix A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality labels Mar 1, 2024
@Jondolf Jondolf merged commit 7d44039 into main Mar 1, 2024
4 checks passed
@Jondolf Jondolf deleted the fix-heightfield branch March 1, 2024 14:28
@Jondolf Jondolf added C-Bug Something isn't working 2D Specific to two dimensions and removed bugfix labels Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2D Specific to two dimensions A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality C-Bug Something isn't working C-Docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

issues with 2D heightfield collider
1 participant