|
static PVector[] | makePVectorArray (float[] x, float[] y) |
|
static PVector[] | makePVectorArray (float[] x, float[] y, float[] z) |
|
static Vector3D | convert (PVector pv) |
|
static PVector | convert (Vector3D v3d) |
|
static PVector[] | convert (Vector3D[] v3d) |
|
static PVector[][] | convert (Vector3D[][] v3d) |
|
static PVector | slerp (final PVector start, final PVector end, float t) |
|
static PVector | slerp (final PVector start, final PVector end, float t, boolean norm) |
|
static PVector | slerp (final PVector start, final PVector end, float t, float mag) |
|
static PVector[] | deepCopy (PVector[] array) |
|
static PVector[][] | deepCopy (PVector[][] array) |
|
static UV[] | deepCopy (UV[] array) |
|
static UV[][] | deepCopy (UV[][] array) |
|
static int[] | deepCopy (int[] array) |
|
static< T > T[] | reverse (T[] array) |
|
static int[] | reverse (int[] array) |
|
static int[] | box_box_p (int ax0, int ay0, int ax1, int ay1, int bx0, int by0, int bx1, int by1) |
|
A variety of utility methods used by the library. Including
-
Some simple methods to covert vectors between Processing and Apache Commons Maths implementations.
-
array copy methods for PVector and Util classes.
- Author
- Peter Lager
static int [] shapes3d.utils.Util.box_box_p |
( |
int |
ax0, |
|
|
int |
ay0, |
|
|
int |
ax1, |
|
|
int |
ay1, |
|
|
int |
bx0, |
|
|
int |
by0, |
|
|
int |
bx1, |
|
|
int |
by1 |
|
) |
| |
|
static |
If two boxes overlap then the overlap region is another box. This method is used to calculate the coordinates of the overlap.
The boxes are represented by the top-left and bottom-right corner coordinates. If the returned array has a length: 0 then they do not overlap
4 then these are the coordinates of the top-left and bottom-right corners of the overlap region.
- Parameters
-
ax0 | top-left corner of rectangle A |
ay0 | top-left corner of rectangle A |
ax1 | bottom-right corner of rectangle A |
ay1 | bottom-right corner of rectangle A |
bx0 | top-left corner of rectangle B |
by0 | top-left corner of rectangle B |
bx1 | bottom-right corner of rectangle B |
by1 | bottom-right corner of rectangle B |
- Returns
- an array with the overlap box coordinates (if any)
static Vector3D shapes3d.utils.Util.convert |
( |
PVector |
pv | ) |
|
|
static |
Convert from Processing to AMC vector implementation
- Parameters
-
- Returns
- the Vector3D result
static PVector shapes3d.utils.Util.convert |
( |
Vector3D |
v3d | ) |
|
|
static |
Convert from AMC to Processing vector implementation
- Parameters
-
v3d | the Vector3D to convert |
- Returns
- the PVector result
static PVector [] shapes3d.utils.Util.convert |
( |
Vector3D[] |
v3d | ) |
|
|
static |
Convert from AMC to Processing vector implementation
- Parameters
-
v3d | the array of Vector3D to convert |
- Returns
- the PVector array result
static PVector [][] shapes3d.utils.Util.convert |
( |
Vector3D |
v3d[][] | ) |
|
|
static |
Convert from AMC to Processing vector implementation
- Parameters
-
v3d | the 2D array of Vector3D to convert |
- Returns
- the PVector 2D array result
static PVector [] shapes3d.utils.Util.deepCopy |
( |
PVector[] |
array | ) |
|
|
static |
Create and return a deep copy of a 1D array of PVectors
- Parameters
-
array | the PVector array to duplicate |
- Returns
- a copy of the original array
static PVector [][] shapes3d.utils.Util.deepCopy |
( |
PVector |
array[][] | ) |
|
|
static |
Create and return a deep copy of a 2D array of PVectors
- Parameters
-
array | the PVector array to duplicate |
- Returns
- a copy of the original array
static UV [] shapes3d.utils.Util.deepCopy |
( |
UV[] |
array | ) |
|
|
static |
Create and return a deep copy of a 1D array of UVs
- Parameters
-
array | the UV array to duplicate |
- Returns
- a copy of the original array
static UV [][] shapes3d.utils.Util.deepCopy |
( |
UV |
array[][] | ) |
|
|
static |
Create and return a deep copy of a 2D array of UVs
- Parameters
-
array | the UV array to duplicate |
- Returns
- a copy of the original array
static int [] shapes3d.utils.Util.deepCopy |
( |
int[] |
array | ) |
|
|
static |
Create and return a deep copy of a 1D int array
- Parameters
-
array | the int array to duplicate |
- Returns
- a copy of the original array
static PVector [] shapes3d.utils.Util.makePVectorArray |
( |
float[] |
x, |
|
|
float[] |
y |
|
) |
| |
|
static |
Create an array of PVectors form 2 array holding x and y values.
If the arrays passed to this method differ in length the extra in the longer array are ignored.
- Parameters
-
x | array of x values |
y | array of y values |
- Returns
- an array of PVectors
static PVector [] shapes3d.utils.Util.makePVectorArray |
( |
float[] |
x, |
|
|
float[] |
y, |
|
|
float[] |
z |
|
) |
| |
|
static |
Create an array of PVectors from 3 arrays holding x, y and z values.
If the arrays passed to this method differ in length the extra in the longer arrays are ignored.
- Parameters
-
x | array of x values |
y | array of y values |
y | array of z values |
- Returns
- an array of PVectors
static <T> T [] shapes3d.utils.Util.reverse |
( |
T[] |
array | ) |
|
|
static |
Reverse the elements in an the array of objects.
- Parameters
-
<T> | the type of element in the array |
array | the array to be reversed |
- Returns
- the reversed array
static int [] shapes3d.utils.Util.reverse |
( |
int[] |
array | ) |
|
|
static |
Reverse the elements (integer primitive type) in an array.
- Parameters
-
array | the array to be reversed |
- Returns
- the reversed array
static PVector shapes3d.utils.Util.slerp |
( |
final PVector |
start, |
|
|
final PVector |
end, |
|
|
float |
t |
|
) |
| |
|
static |
Perform a spherical linear interpolation between 2 vectors.
The magnitude of the returned vector will also be interpolated.
- Parameters
-
start | the start vector (t == 0) |
end | the end vector (t == 1) |
t | parametric constrained to the range ≥ 0 and ≤ 1 |
- Returns
- the interpolated vector
static PVector shapes3d.utils.Util.slerp |
( |
final PVector |
start, |
|
|
final PVector |
end, |
|
|
float |
t, |
|
|
boolean |
norm |
|
) |
| |
|
static |
Perform a spherical linear interpolation between 2 vectors.
If required the returned vector will be normalized (i.e. a unit vector)
- Parameters
-
start | the start vector (t == 0) |
end | the end vector (t == 1) |
t | parametric constrained to the range ≥ 0 and ≤ 1 |
norm | if true will normalize the interpolated vector |
- Returns
- the interpolated vector
static PVector shapes3d.utils.Util.slerp |
( |
final PVector |
start, |
|
|
final PVector |
end, |
|
|
float |
t, |
|
|
float |
mag |
|
) |
| |
|
static |
Perform a spherical linear interpolation between 2 vectors.
The size of the returned vector will be set by the last parameter.
- Parameters
-
start | the start vector (t == 0) |
end | the end vector (t == 1) |
t | parametric constrained to the range ≥ 0 and ≤ 1 |
mag | the required size of the interpolated vector |
- Returns
- the interpolated vector
The documentation for this class was generated from the following file:
- /Users/peter/git/shapes3d-repos/Shapes 3D/src/shapes3d/utils/Util.java