Class Vec3
- java.lang.Object
-
- com.thingworx.types.primitives.structs.Vec2
-
- com.thingworx.types.primitives.structs.Vec3
-
- Direct Known Subclasses:
Vec4
@ThingworxExtensionApiClass(since={7,1}, canInstantiate=true) public class Vec3 extends Vec2
BaseType used to represent a Vector of 3 decimal values modeled with x, y, and z.
Default x value is 0.0.
Default y value is 0.0.
Default z value is 0.0.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
compare(Vec3 v1, Vec3 v2)
int
compareTo(java.lang.Object value)
static Vec3
fromString(java.lang.String value)
Construct a Vec3 from the provided string value.double
getZ()
Get the z value.boolean
isDefaultValue()
Check if this Vec3 instance is in its default state.void
setZ(double value)
Set the z value.java.lang.String
toString()
Construct a string representation of this Vec3 instance.
-
-
-
Field Detail
-
Z
public static final java.lang.String Z
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Vec3
@ThingworxExtensionApiMethod(since={7,1}) public Vec3()
Construct a Vec3 with default values.
-
Vec3
@ThingworxExtensionApiMethod(since={7,1}) public Vec3(double x, double y, double z)
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 z
-
Vec3
@ThingworxExtensionApiMethod(since={7,1}) public Vec3(Vec2 vec2, double z)
Construct a Vec3 with the provided Vec2 and z values.- Parameters:
vec2
- - Vec2 to set x and y valuesz
- - double for z value
-
-
Method Detail
-
getZ
@ThingworxExtensionApiMethod(since={7,1}) public double getZ()
Get the z value.- Returns:
- The value of z
-
setZ
@ThingworxExtensionApiMethod(since={7,1}) public void setZ(double value)
Set the z value.- Parameters:
value
- - double value to be set for z
-
compareTo
@ThingworxExtensionApiMethod(since={7,1}) public int compareTo(java.lang.Object value)
-
compare
@ThingworxExtensionApiMethod(since={7,1}) protected int compare(Vec3 v1, Vec3 v2)
-
toString
@ThingworxExtensionApiMethod(since={7,1}) public java.lang.String toString()
Construct a string representation of this Vec3 instance.
-
isDefaultValue
@ThingworxExtensionApiMethod(since={7,1}) public boolean isDefaultValue()
Check if this Vec3 instance is in its default state.- Overrides:
isDefaultValue
in classVec2
- Returns:
- true, when x equals 0.0, y equals 0.0, and z equals 0.0, false otherwise
-
fromString
@ThingworxExtensionApiMethod(since={7,1}) public static Vec3 fromString(java.lang.String value)
Construct a Vec3 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, and the third result as value for z- Returns:
- A new Vec3 from the string value
-
-