Commit Graph

18 Commits

Author SHA1 Message Date
951ae7b11d Backported from godot4: Add the ability to look-at in model-space.
This is a much simpler attempt to solve the same problem as #76060, but
without breaking any compatibility.

* Adds a description of what model space is in the Vector3 enums
(MODEL_* constants). This has the proper axes laid out for imported 3D
assets.
* Adds the option to `look_at` using model_space, which uses
Vector3.MODEL_FRONT as forward vector.

The attempt of this PR is to still break the assumption that there is a
single direction of forward (which is not the case in Godot)
and make it easier to understand where 3D models are facing, as well as
orienting them via look_at.

- reduz

5fdc1232ef

Also bound the new Basis helper methods.
2024-09-30 17:04:00 +02:00
422314a8fd Added set_look_at helper method to Basis. 2024-09-30 16:41:20 +02:00
010e1b51a8 Added non-static looking_at and from_scale helper methods to Basis. 2024-09-30 16:27:21 +02:00
ee1e40f1b0 Renamed looking_at to create_looking_at, and from_scale to create_from_scale in Basis. 2024-09-30 16:17:19 +02:00
ececc7991c Backported dome of the codestyle improvements to math types from 3fb36bf395 . 2024-04-06 13:05:32 +02:00
337c99e52f File copyright header updates pt1. 2023-12-17 22:29:33 +01:00
0f6fb760ad Now Basis::get_uniform_scale() returns a real_t instead of a float. 2023-05-29 16:08:59 +02:00
47e637b2b8 Mark the parameters of Basis::rotate_to_align as const ref. 2023-05-29 13:03:26 +02:00
9e1588160f Now all Variant math types are structs. 2022-08-16 22:09:26 +02:00
170a41ca82 Backported improvements to Basis from Godot4. Also bound all eligible methods. 2022-08-14 00:18:21 +02:00
d9e094ab9a Renamed elements in Basis to rows. 2022-08-13 19:07:59 +02:00
730bce8587 Renamed Quat to Quaternion for consistency with the other engine math classes. 2022-08-13 15:22:33 +02:00
22ce231a4e Backported from Godot 4: New and improved IK system for Skeleton3D
This PR and commit adds a new IK system for 3D with the Skeleton3D node
that adds several new IK solvers, as well as additional changes and functionality
for making bone manipulation in Godot easier.
This work was sponsored by GSoC 2020 and TwistedTwigleg
Full list of changes:
* Adds a SkeletonModification3D resource
  * This resource is the base where all IK code is written and executed
* Adds a SkeletonModificationStack3D resource
  * This node oversees the execution of the modifications and acts as a bridge of sorts for the modifications to the Skeleton3D node
* Adds SkeletonModification3D resources for LookAt, CCDIK, FABRIK, Jiggle, and TwoBoneIK
  * Each modification is in it's own file
* Several changes to Skeletons, listed below:
  * Added local_pose_override, which acts just like global_pose_override but keeps bone-child relationships intract
    * So if you move a bone using local_pose_override, all of the bones that are children will also be moved. This is different than global_pose_override, which only affects the individual bone
  * Internally bones keep track of their children. This removes the need of a processing list, makes it possible to update just a few select bones at a time, and makes it easier to traverse down the bone chain
  * Additional functions added for converting from world transform to global poses, global poses to local poses, and all the same changes but backwards (local to global, global to world). This makes it much easier to work with bone transforms without needing to think too much about how to convert them.
  * New signal added, bone_pose_changed, that can be used to tell if a specific bone changed its transform. Needed for BoneAttachment3D
  * Added functions for getting the forward position of a bone
* BoneAttachment3D node refactored heavily
  * BoneAttachment3D node is now completely standalone in its functionality.
    * This makes the code easier and less interconnected, as well as allowing them to function properly without being direct children of Skeleton3D nodes
  * BoneAttachment3D now can be set either using the index or the bone name.
  * BoneAttachment3D nodes can now set the bone transform instead of just following it. This is disabled by default for compatibility
  * BoneAttachment3D now shows a warning when not configured correctly
* Added rotate_to_align function in Basis
* Added class reference documentation for all changes
- TwistedTwigleg
5ffed49907
Note: It still needs some work.
2022-08-10 01:01:38 +02:00
ae7d514cf3 Added set_column to Basis. 2022-08-08 01:18:58 +02:00
527cfb88aa Added Vector2i, Vector3i, Rect2i, PoolVector2i, PoolVector3i, Vector<Vector2i>, Vector<Vector3i> classes as core variant binds. GDScript still need to be updated to be able to use them. 2022-03-21 14:01:31 +01:00
4d7df62b8e Clang format all files. 2022-03-18 19:00:13 +01:00
7d8a93324e Used the include guard script on core classes. 2022-03-17 21:58:11 +01:00
49f8e8c398 Added godot with all my currently used engine modules. 2022-03-15 13:29:32 +01:00