Giter Site home page Giter Site logo

Comments (5)

a13X-B avatar a13X-B commented on July 22, 2024

löve does not come with a builtin vector type but there are many libraries that implement vectors fairly differently and giving preference to just one of them won't really solve the problem in general.
you can easily work around your problem by writing a wrapper instead of asking for drastic core changes.
that said if you have further questions about using löve you should use the forums or discord

from love.

roroire avatar roroire commented on July 22, 2024

I didn't ask a specific implementation of a Vector object itself, but rather that arguments would use tables with x and y values, so any vector library would work once the dev sets its x and y value on their vectors, vectors are just values with force and direction, the math we do with them (normalized, for example), are just definitions about vectors, not them themselves.

writing a wrapper for the whole of physics and draw seems like a big waste of time for what should be a simple feature, also, the body thing is still a problem: on :setLinearVelocity(), velocity changes, so the original table which defined position becomes outdated, and then simply setting the new table's position doesn't work anymore, one would have to use :getPosition() on the Body and then the
original position table would become useless, unless the dev creates variables to show the differences, or if the dev remakes :setLinearVelocity(),

then, why to recreate two modules, when the default could be simple and compatible?

also, receiving one variable is better than receiving the same variable buta s two, as it avoids errors my mistyping, speeding up development,

and well, it's not that drastic if it is retro-compatible, it's only extensible as the modules are huge,

and I won't use the forum, it uses ancient-looking interface, that ain't accessibility-minded at all, it is not Discourse nor Flarum,

and I won't use Discord, I avoid proprietary as much as I can, and in good will I loged in Github for this project,

and last, I do not have "questions", I have an issue with an enhancement proposal

from love.

a13X-B avatar a13X-B commented on July 22, 2024

there are implementations of vectors that use x and y for components, then there are 1-indexed tables as per lua array conventions, and there are 0-indexed arrays as per ffi conventions.
you're asking the devs to write that aforementioned wrapper for you and force it on the entire userbase.
still if you have any further questions it's better to ask those in a more appropriate place, such as love forums or discord

from love.

slime73 avatar slime73 commented on July 22, 2024

This github issue tracker is for bug reports and feature requests, rather than general discussion or support. If you don't want to engage in the places that are appropriate for discussion/support that's up to you, but it doesn't make this a valid place for it.

That being said, this is a feature request as it's written.

Unfortunately Lua as a language requires tradeoffs when using vector structures. Creating a new vector allocates memory that will be garbage-collected (which impacts performance). There are ways to reuse rather than creating new ones, but they tend to make APIs less friendly to use. As mentioned above there are also different possible conventions for how a vector's components are accessed etc.

By taking individual vector components as parameters (and as return values), love's APIs bypass those issues by letting you write your code how you want and it just needs to pass along components when interfacing with love. If it forced you to pass in a vector object it would require the above tradeoffs and more. Adding function variants that take both would add too much bloat to love's APIs, so that's not really viable either.

I expect once we have a C API (#1640) people will start creating bindings to languages that are friendlier to vector objects, and you'll probably see love's APIs take them directly in those situations. But for now with Lua, we haven't found a good way to have them directly in the API that doesn't introduce problems we'd like to avoid.

from love.

roroire avatar roroire commented on July 22, 2024

@slime73, oh, I didn't thought of here as a feature request, but enhancement, which I think is similar to feature request;

anyway, I'm sorry for looking at the wrong place, I am used for enhancements as a place to be in Github,

by letting you write your code however you want
not exactly, as the arguments from love.graphics.rectangle must be written in certain long order, and given that those functions are that long...

adding function variants
no, I mean more like the same function, with "if argument 2 is a table, then get argument 2's x"

@a13X-B, thank you for mentioning that there are vector implementations that use number indexes, but that doesn't break anything if there's retrocompatibility

now, stop recommending love forums and Discord to to me, I already said no

I won't insist on this topic anymore, I just wanted to point these things

from love.

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.