- java.lang.Object
-
- org.praxislive.code.CodeDelegate
-
- org.praxislive.code.DefaultCodeDelegate
-
- All Implemented Interfaces:
DefaultDelegateAPI
- Direct Known Subclasses:
AudioCodeDelegate
,CoreCodeDelegate
,P2DCodeDelegate
,P3DCodeDelegate
,TFCodeDelegate
,VideoCodeDelegate
public class DefaultCodeDelegate extends CodeDelegate implements DefaultDelegateAPI
Default base for code delegates providing a variety of functions.
-
-
Constructor Summary
Constructors Constructor Description DefaultCodeDelegate()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
arrayCopy(Object src, int srcPosition, Object dst, int dstPosition, int length)
Deprecated.void
arrayCopy(Object src, Object dst)
Deprecated.void
arrayCopy(Object src, Object dst, int length)
Deprecated.double
noise(double x)
Deprecated.double
noise(double x, double y)
Deprecated.double
noise(double x, double y, double z)
Deprecated.void
noiseDetail(int lod)
Deprecated.void
noiseDetail(int lod, double falloff)
Deprecated.void
noiseSeed(long what)
Deprecated.double
random(double max)
Return a random number between zero and max (exclusive)double
random(double min, double max)
Return a random number between min (inclusive) and max (exclusive)double
randomOf(double... values)
Return a random element from an array of values.int
randomOf(int... values)
Return a random element from an array of values.String
randomOf(String... values)
Return a random element from an array of values.-
Methods inherited from class org.praxislive.code.CodeDelegate
ask, ask, async, find, getLookup, isLoggable, log, log, log, log, millis, self, self, tell, tell, tell, tellIn, tellIn, tellIn, time, transmit, transmit, transmit
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.praxislive.code.DefaultDelegateAPI
abs, acos, array, array, array, asin, atan, atan2, b, b, b, B, constrain, constrain, cos, d, d, d, D, D, degrees, dist, dist, exp, i, i, i, I, I, lerp, log, map, max, max, max, max, max, max, min, min, min, min, min, min, norm, pow, radians, round, s, s, S, sin, sq, sqrt, tan, V
-
-
-
-
Field Detail
-
RND
protected final Random RND
-
-
Method Detail
-
random
public final double random(double max)
Return a random number between zero and max (exclusive)- Specified by:
random
in interfaceDefaultDelegateAPI
- Parameters:
max
- the upper bound of the range- Returns:
-
random
public final double random(double min, double max)
Return a random number between min (inclusive) and max (exclusive)- Specified by:
random
in interfaceDefaultDelegateAPI
- Parameters:
min
- the lower bound of the rangemax
- the upper bound of the range- Returns:
-
randomOf
public final double randomOf(double... values)
Return a random element from an array of values.- Specified by:
randomOf
in interfaceDefaultDelegateAPI
- Parameters:
values
- list of values, may not be empty- Returns:
- random element
-
randomOf
public final int randomOf(int... values)
Return a random element from an array of values.- Specified by:
randomOf
in interfaceDefaultDelegateAPI
- Parameters:
values
- list of values, may not be empty- Returns:
- random element
-
randomOf
public final String randomOf(String... values)
Return a random element from an array of values.- Specified by:
randomOf
in interfaceDefaultDelegateAPI
- Parameters:
values
- list of values, may not be empty- Returns:
- random element
-
noise
@Deprecated public double noise(double x)
Deprecated.Computes the Perlin noise function value at point x.- Parameters:
x
-- Returns:
-
noise
@Deprecated public double noise(double x, double y)
Deprecated.Computes the Perlin noise function value at the point x, y.- Parameters:
x
-y
-- Returns:
-
noise
@Deprecated public double noise(double x, double y, double z)
Deprecated.Computes the Perlin noise function value at x, y, z.- Parameters:
x
-z
-y
-- Returns:
-
noiseDetail
@Deprecated public void noiseDetail(int lod)
Deprecated.- Parameters:
lod
-
-
noiseDetail
@Deprecated public void noiseDetail(int lod, double falloff)
Deprecated.- Parameters:
lod
-falloff
-
-
noiseSeed
@Deprecated public void noiseSeed(long what)
Deprecated.- Parameters:
what
-
-
arrayCopy
@Deprecated public void arrayCopy(Object src, int srcPosition, Object dst, int dstPosition, int length)
Deprecated.Copies an array (or part of an array) to another array. The src array is copied to the dst array, beginning at the position specified by srcPos and into the position specified by dstPos. The number of elements to copy is determined by length.- Parameters:
src
-srcPosition
-dst
-dstPosition
-length
-
-
arrayCopy
@Deprecated public void arrayCopy(Object src, Object dst, int length)
Deprecated.Copies an array (or part of an array) to another array. The src array is copied to the dst array. The number of elements to copy is determined by length.- Parameters:
src
-dst
-length
-
-
arrayCopy
@Deprecated public void arrayCopy(Object src, Object dst)
Deprecated.Copies an array to another array. The src array is copied to the dst array.- Parameters:
src
-dst
-
-
-