Title: Entity physics · Issue #357 · feather-rs/feather · GitHub
Open Graph Title: Entity physics · Issue #357 · feather-rs/feather
X Title: Entity physics · Issue #357 · feather-rs/feather
Description: Implement entity physics: gravity and collisions with blocks. The basic algorithm for Minecraft entity physics is, each tick, to: Add velocity to position. For each axis (X/Y/Z) individually, check for collisions between the entity's bou...
Open Graph Description: Implement entity physics: gravity and collisions with blocks. The basic algorithm for Minecraft entity physics is, each tick, to: Add velocity to position. For each axis (X/Y/Z) individually, check...
X Description: Implement entity physics: gravity and collisions with blocks. The basic algorithm for Minecraft entity physics is, each tick, to: Add velocity to position. For each axis (X/Y/Z) individually, check...
Opengraph URL: https://github.com/feather-rs/feather/issues/357
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Entity physics","articleBody":"Implement entity physics: gravity and collisions with blocks.\r\n\r\nThe basic algorithm for Minecraft entity physics is, each tick, to:\r\n1. Add velocity to position.\r\n2. For each axis (X/Y/Z) individually, check for collisions between the entity's bounding box and blocks. If there are any, clamp the entity's position to the edge of the block. There are some useful details on collision detection [here](https://www.reddit.com/r/gamedev/comments/qnmqk/good_collision_detection_sliding_on_walls/), there I'm sure there are better sources.\r\n3. Apply gravity to velocity.\r\n4. Multiply velocity by a drag factor.\r\n5. For certain entities, steps 3 and 4 are swapped.\r\n\r\nIn Minecraft physics, different entities behave differently with different drag/gravity forces. This parameters are listed [here](https://minecraft.gamepedia.com/Entity#Motion_of_entities). To implement this in Feather, we would use a `Physics` component containing a field for each parameter: `gravity_acceleration`, `drag_factor`, `bounding_box`, and `drag_before_acceleration: bool`.\r\n\r\nSome further guidance on implementing this: The `Physics` struct should be defined in `feather-common`, as should a `physics_system` that uses a query to iterate over all entities with `Physics`, `Position`, and `Velocity` components.","author":{"url":"https://github.com/caelunshun","@type":"Person","name":"caelunshun"},"datePublished":"2021-03-02T00:00:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/357/feather/issues/357"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f113d1ff-6a1a-7a0a-5509-1d30c5058657 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9FCC:12AC7F:19700D:22A5C6:698F1A60 |
| html-safe-nonce | 469157a0aa9e3cbe74a848acae52479464f7d6a854ec6fae76c0058c9980ef67 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RkNDOjEyQUM3RjoxOTcwMEQ6MjJBNUM2OjY5OEYxQTYwIiwidmlzaXRvcl9pZCI6Ijc2NjA3Mzc2MDA2MDUzMzAwMTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 90db93ff404fe0cbc99fce7261ff35530f922fc6cf3cf70f4e064314997e3a9b |
| hovercard-subject-tag | issue:819423648 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feather-rs/feather/357/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2e5660fd69993cc87e6e7a47b5c914acc14945547ead8ff7f3fb05c30bc6d9c8/feather-rs/feather/issues/357 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2e5660fd69993cc87e6e7a47b5c914acc14945547ead8ff7f3fb05c30bc6d9c8/feather-rs/feather/issues/357 |
| og:image:alt | Implement entity physics: gravity and collisions with blocks. The basic algorithm for Minecraft entity physics is, each tick, to: Add velocity to position. For each axis (X/Y/Z) individually, check... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | caelunshun |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2da1a0d1318592c9965539b12269c4641177dfabfc86c3807992efb13e1d96ff |
| turbo-cache-control | no-preview |
| go-import | github.com/feather-rs/feather git https://github.com/feather-rs/feather.git |
| octolytics-dimension-user_id | 54925191 |
| octolytics-dimension-user_login | feather-rs |
| octolytics-dimension-repository_id | 191701609 |
| octolytics-dimension-repository_nwo | feather-rs/feather |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 191701609 |
| octolytics-dimension-repository_network_root_nwo | feather-rs/feather |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c9646ffd6f86b00952c2b39e3c62e15904eff1e5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width