Classes
Interface Definitions
-
Observer used to listen for observable point changes.
Properties:
Name Type Description _onUpdate
(point: T) => void Callback to call when the point has updated.
-
Common interface for points. Both Point and ObservablePoint implement it
Properties:
Name Type Description x
number X coord
y
number Y coord
-
Common interface for points. Both Point and ObservablePoint implement it
Properties:
Name Type Description copyFrom
(p: PointData) => this Copies x and y from the given point
copyTo
(p: T) => T Copies x and y into the given point
equals
(p: PointData) => boolean Returns true if the given point is equal to this point
set
(x: number, y: number) => void Sets the point to a new x and y position. If y is omitted, both x and y will be set to x.
-
A basic object to define a Pixi shape.
Properties:
Name Type Description type
SHAPE_PRIMITIVE The type of the object, mainly used to avoid
instanceof
checksx
number The X coordinate of the shape
y
number The Y coordinate of the shape
-
Defines a size with a width and a height.
Properties:
Name Type Description height
number The height.
width
number The width.
Namespaces
Members
Conversion factor for converting degrees to radians.
Two Pi.
Conversion factor for converting radians to degrees.
Type Definitions
Constants that identify shapes, mainly to prevent instanceof
calls.
Methods
The idea of a relative epsilon comparison is to find the difference between the two numbers,
and see if it is less than Math.EPSILON
.
Name | Type | Description |
---|---|---|
a |
number |
First floating number to compare. |
b |
number |
Second floating number to compare. |
Returns:
Type | Description |
---|---|
boolean | Returns true if the difference between the values is less than Math.EPSILON ; otherwise false . |
The idea of a relative epsilon comparison is to find the difference between the two numbers,
and see if it is less than a given epsilon.
A good epsilon would be the N% of the largest of the two values or Math.EPSILON
.
Note: Only available with pixi.js/math-extras.
Name | Type | Description |
---|---|---|
a |
number |
First floating number to compare. |
b |
number |
Second floating number to compare. |
epsilon |
number |
The epsilon to compare to. The larger the epsilon, the easier for the numbers to be considered equals. |
Returns:
Type | Description |
---|---|
boolean | Returns true if the difference between the values is less than the given epsilon;
otherwise false . |
Checks if a number is a power of two.
Name | Type | Description |
---|---|---|
v |
number |
input value |
Returns:
Type | Description |
---|---|
boolean | true if value is power of two |
Computes the point where non-coincident and non-parallel Lines intersect.
Coincident or parallel lines return a NaN
point {x: NaN, y: NaN}
.
The intersection point may land outside the extents of the lines.
Note: Only available with pixi.js/math-extras.
Name | Type | Description |
---|---|---|
aStart |
PointData |
First point of the first line. |
aEnd |
PointData |
Second point of the first line. |
bStart |
PointData |
First point of the second line. |
bEnd |
PointData |
Second point of the second line. |
Returns:
Type | Description |
---|---|
PointData | The point where the lines intersect. |
Computes the point where non-coincident and non-parallel Lines intersect.
Coincident or parallel lines return a NaN
point {x: NaN, y: NaN}
.
The intersection point may land outside the extents of the lines.
Note: Only available with pixi.js/math-extras.
Name | Type | Description |
---|---|---|
aStart |
PointData |
First point of the first line. |
aEnd |
PointData |
Second point of the first line. |
bStart |
PointData |
First point of the second line. |
bEnd |
PointData |
Second point of the second line. |
outPoint |
PointData |
A Point-like object in which to store the value, optional (otherwise will create a new Point). |
Returns:
Type | Description |
---|---|
PointData | The point where the lines intersect or a NaN Point. |
Computes ceil of log base 2
Name | Type | Description |
---|---|---|
v |
number |
input value |
Returns:
Type | Description |
---|---|
number | logarithm base 2 |
Rounds to next power of two.
Name | Type | Description |
---|---|---|
v |
number |
input value |
Returns:
Type | Description |
---|---|
number |
|
Computes the point where non-coincident and non-parallel segments intersect.
Coincident, parallel or non-intersecting segments return a NaN
point {x: NaN, y: NaN}
.
The intersection point must land inside the extents of the segments or return a NaN
Point.
Note: Only available with pixi.js/math-extras.
Name | Type | Description |
---|---|---|
aStart |
PointData |
Starting point of the first segment. |
aEnd |
PointData |
Ending point of the first segment. |
bStart |
PointData |
Starting point of the second segment. |
bEnd |
PointData |
Ending point of the second segment. |
Returns:
Type | Description |
---|---|
PointData | The point where the segments intersect. |
Computes the point where non-coincident and non-parallel segments intersect.
Coincident, parallel or non-intersecting segments return a NaN
point {x: NaN, y: NaN}
.
The intersection point must land inside the extents of the segments or return a NaN
Point.
Note: Only available with pixi.js/math-extras.
Name | Type | Description |
---|---|---|
aStart |
PointData |
Starting point of the first segment. |
aEnd |
PointData |
Ending point of the first segment. |
bStart |
PointData |
Starting point of the second segment. |
bEnd |
PointData |
Ending point of the second segment. |
outPoint |
PointData |
A Point-like object in which to store the value, optional (otherwise will create a new Point). |
Returns:
Type | Description |
---|---|
PointData | The point where the segments intersect or a NaN Point. |