The Vec2Signal
class monitors a 2D coordinate.
Property | Description |
---|---|
| (get) height: ScalarSignal Represents the width of the size, or the second element of the vector. |
| (get) width: ScalarSignal Represents the width of the size, or the first element of the vector. |
| (get) x: ScalarSignal Represents the X coordinate of the point, or the first element of the vector. |
| (get) y: ScalarSignal Represents the Y coordinate of the point, or the second element of the vector. |
Method | Description |
---|---|
| abs(): Vec2Signal Returns a signal with the value that is the absolute value of the given signal. See Also: ReactiveModule.abs |
| add(other: ScalarSignal): Vec2Signal Returns a signal with the value that is the sum of the values of the given signals. Note: add and sum functions are synonyms, the behavior they provide is equivalent.See Also: ReactiveModule.sum , ScalarSignal.add , PointSignal.add , Vec3Signal.add |
| atan2(other: ScalarSignal): ScalarSignal Returns a signal with the value that is the angle in radians between the x-axis and the ray from (0, 0) to (x, y) where x and y are the values of the specified signals. The range is -PI to +PI. See Also: ScalarSignal.atan2 |
| ceil(): Vec2Signal Returns a signal with the value that is the smallest integer that is greater than or equal to the value of the given signal. See Also: ScalarSignal.ceil |
| clamp(min: ScalarSignal, max: ScalarSignal): ScalarSignal Returns a signal with the value that is the value of the given x signal constrained to lie between the values of the given min and max signals.Note: The behavior is undefined if min is greater than max . |
| cross(other: Vec3Signal): PointSignal Returns a vector signal with the value that is the cross product of the given signals. See Also: Vec3Signal.dot , ScalarSignal.mul , Vec3Signal.mul |
| distance(other: PointSignal): ScalarSignal Returns the distance from the point to another point as a ScalarSignal . |
| div(other: ScalarSignal): ScalarSignal Returns a signal with the value that is the value of the first signal divided by the value of the second signal. See Also: ScalarSignal.div |
| dot(other: Vec3Signal): ScalarSignal Returns a scalar signal with the value that is the dot product of the given signals. See Also: Vec3Signal.cross , ScalarSignal.mul , Vec3Signal.mul |
| floor(): Vec2Signal Returns a signal with the value that is the largest integer that is less than or equal to the value of the given signal. See Also: ScalarSignal.floor |
| fromRange(min: ScalarSignal, max: ScalarSignal): ScalarSignal Maps x from [min, max] range to [0.0, 1.0] range. |
| history(framesCount: number, initialValues?: Array<Point2D>): SignalHistory<Point2D> Historical signal values are going to be initialized with signal value at call time or using initialValues if provided.
|
| magnitude(): ScalarSignal Returns the magnitude of the vector as a ScalarSignal . |
| magnitudeSquared(): ScalarSignal Returns the squared length (magnitude) of a given signal. Calculating the squared magnitude instead of the magnitude is much faster. Often if you are comparing magnitudes of two vectors you can just compare their squared magnitudes. |
| max(other: ScalarSignal): ScalarSignal Returns a signal with the value that is the greater of the values of the given signals. |
| min(other: ScalarSignal): ScalarSignal Returns a signal with the value that is the lesser of the values of the given signals. |
| mix(signal: ScalarSignal, factor: ScalarSignal): ScalarSignal Returns a signal with the value that is the linear interpolation between this and another signal by a given factor. |
| mod(other: ScalarSignal): ScalarSignal Returns a signal with the value that is the floating-point remainder of the division of the value of the first signal by the value of the second signal. See Also: ScalarSignal.mod |
| mul(other: ScalarSignal): Vec2Signal Returns a signal with the value that is the product of the values of the given signals. See Also: ScalarSignal.mul , Vec3Signal.mul |
| neg(): Vec2Signal Returns a signal with the negated value of the given signal. See Also: ScalarSignal.neg , Vec3Signal.neg |
| normalize(): Vec3Signal Returns the normalized (unit) vector in the direction of the original vector as a Vec3Signal . |
| pinLastValue(): Vec2Signal Returns a new Vec2Signal containing a constant value which is the last value of the specified signal before pinLastValue is called. |
| pow(exponent: ScalarSignal): ScalarSignal Returns a signal with the value that is the base signal raised to the power of the exponent signal. The result is undefined if the base is negative, or if the base is zero and the exponent is not positive. See Also: ScalarSignal.pow |
| reflect(normal: Vec3Signal): Vec3Signal Calculates the reflection direction for an incident vector and a normal as a Vec3Signal . |
| round(): Vec2Signal Returns a signal with the value that is the rounded value of the given signal. Note: When the fractional part is 0.5, it rounds the number away from zero, which is at odds with JavaScript standard behavior of rounding it always up in such cases. Therefore, this function is NOT exactly the reactive counterpart of the standard JavaScript Math.round utility.See Also: ScalarSignal.round |
| sign(): Vec2Signal Returns a signal with the value that is the sign of the given signal. Possible sign values: NaN, -0.0, 0.0, -1.0, 1.0. Note: this function is the reactive counterpart of the standard JavaScript Math.sign utility.See Also: ScalarSignal.sign |
| smoothStep(edge0: ScalarSignal, edge1: ScalarSignal): ScalarSignal Returns 0.0 if x is less than edge0, and 1.0 if x is greater than edge1. If x is between edge0 and edge1, smooth Hermite interpolation is performed. |
| sqrt(): Vec2Signal Returns a signal with the value that is the square root of the value of the given signal. See Also: ScalarSignal.sqrt |
| sub(other: ScalarSignal): Vec2Signal Returns a signal with the value that is the difference of the values of the given signals. See Also: ScalarSignal.sub , Vec3Signal.sub , PointSignal.sub |
| sum(other: ScalarSignal): Vec2Signal Returns a signal with the value that is the sum of the values of the given signals. Note: add and sum functions are synonyms, the behavior they provide is equivalent.See Also: ReactiveModule.sum , ScalarSignal.add , PointSignal.add , Vec3Signal.add |
| toRange(min: ScalarSignal, max: ScalarSignal): ScalarSignal Maps x from [0.0, 1.0] range to [min, max] range. |