|
@@ -25,11 +25,11 @@
|
|
|
|
|
|
<h3>[name]( [page:Float x], [page:Float y] )</h3>
|
|
|
<div>
|
|
|
- x -- todo <br />
|
|
|
- y -- todo
|
|
|
+ x -- [page:Float] representing the x value of the vector <br />
|
|
|
+ y -- [page:Float] representing the y value of the vector
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ A vector in 2 dimensional space
|
|
|
</div>
|
|
|
|
|
|
|
|
@@ -134,92 +134,94 @@
|
|
|
</div>
|
|
|
|
|
|
|
|
|
- <h3>.clamp([page:todo min], [page:todo max]) [page:todo]</h3>
|
|
|
+ <h3>.clamp([page:todo min], [page:todo max]) [page:this]</h3>
|
|
|
<div>
|
|
|
- min -- todo <br />
|
|
|
- max -- todo
|
|
|
+ min -- [page:Vector2] containing the min x and y values in the desired range <br />
|
|
|
+ max -- [page:Vector2] containing the max x and y values in the desired range
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ If this vector's x or y value is greater than the max vector's x or y value, it is replaced by that value. <br /> If this vector's x or y value is less than the min vector's x or y value, it is replace by that value.
|
|
|
</div>
|
|
|
|
|
|
- <h3>.toArray() [page:todo]</h3>
|
|
|
+ <h3>.toArray() [page:Array]</h3>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Returns an array [x, y].
|
|
|
</div>
|
|
|
|
|
|
- <h3>.lerp([page:todo v], [page:todo alpha]) [page:todo]</h3>
|
|
|
+ <h3>.lerp([page:todo v], [page:todo alpha]) [page:this]</h3>
|
|
|
<div>
|
|
|
- v -- todo <br />
|
|
|
- alpha -- todo
|
|
|
+ v -- [page:Vector2] <br />
|
|
|
+ alpha -- [page:Float] between 0 and 1;
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Linear interpolation between this vector and v, where alpha is the percent along the line.
|
|
|
</div>
|
|
|
|
|
|
- <h3>.setComponent([page:todo index], [page:todo value]) [page:todo]</h3>
|
|
|
+ <h3>.setComponent([page:todo index], [page:todo value]) [page:undefined]</h3>
|
|
|
<div>
|
|
|
- index -- todo <br />
|
|
|
- value -- todo
|
|
|
+ index -- 0 or 1 <br />
|
|
|
+ value -- [page:todo Float]
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ if index equals 0 method replaces this.x with value. <br />
|
|
|
+ if index equals 1 method replaces this.y with value.
|
|
|
</div>
|
|
|
|
|
|
- <h3>.min([page:todo v]) [page:todo]</h3>
|
|
|
+ <h3>.min([page:todo v]) [page:this]</h3>
|
|
|
<div>
|
|
|
- v -- todo
|
|
|
+ v -- [page:Vector2]
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ If this vector's x or y value is less than v's x or y value, replace that value with the corresponding min value.
|
|
|
</div>
|
|
|
|
|
|
- <h3>.addScalar([page:todo s]) [page:todo]</h3>
|
|
|
+ <h3>.addScalar([page:todo s]) [page:this]</h3>
|
|
|
<div>
|
|
|
- s -- todo
|
|
|
+ s -- [page:todo Float]
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Add the scalar value s to this vector's x and y values.
|
|
|
</div>
|
|
|
|
|
|
- <h3>.getComponent([page:todo index]) [page:todo]</h3>
|
|
|
+ <h3>.getComponent([page:todo index]) [page:todo Float]</h3>
|
|
|
<div>
|
|
|
- index -- todo
|
|
|
+ index -- 0 or 1
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ if index equals 0 returns the x value. <br />
|
|
|
+ if index equals 1 returns the y value.
|
|
|
</div>
|
|
|
|
|
|
- <h3>.fromArray([page:todo array]) [page:todo]</h3>
|
|
|
+ <h3>.fromArray([page:todo array]) [page:todo this]</h3>
|
|
|
<div>
|
|
|
- array -- todo
|
|
|
+ array -- [page:todo Array] of length 2
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ Sets this vector's x value to be array[0] and y value to be array[1].
|
|
|
</div>
|
|
|
|
|
|
- <h3>.max([page:todo v]) [page:todo]</h3>
|
|
|
+ <h3>.max([page:todo v]) [page:todo this]</h3>
|
|
|
<div>
|
|
|
- v -- todo
|
|
|
+ v -- [page:Vector2]
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ If this vector's x or y value is greater than v's x or y value, replace that value with the corresponding max value.
|
|
|
</div>
|
|
|
|
|
|
- <h3>.setX([page:todo x]) [page:todo]</h3>
|
|
|
+ <h3>.setX([page:todo x]) [page:todo this]</h3>
|
|
|
<div>
|
|
|
- x -- todo
|
|
|
+ x -- [page:todo Float]
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ replace this vector's x value with x.
|
|
|
</div>
|
|
|
|
|
|
- <h3>.setY([page:todo y]) [page:todo]</h3>
|
|
|
+ <h3>.setY([page:todo y]) [page:todo this]</h3>
|
|
|
<div>
|
|
|
- y -- todo
|
|
|
+ y -- [page:todo Float]
|
|
|
</div>
|
|
|
<div>
|
|
|
- todo
|
|
|
+ replace this vector's y value with y.
|
|
|
</div>
|
|
|
|
|
|
<h2>Source</h2>
|