Giter Site home page Giter Site logo

Comments (6)

davexunit avatar davexunit commented on August 26, 2024

I have some ideas for a collision detection system. I want to write a quadtree data type for the spatial partitioning that will allow for fast collision detection. I'm glad you noticed the rect module. That's the first step towards this.

As far as collision response handlers and stuff, I think that is best left to the person writing the game. Giving the necessary primitives (rect and quadtree) will give users the means to do what they please. I don't want to embed a collision system deep into the game/scene part of the API.

So, as far as what could use work: a quadtree module would be awesome.

from guile-2d.

zan-xhipe avatar zan-xhipe commented on August 26, 2024

ok, I can work on a quadtree module.

from guile-2d.

Halfwake avatar Halfwake commented on August 26, 2024

EDIT: Oh right, you moved. Let me try there.

If it helps, I have a quad tree module written in Common Lisp. I can port it over, but I need to setup my guile environment and find some time first. https://github.com/Halfwake/cl-quad

from guile-2d.

davexunit avatar davexunit commented on August 26, 2024

Thanks for sharing the code. That makes 2 CL quadtree implementations that I know of. From what I can see, this implementation uses a mutable quadtree. In Sly (the new name for guile-2d), the quadtree must use a purely functional data structure. I've been meaning to look into how to implement a persistent quad tree, but haven't gotten around to it.

from guile-2d.

Halfwake avatar Halfwake commented on August 26, 2024

Are you sure my implementation isn't purely functional? There is no use of assignment operators. Methods return new quad trees instead of changing an existing tree. The slots for all classes are read only. It might even be a persistent tree. When a method creates a new tree, it uses references to the last tree without making copies.

from guile-2d.

davexunit avatar davexunit commented on August 26, 2024

In that case I didn't read the code carefully enough! Thanks for explaining. I would love to see it implemented in Guile.

I'd be curious about the performance profile of it as well. I imagine the time complexity for read/write are different than a mutable quad tree.

from guile-2d.

Related Issues (8)

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.