GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Entity physics · Issue #357 · feather-rs/feather

Entity physics #357

New issue
Copy link
New issue
Copy link
Open
Open
Entity physics#357
Copy link
Assignees
Stoozy
Labels
good first issueGood for newcomersGood for newcomers

Description

@caelunshun
caelunshun
opened on Mar 2, 2021
Issue body actions

Implement entity physics: gravity and collisions with blocks.

The basic algorithm for Minecraft entity physics is, each tick, to:

  1. Add velocity to position.
  2. 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, there I'm sure there are better sources.
  3. Apply gravity to velocity.
  4. Multiply velocity by a drag factor.
  5. For certain entities, steps 3 and 4 are swapped.

In Minecraft physics, different entities behave differently with different drag/gravity forces. This parameters are listed here. 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.

Some 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.

Activity

  1. caelunshun
    added
    good first issueGood for newcomersGood for newcomers
    on Mar 2, 2021
  2. lolgeny commented on Mar 6, 2021

    @lolgeny
    lolgeny
    on Mar 6, 2021
    More actions

    I'll try doing this as a first contribution

  3. oxkitsune commented on Mar 6, 2021

    @oxkitsune
    oxkitsune
    on Mar 6, 2021
    Member
    More actions

    I think someone was working on this already, @Stoozy. I'm not sure how far they are but maybe you can collaborate?

  4. lolgeny commented on Mar 6, 2021

    @lolgeny
    lolgeny
    on Mar 6, 2021
    More actions

    Oh ok, I'll do something else, I didn't know that

  5. Stoozy commented on Mar 8, 2021

    @Stoozy
    Stoozy
    on Mar 8, 2021
    More actions

    Yea

  6. Defman
    assigned
    Stoozy
    on Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @Stoozy
    Stoozy

Labels

good first issueGood for newcomersGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.