Class Vec4
- java.lang.Object
-
- com.thingworx.types.primitives.structs.Vec2
-
- com.thingworx.types.primitives.structs.Vec3
-
- com.thingworx.types.primitives.structs.Vec4
-
@ThingworxExtensionApiClass(since={7,1}, canInstantiate=true) public class Vec4 extends Vec3
BaseType used to represent a Vector of 4 decimal values modeled with x, y, z, and w.
Default x value is 0.0.
Default y value is 0.0.
Default z value is 0.0.
Default w value is 1.0.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
compare(Vec4 v1, Vec4 v2)
int
compareTo(java.lang.Object value)
static Vec4
fromString(java.lang.String value)
Construct a Vec4 from the provided string value.double
getW()
Get the w value.boolean
isDefaultValue()
Check if this Vec4 instance is in its default state.void
setW(double value)
Set the w value.java.lang.String
toString()
Construct a string representation of this Vec4 instance.
-
-
-
Field Detail
-
W
public static final java.lang.String W
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Vec4
@ThingworxExtensionApiMethod(since={7,1}) public Vec4(double x, double y, double z, double w)
Construct a Vec3 with the provided x, y and z values.- Parameters:
x
- - double value to be used for xy
- - double value to be used for yz
- - double value to be used for zw
- - double value to be used for w
-
Vec4
@ThingworxExtensionApiMethod(since={7,1}) public Vec4()
Construct a Vec4 with default values.
-
-
Method Detail
-
getW
@ThingworxExtensionApiMethod(since={7,1}) public double getW()
Get the w value.- Returns:
- The value of w
-
setW
@ThingworxExtensionApiMethod(since={7,1}) public void setW(double value)
Set the w value.- Parameters:
value
- - double value to be set for w
-
compareTo
@ThingworxExtensionApiMethod(since={7,1}) public int compareTo(java.lang.Object value)
-
compare
@ThingworxExtensionApiMethod(since={7,1}) protected int compare(Vec4 v1, Vec4 v2)
-
toString
@ThingworxExtensionApiMethod(since={7,1}) public java.lang.String toString()
Construct a string representation of this Vec4 instance.
-
isDefaultValue
@ThingworxExtensionApiMethod(since={7,1}) public boolean isDefaultValue()
Check if this Vec4 instance is in its default state.- Overrides:
isDefaultValue
in classVec3
- Returns:
- true, when x equals 0.0, y equals 0.0, z equals 0.0, and w equals 1.0, false otherwise
-
fromString
@ThingworxExtensionApiMethod(since={7,1}) public static Vec4 fromString(java.lang.String value)
Construct a Vec4 from the provided string value.- Parameters:
value
- - String to split by ',' then taking the first result as value for x, the second result as value for y, the third result as value for z, and the fourth result as value for w- Returns:
- A new Vec4 from the string value
-
-