Git Product home page Git Product logo

Comments (4)

suchipi avatar suchipi commented on May 22, 2024 2

Yup, that sounds about right; though we'd also need to support collision between circles and polygons (and vice versa). But we can use circle-like polygons to do that, if needed.

Thanks for the links! They'll be super helpful.

Something else that may be useful is this library, which decomposes an arbitrary polygon into its convex pieces: https://github.com/schteppe/poly-decomp.js/

from hex-engine.

andre-lima avatar andre-lima commented on May 22, 2024

I don't know how the best pratices for raycasting are either, but I did develop one prototype for use with the Kontra game engine.

Here's the link for the demo, with the link for the code inside: https://kontra-experiments.netlify.com/
Also, a discussion about the experiments which may inspire you for other features: straker/kontra#136

from hex-engine.

suchipi avatar suchipi commented on May 22, 2024

Thanks for sharing! I will take a look. Hex Engine's raycasting requirements aren't exactly the same as Kontra's (since entities can be non-rectangular), but I can probably get some good inspiration from your Ray class. Thanks again!

from hex-engine.

Reklino avatar Reklino commented on May 22, 2024

Yo! Pretty new to game dev, so excuse my ignorance 😅.

I've been doing some light research on collision detection. Would it be accurate to say that we'd want to support these three types of collision detection?

  1. Axis Aligned Bounding Box (detects collision between two rectangles)
  2. Separating Axis theorem (detects collision between two convex polygons)
  3. Circle Collision( technique that detects collision between two circles)

1 and 3 seem simpler to solve: MDN collision detection

2 seems a way more complex, but this lib looks promising.

from hex-engine.

Related Issues (20)

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.