Closed ZenithStar closed 8 months ago
That's a good shout. Thanks for the suggestion.
Your proposed solution is pretty much what it needs to be to support that.
Alternatively, it might be better to just directly expose a reference to the SpringArm3D node. My current workaround is to just directly access $PhantomCamera3D._follow_spring_arm_node
Think this is also a solid idea. Kept it private initially to avoid complicating things, but it won't hurt to expose it either way.
Project Type
3D
Feature Description
Quaternions represent the "orientation" of a 3D body, as opposed to the euler angle, which represent "rotation". This is the difference between representing "position" as opposed to "displacement" and is the ideal way of working with the orientation.
Here's an example of 3rd person camera rotation code using quaternions instead of euler angles
As a bonus to this issue, maybe also expose the euler order at
rotation_order
. I don't need this for what I'm doing, but perhaps in the future, someone will.Use Cases
When working with euler angles, you run the risk of encountering gimble lock bugs. https://en.wikipedia.org/wiki/Gimbal_lock Quaternion multiply is a linear, branch-free operation, as opposed to having to use a clamp or wrap, which are branching operations. Theoretically, this makes quaternion multiply more efficient. If you're working with fully unlocked 6DoF motion (e.g. a spacecraft or fighter jet), as opposed to grounded, roll-locked motion, you'll most certainly need to use quaternions.
Importance
Low - there are workarounds where the proposed feature would just simplify things
Usage
Often - a significant amount of projects can find this useful
(Optional) Proposed Solution
I haven't looked through what all you'd need to add to
phantom_camera_properties.gd
, but for phantom_camera_3D.gdAlternatively, it might be better to just directly expose a reference to the SpringArm3D node. My current workaround is to just directly access
$PhantomCamera3D._follow_spring_arm_node