Search
Preparing search index...
The search index is not available
gtools
Options
All
Public
Public/Protected
All
Inherited
Externals
Menu
gtools
math/vector2
Vector2
Class Vector2
Hierarchy
Vector2
Implements
SimpleVector2
Index
Constructors
constructor
Properties
x
y
Accessors
avg
length
sum
BOTTOM
LEFT
ONE
RIGHT
UP
ZERO
Methods
add
clone
div
get
Normalized
is
Zero
mul
normalize
set
set
Data
sub
add
Num
angle
Between
Points
create
Outline
Range
dist
dot
equals
from
from
Array
from
Vec
get
Abs
is
Vector
is
Visible
lerp
max
min
mul
Num
normalize
size
sub
sum
Constructors
constructor
new
Vector2
(
x
?:
number
, y
?:
number
)
:
Vector2
Parameters
x:
number
= 0
y:
number
= 0
Returns
Vector2
Properties
x
x
:
number
= 0
y
y
:
number
= 0
Accessors
avg
get
avg
(
)
:
number
Returns
number
length
get
length
(
)
:
number
Returns
number
sum
get
sum
(
)
:
number
Returns
number
Static
BOTTOM
get
BOTTOM
(
)
:
Vector2
Returns
Vector2
Static
LEFT
get
LEFT
(
)
:
Vector2
Returns
Vector2
Static
ONE
get
ONE
(
)
:
Vector2
Returns
Vector2
Static
RIGHT
get
RIGHT
(
)
:
Vector2
Returns
Vector2
Static
UP
get
UP
(
)
:
Vector2
Returns
Vector2
Static
ZERO
get
ZERO
(
)
:
Vector2
Returns
Vector2
Methods
add
add
(
value
:
number
|
Readonly
<
SimpleVector2
>
)
:
Vector2
Parameters
value:
number
|
Readonly
<
SimpleVector2
>
Returns
Vector2
clone
clone
(
)
:
Vector2
Returns
Vector2
div
div
(
value
:
number
|
Readonly
<
SimpleVector2
>
)
:
Vector2
Parameters
value:
number
|
Readonly
<
SimpleVector2
>
Returns
Vector2
get
Normalized
get
Normalized
(
result
?:
Vector2
)
:
SimpleVector2
Parameters
result:
Vector2
= ...
Returns
SimpleVector2
is
Zero
is
Zero
(
)
:
boolean
Returns
boolean
mul
mul
(
value
:
number
|
Readonly
<
SimpleVector2
>
)
:
Vector2
Parameters
value:
number
|
Readonly
<
SimpleVector2
>
Returns
Vector2
normalize
normalize
(
)
:
Vector2
Returns
Vector2
set
set
(
vec
:
Readonly
<
SimpleVector2
>
)
:
Vector2
Parameters
vec:
Readonly
<
SimpleVector2
>
Returns
Vector2
set
Data
set
Data
(
x
:
number
, y
:
number
)
:
Vector2
Parameters
x:
number
y:
number
Returns
Vector2
sub
sub
(
value
:
number
|
Readonly
<
SimpleVector2
>
)
:
Vector2
Parameters
value:
number
|
Readonly
<
SimpleVector2
>
Returns
Vector2
Static
add
Num
add
Num
(
vecA
:
Readonly
<
SimpleVector2
>
, val
:
number
, result
?:
Vector2
)
:
Vector2
Parameters
vecA:
Readonly
<
SimpleVector2
>
val:
number
result:
Vector2
= ...
Returns
Vector2
Static
angle
Between
Points
angle
Between
Points
(
obsX
:
number
, obsY
:
number
, px1
:
number
, py1
:
number
, px2
:
number
, py2
:
number
)
:
number
Parameters
obsX:
number
obsY:
number
px1:
number
py1:
number
px2:
number
py2:
number
Returns
number
Static
create
Outline
Range
create
Outline
Range
(
points
:
readonly
Readonly
<
SimpleVector2
>
[]
)
:
Range
<
SimpleVector2
>
Parameters
points:
readonly
Readonly
<
SimpleVector2
>
[]
Returns
Range
<
SimpleVector2
>
Static
dist
dist
(
vecA
:
Readonly
<
SimpleVector2
>
, vecB
:
Readonly
<
SimpleVector2
>
)
:
number
Parameters
vecA:
Readonly
<
SimpleVector2
>
vecB:
Readonly
<
SimpleVector2
>
Returns
number
Static
dot
dot
(
vecA
:
Readonly
<
SimpleVector2
>
, vecB
:
Readonly
<
SimpleVector2
>
)
:
number
Parameters
vecA:
Readonly
<
SimpleVector2
>
vecB:
Readonly
<
SimpleVector2
>
Returns
number
Static
equals
equals
(
vecA
:
Readonly
<
SimpleVector2
>
, vecB
:
Readonly
<
SimpleVector2
>
)
:
boolean
Parameters
vecA:
Readonly
<
SimpleVector2
>
vecB:
Readonly
<
SimpleVector2
>
Returns
boolean
Static
from
from
(
valA
:
number
, valB
?:
number
)
:
Vector2
Parameters
valA:
number
valB:
number
= ...
Returns
Vector2
Static
from
Array
from
Array
(
val
:
[
number
,
number
]
|
Float32Array
)
:
Vector2
Parameters
val:
[
number
,
number
]
|
Float32Array
Returns
Vector2
Static
from
Vec
from
Vec
(
vec
:
Readonly
<
SimpleVector2
>
)
:
Vector2
Parameters
vec:
Readonly
<
SimpleVector2
>
Returns
Vector2
Static
get
Abs
get
Abs
(
vec
:
Readonly
<
SimpleVector2
>
, result
?:
Vector2
)
:
Vector2
Parameters
vec:
Readonly
<
SimpleVector2
>
result:
Vector2
= ...
Returns
Vector2
Static
is
Vector
is
Vector
(
item
:
any
)
:
item
is
SimpleVector2
Parameters
item:
any
Returns
item
is
SimpleVector2
Static
is
Visible
is
Visible
(
obsX
:
number
, obsY
:
number
, angle
:
number
, cutOff
:
number
, px
:
number
, py
:
number
)
:
boolean
Parameters
obsX:
number
obsY:
number
angle:
number
cutOff:
number
px:
number
py:
number
Returns
boolean
Static
lerp
lerp
(
start
:
Readonly
<
SimpleVector2
>
, end
:
Readonly
<
SimpleVector2
>
, ratio
:
number
)
:
Vector2
Parameters
start:
Readonly
<
SimpleVector2
>
end:
Readonly
<
SimpleVector2
>
ratio:
number
Returns
Vector2
Static
max
max
(
vecA
:
Readonly
<
SimpleVector2
>
, vecB
:
Readonly
<
SimpleVector2
>
, result
?:
Vector2
)
:
Vector2
Parameters
vecA:
Readonly
<
SimpleVector2
>
vecB:
Readonly
<
SimpleVector2
>
result:
Vector2
= ...
Returns
Vector2
Static
min
min
(
vecA
:
Readonly
<
SimpleVector2
>
, vecB
:
Readonly
<
SimpleVector2
>
, result
?:
Vector2
)
:
Vector2
Parameters
vecA:
Readonly
<
SimpleVector2
>
vecB:
Readonly
<
SimpleVector2
>
result:
Vector2
= ...
Returns
Vector2
Static
mul
Num
mul
Num
(
vecA
:
Readonly
<
SimpleVector2
>
, val
:
number
, result
?:
Vector2
)
:
Vector2
Parameters
vecA:
Readonly
<
SimpleVector2
>
val:
number
result:
Vector2
= ...
Returns
Vector2
Static
normalize
normalize
(
vec
:
SimpleVector2
, result
?:
SimpleVector2
)
:
SimpleVector2
Parameters
vec:
SimpleVector2
result:
SimpleVector2
= ...
Returns
SimpleVector2
Static
size
size
(
vec
:
Readonly
<
SimpleVector2
>
)
:
number
Parameters
vec:
Readonly
<
SimpleVector2
>
Returns
number
Static
sub
sub
(
vecA
:
Readonly
<
SimpleVector2
>
, vecB
:
Readonly
<
SimpleVector2
>
, result
?:
Vector2
)
:
Vector2
Parameters
vecA:
Readonly
<
SimpleVector2
>
vecB:
Readonly
<
SimpleVector2
>
result:
Vector2
= ...
Returns
Vector2
Static
sum
sum
(
vecA
:
Readonly
<
SimpleVector2
>
, vecB
:
Readonly
<
SimpleVector2
>
, result
?:
Vector2
)
:
Vector2
Parameters
vecA:
Readonly
<
SimpleVector2
>
vecB:
Readonly
<
SimpleVector2
>
result:
Vector2
= ...
Returns
Vector2
Modules
math/vector2
Vector2
constructor
x
y
avg
length
sum
BOTTOM
LEFT
ONE
RIGHT
UP
ZERO
add
clone
div
get
Normalized
is
Zero
mul
normalize
set
set
Data
sub
add
Num
angle
Between
Points
create
Outline
Range
dist
dot
equals
from
from
Array
from
Vec
get
Abs
is
Vector
is
Visible
lerp
max
min
mul
Num
normalize
size
sub
sum
Generated using
TypeDoc