Comments (5)
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.
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.
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.
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.
@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)
- Improve documentation about the window's depth buffer HOT 2
- Feature request: more performant anti-aliasing. Like FXAA or TAA. HOT 3
- Depth writes not writing to set mipmap HOT 2
- t.window.resizble = false doesn't work on android with LOVE 12 HOT 5
- Documentation: optional didactic "Implementation Details" section HOT 12
- symbol not found in flat namespace (___PHYSFS_platformCalcBaseDir) HOT 3
- error: call to member function 'WriteNumber' is ambiguous HOT 4
- Undefined symbols linking for macOS building with CMake
- [12.0] EXR encode/export produces swizzled image content (ABGR instead of RGBA) HOT 8
- love.keyboard.isDown is incorrect after dragging the game window
- Physics fixture/shape :setMask bits are inverted in love compared to box2d HOT 1
- setColor and setBackgroundColor color component values don't work when using ranges 0-255 HOT 3
- love.graphics.drawLayer() does not work. HOT 3
- Differences between repository and *-linux-src.tar.gz HOT 2
- BUG: Increased scaling on windows HOT 10
- When I boot up love2d it just shows an duck balloon with an rope saying "no game". HOT 1
- "love.keyboard.isDown" can't detect single letter key input HOT 6
- Android: `love.window.getSafeArea()`: returns same dimensions on a display with cutouts HOT 4
- `love.keyboard.isDown` does not properly detect remapped input HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from love.