Package rope.vector
Class vec4
java.lang.Object
rope.vector.vec
rope.vector.vec4
- All Implemented Interfaces:
R_Constants
-
Field Summary
Fields inherited from interface rope.core.R_Constants
ARC, BEGIN, BEZIER_VERTEX, BLANK, BOTTOM, BOX, BREAK, CARTESIAN, CENTER, CHAOS, CHOICE, CHORD, CIRCULAR, CLOSE, CLOUD, CORNER, CORNERS, COS, CROSS, CROSS_BOX_2, CROSS_BOX_3, CROSS_RECT, CUBE_LINE, CURVE_VERTEX, DECAGON, DIAGONAL, DIAMETER, DODECAGON, DOWN, DRAW, DXF, DYNAMIC, EAST, ELLIPSE, END, EQUATION, EULER, FIRST, FIT, FLOWER, FLUID, FX2D, G, GOLD_ANGLE, GOLD_NUMBER, GRAVITY, HALF, HALF_PI, HENDECAGON, HEPTAGON, HEXAGON, HORIZONTAL, HOUSE, HPI, ICOSI_DODECAHEDRON_LINE, IMAGE, JAVA2D, LANDSCAPE, LAST, LEAF, LEFT, LINE, LINEAR, MAD, MAGNETIC, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MIX, NEXT, NONAGON, NONE, NORMAL, NORTH, NORTH_EAST, NORTH_WEST, NOTCH, NOTHING, NULL, OCTOGON, OCTOHEDRON_LINE, OPEN, ORDER, P2D, P3D, PDF, PENTAGON, PERLIN, PHI, PI, PIE, PIXEL, POINT, POLAR, POLYGON, PORTRAIT, POW, PREVIOUS, QPI, QUADRATIC_VERTEX, QUARTER_PI, RADIUS, RAND, RECT, REPEAT, RHOMBIC_COSI_DODECAHEDRON_SMALL_LINE, RIGHT, ROOT, ROOT2, RUN, SCALE, SEED, SHAPE, SIDE, SIN, SKY, SOUTH, SOUTH_EAST, SOUTH_WEST, SPAN, SPHERE, SPHERE_HIGH, SPHERE_LOW, SPHERE_MEDIUM, SPIRAL, SQUARE, STAR, STAR_3D, START, STATIC, STOP, SVG, TAN, TAU, TETRAHEDRON, TETRAHEDRON_LINE, TEXT, TOP, TREE, TRIANGLE, TWO_PI, UP, VERSION, VERTEX, VERTICAL, VIRUS, WALK, WEST
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabs()
add
(float a) add
(float ax, float ay, float az, float aw) addadd_w
(float w) add_x
(float x) add_y
(float y) add_z
(float z) alp
(float w) float
average()
average of all componentsblu
(float z) bri
(float z) boolean
boolean
return true if the vector this and vector target are in the same vector areaconstrain
(float max) constrain
(float min, float max) Constrains a value to not exceed a maximum and minimum value.copy()
copycos_wave
(int timeline, float s) WAVE COSINUScos_wave
(int timeline, float sx, float sy, float sz, float sw) dir()
return normal cartesian angle coorddir
(float a_x, float a_y, float a_z, float a_w) return normal cartesian angle coordreturn normal cartesian angle coorddiv
(float d) div
(float dx, float dy, float dz, float dw) divdiv_w
(float w) div_x
(float x) div_y
(float y) div_z
(float z) float
dot
(float x, float y, float z, float w) float
boolean
equals
(float target) * return true if the vector this is equals to float targetboolean
equals
(float t_x, float t_y, float t_z, float t_w) return true if the vector this is equals to float argumentsboolean
equalsgre
(float y) hue
(float x) inv()
limit
(float max) limitfloat
mag()
magfloat
magSq()
magSqmap
(float min_in, float max_in, float min_out, float max_out) mapmod
(float mod) mod
(float mod_x, float mod_y, float mod_z, float mod_w) mult
(float m) mult
(float mx, float my, float mz, float mw) multmult_w
(float w) mult_x
(float x) mult_y
(float y) mult_z
(float z) normalizep
(float z) pow
(float pow) pow
(float pow_x, float pow_y, float pow_z, float pow_w) q
(float w) rand
(float max) randomrand
(float min, float max) randomrandomred
(float x) s
(float x) sat
(float y) set
(float v) set
(float[] source) set
(float x, float y, float z, float w) set vecset
(int[] source) set_to
(int index, float arg) sin_wave
(int timeline, float s) WAVE SINUSsin_wave
(int timeline, float sx, float sy, float sz, float sw) sub
(float a) sub
(float ax, float ay, float az, float aw) subsub_w
(float w) sub_x
(float x) sub_y
(float y) sub_z
(float z) float
sum()
addition of all componentst
(float y) toString()
w
(float w) wave
(int timeline, float s) wave
(int timeline, float sx, float sy, float sz, float sw) x
(float x) y
(float y) z
(float z) Methods inherited from class rope.vector.vec
a, ab, abc, abcd, abcde, abcdef, all, alp, array, b, blu, bri, c, d, e, equals, f, get, get, get_size, gre, hsb, hsba, hue, map, max, min, p, pq, q, random, random, random_next_gaussian, random_next_gaussian, random_next_gaussian, red, rgb, rgba, s, sat, size, st, stpq, t, u, uv, v, w, ww, www, wwww, wwwx, wwwy, wwwz, wwx, wwxw, wwxx, wwxy, wwxz, wwy, wwyw, wwyx, wwyy, wwyz, wwz, wwzw, wwzx, wwzy, wwzz, wx, wxw, wxww, wxwx, wxwy, wxwz, wxx, wxxw, wxxx, wxxy, wxxz, wxy, wxyw, wxyx, wxyy, wxyz, wxz, wxzw, wxzx, wxzy, wxzz, wy, wyw, wyww, wywx, wywy, wywz, wyx, wyxw, wyxx, wyxy, wyxz, wyy, wyyw, wyyx, wyyy, wyyz, wyz, wyzw, wyzx, wyzy, wz, wzw, wzww, wzwx, wzwy, wzwz, wzx, wzxw, wzxx, wzxy, wzxz, wzy, wzyw, wzyx, wzyy, wzyz, wzz, wzzw, wzzx, wzzy, wzzz, x, xw, xww, xwww, xwwx, xwwy, xwwz, xwx, xwxw, xwxx, xwxy, xwxz, xwy, xwyw, xwyx, xwyy, xwyz, xwz, xwzw, xwzx, xwzy, xwzz, xx, xxw, xxww, xxwx, xxwy, xxwz, xxx, xxxw, xxxx, xxxy, xxxz, xxy, xxyw, xxyx, xxyy, xxyz, xxz, xxzw, xxzx, xxzy, xxzz, xy, xyw, xyww, xywx, xywy, xywz, xyx, xyxw, xyxx, xyxy, xyxz, xyy, xyyw, xyyx, xyyy, xyyz, xyz, xyzw, xyzx, xyzy, xyzz, xz, xzw, xzww, xzwx, xzwy, xzwz, xzx, xzxw, xzxx, xzxy, xzxz, xzy, xzyw, xzyx, xzyy, xzyz, xzzw, xzzx, xzzy, xzzz, y, yw, yww, ywww, ywwx, ywwy, ywwz, ywx, ywxw, ywxx, ywxy, ywxz, ywy, ywyw, ywyx, ywyy, ywyz, ywz, ywzw, ywzx, ywzy, ywzz, yx, yxw, yxww, yxwx, yxwy, yxwz, yxx, yxxw, yxxx, yxxy, yxxz, yxy, yxyw, yxyx, yxyy, yxyz, yxz, yxzw, yxzx, yxzy, yxzz, yy, yyw, yyww, yywx, yywy, yywz, yyx, yyxw, yyxx, yyxy, yyxz, yyy, yyyw, yyyx, yyyy, yyyz, yyz, yyzw, yyzx, yyzy, yyzz, yz, yzw, yzww, yzwx, yzwy, yzwz, yzx, yzxw, yzxx, yzxy, yzxz, yzy, yzyw, yzyx, yzyy, yzyz, yzzw, yzzx, yzzy, yzzz, z, zw, zww, zwww, zwwx, zwwy, zwwz, zwx, zwxw, zwxx, zwxy, zwxz, zwy, zwyw, zwyx, zwyy, zwyz, zwz, zwzw, zwzx, zwzy, zwzz, zx, zxw, zxww, zxwx, zxwy, zxwz, zxx, zxxw, zxxx, zxxy, zxxz, zxy, zxyw, zxyx, zxyy, zxyz, zxz, zxzw, zxzx, zxzy, zxzz, zy, zyw, zyww, zywx, zywy, zywz, zyx, zyxw, zyxx, zyxy, zyxz, zyy, zyyw, zyyx, zyyy, zyyz, zyz, zyzw, zyzx, zyzy, zyzz, zz, zzw, zzww, zzwx, zzwy, zzwz, zzx, zzxw, zzxx, zzxy, zzxz, zzy, zzyw, zzyx, zzyy, zzyz, zzz, zzzw, zzzx, zzzy, zzzz
-
Constructor Details
-
vec4
public vec4() -
vec4
public vec4(float v) -
vec4
public vec4(float x, float y, float z, float w) -
vec4
-
vec4
-
vec4
public vec4(float[] source) -
vec4
public vec4(int[] source)
-
-
Method Details
-
set
set vec- Parameters:
x
-y
-z
-w
-- Returns:
-
set
-
set
-
set
-
set
-
set
-
set_to
-
inv
- Returns:
- inverse all argument
-
x
-
add_x
-
sub_x
-
mult_x
-
div_x
-
y
-
add_y
-
sub_y
-
mult_y
-
div_y
-
z
-
add_z
-
sub_z
-
mult_z
-
div_z
-
w
-
add_w
-
sub_w
-
mult_w
-
div_w
-
red
-
gre
-
blu
-
hue
-
sat
-
bri
-
alp
-
s
-
t
-
p
-
q
-
mult
mult- Parameters:
mx
-my
-mz
-mw
-- Returns:
-
mult
-
mult
-
mult
-
div
div- Parameters:
dx
-dy
-dz
-dw
-- Returns:
-
div
-
div
-
div
-
add
add- Parameters:
ax
-ay
-az
-aw
-- Returns:
-
add
-
add
-
add
-
sub
sub- Parameters:
ax
-ay
-az
-aw
-- Returns:
-
sub
-
sub
-
sub
-
abs
- Returns:
- the absolute value of the vector
-
dot
- Parameters:
v
-- Returns:
-
dot
public float dot(float x, float y, float z, float w) -
pow
- Parameters:
pow
-- Returns:
- Vec4 component powering by each value
-
pow
-
normalize
normalize- Parameters:
target
-- Returns:
-
normalize
-
map
map- Parameters:
min_in
-max_in
-min_out
-max_out
-- Returns:
- Vec4 where each target is Vec component
-
map
-
limit
limit- Parameters:
max
-- Returns:
-
constrain
-
constrain
-
constrain
-
constrain
Constrains a value to not exceed a maximum and minimum value.- Parameters:
min
-max
-- Returns:
-
rand
random- Parameters:
max
- float- Returns:
- random value from 0 to float max for each argument
-
rand
random- Parameters:
min
- floatmax
- float- Returns:
- random value from float min to float max for each argument
-
rand
random- Parameters:
min
-max
-- Returns:
- random value from vec min to vec max for each argument
-
wave
- Parameters:
timeline
- give the tempo modification of the waves
- float speed in relation with the timeline, this value is often between 0 and 1, but no obligation- Returns:
- vec4 cosinus of each argument
-
wave
- Parameters:
timeline
- give the tempo modification of the wavesx
- float speed in relation with the timeline, this value is often between 0 and 1, but no obligationsy
- float speed in relation with the timeline, this value is often between 0 and 1, but no obligationsz
- float speed in relation with the timeline, this value is often between 0 and 1, but no obligationsw
- float speed in relation with the timeline, this value is often between 0 and 1, but no obligation- Returns:
- vec4 cosinus of each argument
-
cos_wave
WAVE COSINUS- Parameters:
timeline
- give the tempo modification of the waves
- float speed in relation with the timeline, this value is often between 0 and 1, but no obligation- Returns:
- vec4 cosinus of each argument
-
cos_wave
- Parameters:
timeline
- give the tempo modification of the wavesx
- float speed in relation with the timeline, this value is often between 0 and 1, but no obligationsy
- float speed in relation with the timeline, this value is often between 0 and 1, but no obligationsz
- float speed in relation with the timeline, this value is often between 0 and 1, but no obligationsw
- float speed in relation with the timeline, this value is often between 0 and 1, but no obligation- Returns:
-
sin_wave
WAVE SINUS- Parameters:
timeline
- give the tempo modification of the waves
- float speed for all vec arg- Returns:
- vec4 sinus of the value
-
sin_wave
- Parameters:
timeline
- give the tempo modification of the wavesx
- float speed in relation with the timeline, this value is often between 0 and 1, but no obligationsy
- float speed in relation with the timeline, this value is often between 0 and 1, but no obligationsz
- float speed in relation with the timeline, this value is often between 0 and 1, but no obligationsw
- float speed in relation with the timeline, this value is often between 0 and 1, but no obligation- Returns:
-
mod
- Parameters:
mod_x
-mod_y
-mod_z
-mod_w
-- Returns:
- return the modulo of each element in the same order
-
mod
-
mod
-
sum
public float sum()addition of all components- Returns:
- float
-
average
public float average()average of all components- Returns:
- float average of sum components
-
dir
return normal cartesian angle coord- Returns:
- vec4
-
dir
return normal cartesian angle coord- Parameters:
a_x
- floata_y
- floata_z
- floata_w
- float- Returns:
- vec4
-
dir
return normal cartesian angle coord- Parameters:
origin
- vec4- Returns:
- vec4
-
magSq
public float magSq()magSq- Returns:
-
mag
public float mag()mag- Returns:
-
equals
equals- Parameters:
target
-- Returns:
- true if the target components is equals to Vec
-
equals
public boolean equals(float target) * return true if the vector this is equals to float target- Parameters:
target
-- Returns:
-
equals
public boolean equals(float t_x, float t_y, float t_z, float t_w) return true if the vector this is equals to float arguments- Parameters:
t_x
-t_y
-t_z
-t_w
-- Returns:
-
compare
return true if the vector this and vector target are in the same vector area- Parameters:
target
-area
-- Returns:
-
compare
- Parameters:
target
-area
-- Returns:
-
copy
copy- Returns:
-
toString
-