Setting a particle's angle based on the mouse

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Dvondrake
Prole
Posts: 29
Joined: Sun Oct 26, 2008 5:53 pm

Setting a particle's angle based on the mouse

Post by Dvondrake »

---
Last edited by Dvondrake on Mon Jan 21, 2019 10:21 pm, edited 1 time in total.
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Setting a particle's angle based on the mouse

Post by rude »

Oh s*** ... I checked the ParticleSystem source just now, and I discovered a huge mess with the degrees/radians conversions. Oh, well. That's what we get for speedcoding.

I'm considering whether we should change everything to radians. I would prefer everything in degrees (which is more intuitive), but we can't (shouldn't) change the standard Lua math library. That's for another thread, though.

Wiki: yes, it will come, but I haven't even started on it yet. I need to make a template for Dokuwiki, integrate it with phpBB and probably make custom plugins. It's a big project in itself.
u9_
Citizen
Posts: 54
Joined: Thu Oct 23, 2008 7:12 am

Re: Setting a particle's angle based on the mouse

Post by u9_ »

I myself prefer everything in radians. The reason is that this is what is used after elementary school, and every single sin, cos, atan2, or any other trigonometry function i have ever come across uses radians.

But the problem is that it's so damn... non-intuitive... unless we teach every newbie that up is pi/2, left is pi and down is 3pi/2...

I guess if we always remember that everything in LÕVE is in degrees, and everything in Lua is radians, we'll be fine ;)
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: Setting a particle's angle based on the mouse

Post by appleide »

Could always make your own sin, cos, tan which uses degrees... But everything in radians will be more consistent; IMHO just add a function to convert between radians and degrees.
User avatar
Kaze
Party member
Posts: 189
Joined: Sat Jul 19, 2008 4:39 pm
Location: Dublin, Ireland

Re: Setting a particle's angle based on the mouse

Post by Kaze »

appleide wrote:Could always make your own sin, cos, tan which uses degrees... But everything in radians will be more consistent; IMHO just add a function to convert between radians and degrees.
math.rad & math.deg
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 2 guests