Class: Vec2
new Vec2(Number, Number)
Parameters:
| Name |
Type |
Description |
Number |
|
x |
Number |
|
y |
- Source:
Members
-
<static> this.x
-
Properties:
| Name |
Type |
Description |
Number |
|
x |
- Source:
-
<static> this.y
-
Properties:
| Name |
Type |
Description |
Number |
|
y |
- Source:
Methods
-
<static> add(Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
other |
- Source:
Returns:
this
-
<static> clamp(Vec2, Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
min |
Vec2 |
|
max |
- Source:
Returns:
this
-
<static> clone()
-
- Source:
Returns:
Vec2
-
<static> copy(Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
other |
- Source:
Returns:
this
-
<static> cross(Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
other |
- Source:
Returns:
Number
-
<static> div(Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
other |
- Source:
Returns:
this
-
<static> dot(Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
other |
- Source:
Returns:
Number
-
<static> fromArray(Array)
-
Parameters:
| Name |
Type |
Description |
Array |
|
array |
- Source:
Returns:
this
-
<static> fromJSON(Object)
-
Parameters:
| Name |
Type |
Description |
Object |
|
json |
- Source:
Returns:
this
-
<static> fromVec3(Vec3)
-
Parameters:
| Name |
Type |
Description |
Vec3 |
|
v |
- Source:
Returns:
this
-
<static> fromVec4(Vec4)
-
Parameters:
| Name |
Type |
Description |
Vec4 |
|
v |
- Source:
Returns:
this
-
<static> inverse()
-
- Source:
Returns:
this
-
<static> inverseVec(Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
other |
- Source:
Returns:
this
-
<static> length()
-
- Source:
Returns:
Number
-
<static> lengthSq()
-
- Source:
Returns:
Number
-
<static> lerp(Vec2, Number)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
other |
Number |
|
x |
- Source:
Returns:
Vec2
-
<static> max(Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
other |
- Source:
Returns:
this
-
<static> min(Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
other |
- Source:
Returns:
this
-
<static> mul(Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
other |
- Source:
Returns:
this
-
<static> normalize()
-
- Source:
Returns:
this
-
<static> positionFromMat4(Mat4)
-
Parameters:
| Name |
Type |
Description |
Mat4 |
|
m |
- Source:
Returns:
this
-
<static> positionFromMat32(Mat32)
-
Parameters:
| Name |
Type |
Description |
Mat32 |
|
m |
- Source:
Returns:
this
-
<static> sadd(Number)
-
Parameters:
| Name |
Type |
Description |
Number |
|
s |
- Source:
Returns:
this
-
<static> scaleFromMat2(Mat2)
-
Parameters:
| Name |
Type |
Description |
Mat2 |
|
m |
- Source:
Returns:
this
-
<static> scaleFromMat32(Mat32)
-
Parameters:
| Name |
Type |
Description |
Mat32 |
|
m |
- Source:
Returns:
this
-
<static> sdiv(Number)
-
Parameters:
| Name |
Type |
Description |
Number |
|
s |
- Source:
Returns:
this
-
<static> set(Number, Number)
-
Parameters:
| Name |
Type |
Description |
Number |
|
x |
Number |
|
y |
- Source:
Returns:
this
-
<static> setLength(Number)
-
Parameters:
| Name |
Type |
Description |
Number |
|
length |
- Source:
Returns:
Vec2
-
<static> smul(Number)
-
Parameters:
| Name |
Type |
Description |
Number |
|
s |
- Source:
Returns:
this
-
<static> ssub(Number)
-
Parameters:
| Name |
Type |
Description |
Number |
|
s |
- Source:
Returns:
this
-
<static> sub(Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
other |
- Source:
Returns:
this
-
<static> toArray()
-
- Source:
Returns:
Array
-
<static> toJSON()
-
- Source:
Returns:
Object
-
<static> toString()
-
- Source:
Returns:
String
-
-
Parameters:
| Name |
Type |
Description |
Mat2 |
|
m |
- Source:
Returns:
this
-
-
Parameters:
| Name |
Type |
Description |
Mat2 |
|
m |
- Source:
Returns:
this
-
-
Parameters:
| Name |
Type |
Description |
Mat3 |
|
m |
- Source:
Returns:
this
-
-
Parameters:
| Name |
Type |
Description |
Mat4 |
|
m |
- Source:
Returns:
this
-
-
Parameters:
| Name |
Type |
Description |
Mat32 |
|
m |
- Source:
Returns:
this
-
-
Parameters:
| Name |
Type |
Description |
Mat2 |
|
m |
- Source:
Returns:
this
-
-
Parameters:
| Name |
Type |
Description |
Mat32 |
|
m |
- Source:
Returns:
this
-
<static> vadd(Vec2, Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
a |
Vec2 |
|
b |
- Source:
Returns:
this
-
<static> vcross(Vec2, Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
a |
Vec2 |
|
b |
- Source:
Returns:
Number
-
<static> vdiv(Vec2, Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
a |
Vec2 |
|
b |
- Source:
Returns:
this
-
<static> vdot(Vec2, Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
a |
Vec2 |
|
b |
- Source:
Returns:
Number
-
<static> vlerp(Vec2, Vec2, Number)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
a |
Vec2 |
|
b |
Number |
|
x |
- Source:
Returns:
Vec2
-
<static> vmul(Vec2, Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
a |
Vec2 |
|
b |
- Source:
Returns:
this
-
<static> vsub(Vec2, Vec2)
-
Parameters:
| Name |
Type |
Description |
Vec2 |
|
a |
Vec2 |
|
b |
- Source:
Returns:
this