Closed ShadowApex closed 6 years ago
Working on Vector2/Vector3.
@pastaq I noticed some errors after pulling in your code. Here's the problems I see a lot:
func (v *Vector2) Abs() Vector2 {
var newVec2 Vector2
newVec2.vector2 = C.godot_vector2_abs(v.vector2)
return newVec2
}
The C.godot_vector2_abs()
function returns a C.godot_vector2
object, not a *C.godot_vector2
. It should instead be implemented like this:
func (v *Vector2) Abs() Vector2 {
var newVec2 C.godot_vector2
newVec2 = C.godot_vector2_abs(v.vector2)
return &Vector2{vector: &newVec2}
}
Rect2, Rect3, RID update: https://github.com/ShadowApex/godot-go/pull/21
Currently we support basic Godot variant type like
godot_string
,godot_int
, etc. We need to finish implementing the other types as their own Go structures that wrap around the underlying variant.