Archmage.Vec4
A 4D vector, the type of a vector field whose elements are not 32-bit, such as int64, uint16 or float64.
Inherits: RefCounted
A vector field whose elements are 32-bit, such as int32 or float32, is a Vector4i or Vector4 instead.
Properties
Section titled “Properties”var x: VariantAn int or a float, as the element type of the field.
var y: VariantAn int or a float, as the element type of the field.
var z: VariantAn int or a float, as the element type of the field.
var w: VariantAn int or a float, as the element type of the field.
Methods
Section titled “Methods”from_json()
Section titled “from_json()”static func from_json(d: Variant, conv: Callable, e: Archmage.ParseError = null) -> Archmage.Vec4Returns the vector in d, a parsed JSON object, converting each element with conv.call(value, e), which returns the zero value for null. For null, returns the zero vector. For any other value that is not an object, returns the zero vector too and records the type mismatch in e (see Archmage.ParseError.report_mismatch()).
to_json()
Section titled “to_json()”func to_json() -> DictionaryReturns the vector as a JSON object.
to_godot()
Section titled “to_godot()”func to_godot() -> VariantReturns a Vector4i when the elements are integers, or a Vector4 otherwise. A Vector4i keeps only the low 32 bits of each integer, and a Vector4 stores 32-bit floats unless Godot is built with double precision.