Godot Version
4.2.1 windows
Question
I have code in GD script which i like to replace :
//node3d + vec3d y
camguide.transform.basis.z + vec2d.y
in c++ i can’t find any replacement for basis.z , how can i get it so it will act as in gd script ?
4.2.1 windows
I have code in GD script which i like to replace :
//node3d + vec3d y
camguide.transform.basis.z + vec2d.y
in c++ i can’t find any replacement for basis.z , how can i get it so it will act as in gd script ?
Rusty mathematics here but I think godot-cpp implements them as indexable
// x y z
// 0 1 2
camguide.get_transform().basis[1] + vec2d.y
Snippet of the Basis definition
struct _NO_DISCARD_ Basis {
Vector3 rows[3] = {
Vector3(1, 0, 0),
Vector3(0, 1, 0),
Vector3(0, 0, 1)
};
_FORCE_INLINE_ const Vector3 &operator[](int axis) const {
return rows[axis];
}