Code Monkey home page Code Monkey logo

nphysics-ecs-dumb's Introduction

Nphysics - Amethyst connector

Don't use. Work in progress. Many things are incomplete!

Currently specific to 3d Nphysics and Amethyst due to Amethyst handling of Transforms and to keep iteration quick, although I currently plan on allowing 3d and 2d nphysics implementations to be used to configuration settings, and both amethyst and plain specs interfaces to be exposed, also behind configuration settings.

System Sequence

I'll update this as I go along.

    • "sync_bodies_to_physics_system" - Synchronize changes to dynamics bodies to physics world
    • "sync_gravity_to_physics_system" - Update gravity of physics world from resource
  1. "sync_colliders_to_physics_system" - Synchronize collision items to physics world
  2. "physics_stepper_system" - Step physics world simulation
  3. "sync_bodies_from_physics_system" - Synchronize physics world changes back to components

Current Roadmap

Full TODO sheet can be found in this nphysics issue

Ongoing work:

  • RigidBody Components
  • Collider Components #2
  • Proximity and Contact EventChannels #2
  • External force property #3
  • log based logging #4
  • Handling Body Activation & Sleeping #9
  • Multibody-based Component Joints #10
  • Force generator inversion of control #11
  • Time scale and simulation pausing #12

Investigating:

  • Proximity & Curve-based external force utility
  • Constraint-based Joints
  • Kinematics

nphysics-ecs-dumb's People

Contributors

999eagle avatar annekitsune avatar cooloppo avatar distransient avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nphysics-ecs-dumb's Issues

Sync{Bodies|Colliders}ToPhysics systems fail to remove things from the physics world

I see the big "do not use" message in the readme, but I was pointed here after asking for advice in the Amethyst Discord.

I've got a toy app that I'm trying to integrate with NCollide, where most entities will have a CollisionObjectHandle. I want to make sure that when those entities are deleted, the corresponding collision object is deleted from the CollisionWorld. That seems to be one of the things you aim to do with this project, but for NPhysics objects.

Unfortunately, it looks like the currently-implemented approach doesn't actually work.

When the entities are despawned, the sync_bodies_to_physics and sync_colliders_to_physics systems look up their respective handles from storage in order to remove them from the physics world... but by that point the handles are seemingly already deleted.

I modified the amethyst.rs example, adding a pair of systems to spawn and despawn a handful of balls: dylemma@d8160c3

The result:

Deleting entity Entity(5, Generation(1))
[ERROR][nphysics_ecs_dumb::systems::sync_bodies_to_physics] Missing body with id: 5
[ERROR][nphysics_ecs_dumb::systems::sync_bodies_to_physics] Missing body with id: 5
[ERROR][nphysics_ecs_dumb::systems::sync_colliders_to_physics] Missing collider with id: 5
Deleting entity Entity(6, Generation(1))
[ERROR][nphysics_ecs_dumb::systems::sync_bodies_to_physics] Missing body with id: 6
[ERROR][nphysics_ecs_dumb::systems::sync_bodies_to_physics] Missing body with id: 6
[ERROR][nphysics_ecs_dumb::systems::sync_colliders_to_physics] Missing collider with id: 6
Deleting entity Entity(7, Generation(1))
[ERROR][nphysics_ecs_dumb::systems::sync_bodies_to_physics] Missing body with id: 7
[ERROR][nphysics_ecs_dumb::systems::sync_bodies_to_physics] Missing body with id: 7
[ERROR][nphysics_ecs_dumb::systems::sync_colliders_to_physics] Missing collider with id: 7
...and so on

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.