wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 07-12-2011, 12:42 PM   #46
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by Bribe
Is there a way to rotate a vector considering the Z value
with the rotation?

I suspect not in this library, based on that it's only rotating
the X and Y. I wonder what kind of complexity we'd deal
with if we had to factor in all three dimensions into the
equations.
I'm not sure what you mean by that, but this library is capable of rotating a vector around any axis, whether it's vertical or pointing sideways.

Quote:
I'm also unsure of what the purpose of "terrainNormal" is.
It takes four corners into consideration but what if the center
is a bit indented/raised offset from the rest?
That doesn't really matter. The purpose of the function is to get a vector perpendicular to the terrain surface. Sure, the results get smoothed in some cases (as you move across a terrain grid line, the actual terrain normal will change instantly while the one returned by Vector will change gradually) but in most cases you'd want that anyway and if not you can always use a very small sample radius.
__________________
Anitarf is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 10-23-2011, 05:42 PM   #47
BBQ
User
 
Join Date: May 2011
Posts: 85

Submissions (2)

BBQ will become famous soon enough (30)BBQ will become famous soon enough (30)

Default

I think that a including a createFromUnit() (or something like that) static method wouldn't be that bad - especially for projectile systems that use vectors (such as this one).
BBQ is offline   Reply With Quote
Old 10-24-2011, 01:49 AM   #48
busterkomo
User
 
Join Date: Aug 2007
Posts: 68

Submissions (1)

busterkomo is on a distinguished road (10)

Default

What do you mean by creating a vector from a unit?
busterkomo is offline   Reply With Quote
Old 10-24-2011, 10:52 AM   #49
BBQ
User
 
Join Date: May 2011
Posts: 85

Submissions (2)

BBQ will become famous soon enough (30)BBQ will become famous soon enough (30)

Default

Collapse Zinc:
static method createFromUnit(unit whichUnit, real heightOffset) -> vector
{
    vector v = vector.allocate();
    real x = GetUnitX(whichUnit), y = GetUnitY(whichUnit);
    MoveLocation(thistype.loc, x, y);
    v.x = x;
    v.y = y;
    v.z = GetUnitFlyHeight(whichUnit) + GetLocationZ(thistype.loc) + heightOffset;
    return v;
}

Something along those lines.

Last edited by BBQ : 10-24-2011 at 10:53 AM.
BBQ is offline   Reply With Quote
Old 10-24-2011, 04:38 PM   #50
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

You can already do this with the following two lines, I don't think that a wrapper for this is really needed:
Collapse JASS:
local vector v = vector.createTerrainPoint( GetUnitX(whichUnit), GetUnitY(whichUnit) )
set v.z = v.z + GetUnitFlyHeight(whichUnit) + heightOffset
__________________
Anitarf is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 12:24 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services