Skip to content

Archmage.Vec3

A 3D 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 Vector3i or Vector3 instead.

var x: Variant

An int or a float, as the element type of the field.

var y: Variant

An int or a float, as the element type of the field.

var z: Variant

An int or a float, as the element type of the field.

static func from_json(d: Variant, conv: Callable, e: Archmage.ParseError = null) -> Archmage.Vec3

Returns 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()).

func to_json() -> Dictionary

Returns the vector as a JSON object.

func to_godot() -> Variant

Returns a Vector3i when the elements are integers, or a Vector3 otherwise. A Vector3i keeps only the low 32 bits of each integer, and a Vector3 stores 32-bit floats unless Godot is built with double precision.