//Determines if the angle "a" is inside a cone of facing "b" with opening "o"
function Cone takes real a, real b, real o returns boolean
return Cos(a-b)>=Cos(o)
endfunction
Example:
Lets say there's a cone facing 0 degrees with opening 70, and we want to know if the angle 45 is inside of it...
//Determines if "a" gets closer to "b" by going clockwise.
function Clockwise takes real a, real b returns boolean
return Sin(b-a)<=0
endfunction
Example:
Lets take 2 angles, lets say 90 and 330
The function Clockwise(90,330) returns true, because 90 is closer to 330 by going clockwise...
I've come up with a very odd need:
Lets say I have 3 structs that share the same allocator and each one has a method with the same name as the other two, takes the same arguments, but does different things.
Is there a way to change the type of the instance so it would call other's struct's...
The fastest, easiest and with more flexible way to retrieve the nearest unit from a point
library GetNearestUnit /* v1.1.1
*/uses/*
*/ MergeSort /* thehelper.net/forums/showthread.php/168621-MergeSort
*/ LinkedListModule /*...
library Loc /* v1.1.0
*/uses/*
*/ LinkedListModule /* thehelper.net/forums/showthread.php/168775-LinkedListModule
Replacement of the Location native.
***********************************************************************
*
* struct Loc
*
* readonly real x
*...
Because i do, and i find it to be a very good replacement to the ugly Location native
The join method would be used to constantly have useful data of both locations at any time without repeating the same calculations
If you don't know what the "slope" variable is for, it's the relation between...
library GetPointZ
globals
private location Loc = Location(0,0)
endglobals
function GetPointZ takes real x, real y returns real
call MoveLocation(Loc,x,y)
return GetLocationZ(Loc)
endfunction
endlibrary
library LinkedListModule /* v2.3.1
Easy implementation of linked lists into structs.
***********************************************************************
*
* module LinkedList
*
* - Implement at the top of your struct, must extend array
*
* thistype next
* thistype...
EDIT: Issue Fixed. i'll upload this as a resource soon
I'm trying to code MergeSort using linked lists (better performance)
So i have this module that you can implement into your struct replacing the allocation methods, so far it only supports 1 linked list for the entire struct, I'll work on...
So i have some free time and decided to help out others with my coding.
Rules:
-Only vJass programming, make sure you have the latest version of NewGen in your map
-I don't provide or use custom models, that part is up to you
-All posts must follow this template
Name:
Description...