godot-rust / gdext

Rust bindings for Godot 4
https://mastodon.gamedev.place/@GodotRust
Mozilla Public License 2.0
3.06k stars 190 forks source link

Vector3 missing a rotated method #221

Closed Supreeeme closed 1 year ago

Supreeeme commented 1 year ago

Was following through the squash the creeps tutorial and noticed that Vector3 is missing a rotated method, although it has one in Godot. Is this intentional?

Bromeon commented 1 year ago

No, probably an oversight or simply not yet implemented. Did you encounter other missing parts in Vector3?

Would you be interested in adding the method in a pull request? 🙂

Supreeeme commented 1 year ago

I'm not confident in my vector math abilities but I could certainly try and make an attempt sometime soon :slightly_smiling_face:

Bromeon commented 1 year ago

For inspiration, you can have a look at the gdnative or Godot implementation 🙂

We generally try to benefit from geometric types' Copy trait and thus return new objects. As such, we would only need rotated() and not rotate().

If you see a few other methods that are missing, feel free to suggest them! (Maybe we can quickly discuss if/how to add them before jumping into implementation)