HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

poolarprojection vs coordinate

05-27-2006, 01:18 PM#1
MaD[Lion]
wanna know why people use polarprojection for making movement? It's just good for doing circular movements, while coordinate xyz can be used to do anything
05-27-2006, 01:21 PM#2
Captain Griffen
Because it is easier and simpler.

Anyway, doing it by co-ordinates you have to do exactly the same thing as polar projection, except you don't use a BJ, and don't convert the co-ordinates to a point.
05-27-2006, 01:23 PM#3
MaD[Lion]
well... maybe it is simple but it's only good to do circular movement
05-27-2006, 01:48 PM#4
blu_da_noob
http://www.wc3jass.com/viewtopic.php?t=2417
http://www.wc3jass.com/viewtopic.php?t=2542

Some discussions on the subject.
05-27-2006, 03:36 PM#5
Captain Griffen
Quote:
Originally Posted by MaD[Lion]
well... maybe it is simple but it's only good to do circular movement

And to move by an angle variable (though it is more effective to use co-ordinates and trig, which is basically what the BJ does).
05-27-2006, 04:28 PM#6
Vexorian
It is better to use pure Radian operations instead of using angles and PolarProjectionBJ forces you to use locations and do cleanup.

I am against the use of locations, and theo only times they are needed are because GetSpellTargetLoc() and GetLocationZ() don't have xy equivalents, I swear that if it wasn't because of those I would always use coordintates
05-27-2006, 04:48 PM#7
MaD[Lion]
i'm also agains locations... I try to avoid all locations in my jass
05-27-2006, 05:10 PM#8
Rising_Dusk
Locations are good for function returns at times though.
Sometimes I get lazy and have some function return a location so I can get the X and the Y with the same function.

Bleh, it's like my use of BoolExprs.
People think I'm crazy, but I actually kind of like them. >_>
05-27-2006, 05:16 PM#9
The)TideHunter(
If you wanted a function to return 2 reals, you could just do this:
Collapse JASS:
function MakeSomeReals takes nothing returns location
    local real mana = 100
    local real hp = 500
    return Location(mana, hp)
endfunction

function SetUnitStuff takes nothing returns nothing
    call SetUnitManaOrWhatever(someunit, GetLocationX(MakeSomeReals()))
    call SetUnitHpOrWhatever(someunit, GetLocationY(MakeSomeReals()))
    call DoNothingLol()
endfunction

Locations dont always have to be used for what they are assumed to be used as.
I see a location as just reals combined.
05-27-2006, 05:21 PM#10
Captain Griffen
Wouldn't that leak...?
05-27-2006, 05:24 PM#11
Jacek
yup...

I use locations and PolarProjectionBJ because I don't care about performance as long as my triggers doesn't lag...
05-27-2006, 06:06 PM#12
The)TideHunter(
Yea it would leak like hell, that wasent what i was showing though, it was a example.

You dont have to be that uptight on everything man...
05-27-2006, 07:11 PM#13
Vuen
It's not the leak that's the problem with your example, it's the fact that you're calling the function twice. If that function would, say, make a unit, then that code would make the unit twice.
05-27-2006, 07:23 PM#14
MaD[Lion]
well, for simple triggers its ok, but in my systems it runs every 0.01 sec, so tats why i cant use location
05-27-2006, 07:23 PM#15
Vexorian
Quote:
If you wanted a function to return 2 reals, you could just do this

Err no, it is better to use global variables for the returning. If only we had variable arguments (references for god's sake)
Collapse JASS:
function Something takes integer b returns nothing
 local integer a=b * 89
    udg_temx = a*4
    udg_temy = a*3
endfunction

function UseSomething takes nothing returns nothing
     call Something()
     call BJDebugMsg("x "+R2S(udg_temx)+" : y"+R2S(udg_temy))
endfunction


Anyways if you are somehow alergic to declaring new global variables you can always use the thousands of temp global variables declared in blizzard.j
Quote:
Bleh, it's like my use of BoolExprs.
People think I'm crazy, but I actually kind of like them. >_>
what's wrong with boolexprs?