Skip to content

Add vector versions of each function

Compare
Choose a tag to compare
@bmoren bmoren released this 24 Jun 16:00
· 41 commits to master since this release

thank you to @wisehackermonkey for all of the work to add vector functions to the library!

Using this library with vectors

As of June 2020, this library now supports vector version of all functions. Simply use the function names below with Vector added onto the function name to utilize the vector version of the function. The function's arguments take in vectors instead of x/y values. Each of the examples below now has a commented example to demonstrate vector usage. We will be updating the documentation and examples in the future to make this distinction more clear. This in no way affects the original functionality of the library.

//Use vectors as input
let p1 	= createVector(100,100);
let mouse = createVector(mouseX,mouseY);
hit = collidePointPointVector(p1,mouse,10)