making sense of maxangledif

making sense of maxangledif

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

making sense of maxangledif

Post by smoth »

(unitdef file)
maxAngleDif = 210

(unitdef inside of lua)
maxAngleDif = -0.25881904363632


so what am I seeing here? Maybe my math sucks but this isn't radians.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: making sense of maxangledif

Post by lurker »

Looks like a comparison number for a dot product of vectors, so cos(theta). In this case cosine of 105 degrees.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: making sense of maxangledif

Post by Tobi »

User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: making sense of maxangledif

Post by KDR_11k »

Spring loves to do comparisons by checking the difference between the normalized vectors.
Post Reply

Return to “Lua Scripts”