Suggestion: Vector Functions

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Lovingsoul1337
Prole
Posts: 32
Joined: Fri Feb 21, 2020 1:26 pm

Suggestion: Vector Functions

Post by Lovingsoul1337 »

Would be great if you would add vector's to love2d...is there a reason they are not built in ?

best regards
User avatar
zorg
Party member
Posts: 3087
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Suggestion: Vector Functions

Post by zorg »

Yes, because there are one of the quintessential things one can implement using either lua or the luajit ffi; and that there exist quite a few vector libraries already.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
pgimeno
Party member
Posts: 2598
Joined: Sun Oct 18, 2015 2:58 pm

Re: Suggestion: Vector Functions

Post by pgimeno »

A vector library would be slower in C++ than in Lua anyway (sadly I saw the author of ItsyRealm make that mistake).
User avatar
Kindermaus
Prole
Posts: 28
Joined: Sun Sep 23, 2018 5:08 am

Re: Suggestion: Vector Functions

Post by Kindermaus »

pgimeno wrote: Mon May 04, 2020 10:24 am A vector library would be slower in C++ than in Lua anyway (sadly I saw the author of ItsyRealm make that mistake).
To clarify...

99% of the code uses a Lua Vector/Quaternion/Ray implementation, 1% (the scene graph traversal) off-loads the computation of the scene graph traversal & sorting to C++ because doing that in Lua is too slow. Things like rain and fungal weather use a highly customized (specific to the weather) math implementation for performance reasons as well, in FFI/Lua.

Using a C++ scene graph traversal/sorting doubled performance...

Those percentages aren't accurate but that's the general idea of it all.

Also my game will match the refresh rate on (i.e., 144 Hz) on mid-range hardware when I make a high-priority optimization: off-loading game logic to a separate thread. So I'm really not worried about performance. :P
ItsyRealm, a quirky 2D/3D RPG where you fight, skill, and explore in a medieval world with horrors unimaginable.
:emo: they / she
Post Reply

Who is online

Users browsing this forum: ReFreezed and 31 guests