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

Javascript code snippets #108

Merged
merged 13 commits into from
Jun 23, 2024
Merged

Conversation

Vrixyz
Copy link
Contributor

@Vrixyz Vrixyz commented Jun 10, 2024

Builds on https://github.com/dimforge/rapier.rs/pull/104 to provide a way to test more easily the javascript code snippets.

Diff so far: https://gist.github.com/Vrixyz/a627e66781f3fce62d4b39b85d02eb6b

Details

  • rigid bodies
    • Reworked Rendering Debug Shapes section to be more similar with testbed code.
    • collider -> colliderDesc
    • setAdditionalPrincipalAngularInertia does not exist
    • 2d: setEnabledRotations-> enabledRotations
  • joints:
    • prismatic parameters were doubled (6 instead of 3)
  • scene queries
    • ⚠️ toi -> timeOfImpact (RaycastHit) or time_of_impact (ShapecastHit)
    • ⚠️ castShape has way more parameters, + optional ones. accompanying text is wrong
    • , -> ;
    • ❓ no userdata for Collider ?
    • ❓ no code snippet for query filter for 3d ? (the query filter part is dimension agnostic but there's code displayed which is not. (Also impacts rust and bevy sections.

Comment on lines +107 to +108
let data = new Map();
data.set(collider.handle, 10);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure about how user would store user data in a collider, I imagine in javascript they could add whatever they want on the type, but in typescript I believe there's no other choice than adding it externally ?

@Vrixyz Vrixyz marked this pull request as ready for review June 14, 2024 08:25
@Vrixyz Vrixyz requested a review from sebcrozet June 14, 2024 08:25
@sebcrozet sebcrozet merged commit 527327f into dimforge:master Jun 23, 2024
4 checks passed
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.

2 participants