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

Add rigidBody.velocityAtPoint #305

Merged
merged 3 commits into from
Apr 10, 2025

Conversation

alexandernanberg
Copy link
Contributor

Closes #304

@@ -297,6 +298,11 @@ impl RawRigidBodySet {
self.map(handle, |rb| RawVector(*rb.angvel()))
}

/// The velocity of the given world-space point on this rigid-body.
pub fn rbVelocityAtPoint(&self, handle: FlatHandle, point: &RawVector) -> RawVector {
self.map(handle, |rb| rb.velocity_at_point(&Point::from(point.0)).into())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if &Point::from(point.0) is the right approach? Tried point.0.into() like in other places but the compiler wasn't happy with that

@alexandernanberg alexandernanberg force-pushed the add-rb-velocity-at-point branch from 0aac761 to 9f4a9d0 Compare March 2, 2025 11:52
@sebcrozet sebcrozet force-pushed the add-rb-velocity-at-point branch from 9f4a9d0 to f1dfbc0 Compare April 10, 2025 10:56
@sebcrozet sebcrozet merged commit 43d2393 into dimforge:master Apr 10, 2025
5 checks passed
@sebcrozet
Copy link
Member

Thanks!

Master-Hash pushed a commit to Master-Hash/rapier.js that referenced this pull request Apr 10, 2025
* Add rigidBody.velocityAtPoint

* Add changelog entry

* fix: free wasm vector in RigidBody.velocityAtPoint.

---------

Co-authored-by: Sébastien Crozet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add RigidBody.velocityAtPoint
2 participants