Skip to content

Collision and Area Constraints #15

@formula1

Description

@formula1

I don't know how dead this project is but I believe it has a lot of potential.

A lot is still broken. But I'm hoping that I could get some help and/or merge at some point.

Amoungst my problems are

  • Why are my collisions sliding into eachother?
  • How do I detect negative area?
  • When I get negative area, am I supposed to making the distances between the points smaller or attempt to switch sides?

Alot of my math is done on pen and paper and then applied to the engine. I can show as much as need be if you'd like to help. Some of it I've written inline for others to double check if need be.

Again: At some point I want to merge back to the main repository but of course that is only if you are willing. I've made many changes, some of which are breaking changes and to be honest more will be coming in the future.

Right now the breaking changes are

  • Vec2's are mutable by default. They require the person to create a copy with .clone() if they don't want them to be. This was done because of a delaunay algorithm I was initially using. Though I'm no longer using it, I wouldn't doubt I may do it again if it helps my blob.

Some other changes I may play with in the future

  • Make certian properties cached - this is mostly in my line, AABB, triangle and polygon. However it may be slower so I'm not 100% sure yet
  • store sorted lists of particles - Tests so far have told me its actually slower, however, it does not account for lists that have already been somewhat sorted. However, the sorted lists will almost only be used for calculating collisions so it might not be worth it
  • Breaking Change Make Constraints return a transform rather than directly changing velocity of the point
  • Breaking Change Use a math library to avoid floating point error as much as possible such as big number. This will cause many math calculations to be wrong unless you use the library
  • Change all for( a in array) to while(length--) and eventually .foreach() once chrome gets its act togethor- http://jsperf.com/for-vs-foreach/268
  • Look up more jsperf statistics such as vec2 as typed array or component
  • attempt to borrow algorithms from other blobs blobgame (box2d) and volume joint (@dmurph is a boss btws)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions