-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: vrm spring bone #1508
Merged
Merged
fix: vrm spring bone #1508
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…Vector3 - Introduced a new static method `getQuaternionAngle` in Quaternion to compute the rotation angle of a quaternion. - Added `clampRotation` method in Quaternion to limit rotation angles using spherical linear interpolation (slerp). - Implemented `_multiplyMatrix4` method in Vector3 to perform matrix multiplication with a 4x4 matrix, enhancing vector transformation capabilities. - Added `multiplyMatrix4` method in both Vector3 and Vector3d classes for convenient access to matrix multiplication functionality.
…nd new vector/matrix imports - Added `Vector4` and `Matrix44` imports to support advanced vector and matrix operations. - Implemented quaternion clamping in the rotation calculations to limit rotation angles, improving stability in physics simulations. - Refactored the bone processing logic to enhance clarity and maintainability, ensuring better handling of bone transformations. - Updated comments to clarify the purpose of commented-out code related to matrix transformations.
…tionality - Implemented logic to assign the center node of the VRM spring if specified, improving the handling of spring dynamics. - Enhanced the integration of scene graph entities with the VRM model, ensuring better representation of the spring's structure.
- Refactored the `fromToRotation` method in `Quaternion` to improve clarity and efficiency by replacing commented-out code with a more streamlined implementation. - Updated `VRMSpringBone` to simplify the retrieval of world positions by removing unnecessary temporary vector usage. - Enhanced `VRMSpringBonePhysicsStrategy` by replacing multiple `multiplyTo` and `addTo` calls with cleaner `multiply` and `add` methods, improving readability and maintainability. - Introduced `Matrix44` import for advanced matrix operations, enhancing the overall functionality of the physics strategy. - Improved quaternion and vector operations to ensure better performance in physics simulations.
…ld space calculations - Added `initialLocalChildPosition` to `VRMSpringBone` for improved child bone positioning. - Refactored `setup` method to calculate `currentTail` using the new initial position logic. - Introduced `_calcWorldSpaceBoneLength` method to compute bone length based on world space coordinates. - Updated `VRMSpringBonePhysicsStrategy` to call `_calcWorldSpaceBoneLength` during processing, ensuring accurate physics calculations. - Enhanced matrix operations with new methods for transforming coordinates between world and center spaces.
…culations - Added backup transform functionality in the `setup` method to preserve the initial state of the node. - Updated `_calcWorldSpaceBoneLength` method to simplify world position retrieval by using direct property access instead of matrix operations. - Improved overall clarity and maintainability of the `VRMSpringBone` class with these enhancements.
…nd simplified setup - Introduced `vrmSpringBoneBonAxisCoeff` and `vrmSpringBoneToCoeff` in Config.ts to allow for customizable spring behavior. - Refactored the `setup` method in `VRMSpringBone` to remove unnecessary parameters, streamlining the initialization process. - Updated `VRMSpringBonePhysicsStrategy` to utilize the new coefficients for improved rotation calculations, enhancing the physics simulation accuracy. - Cleaned up commented-out code to improve readability and maintainability across the physics strategy implementation.
…al tracking - Added `__lastProcessBeginTime` and `__intervalProcessBegin` to the `Time` class for improved tracking of process intervals. - Updated `VRMSpringBonePhysicsStrategy` to utilize `Time.intervalProcessBegin` for calculating stiffness and gravity forces, enhancing the accuracy of physics simulations. - Cleaned up commented-out code and improved readability in the physics strategy implementation.
- Modified conditional checks for the center node in both Vrm0xImporter and VrmImporter to ensure that the center is not only non-null but also not equal to -1, enhancing the robustness of spring bone functionality. - This change improves the handling of center nodes in the VRM model, ensuring accurate scene graph representation.
- Removed commented-out code in `fromToRotation` and `fromToRotationTo` methods for clarity. - Simplified the logic for handling edge cases in quaternion calculations, enhancing performance and readability. - Updated quaternion normalization process to ensure consistent output in rotation calculations. - Improved overall maintainability of the Quaternion class by cleaning up unnecessary complexity.
- Replaced division by determinant with multiplication by its inverse to enhance performance and readability in the Matrix44 class. - Improved clarity by introducing an `invDet` variable, streamlining the matrix inversion logic. - Ensured consistent handling of determinant checks to maintain robustness in matrix operations.
…hysicsStrategy - Introduced temporary vector and quaternion variables to reduce object creation and improve performance during calculations. - Replaced multiple `multiply` and `add` calls with `multiplyTo` and `addTo` methods for better memory efficiency and clarity. - Enhanced the handling of inertia, stiffness, and collision responses to streamline physics calculations. - Improved readability by cleaning up commented-out code and ensuring consistent use of temporary variables across methods.
…ry variable usage - Removed unnecessary temporary vector and quaternion variables to enhance memory efficiency. - Updated bone tail calculations to utilize existing temporary vectors, improving performance and clarity. - Cleaned up code for better readability and maintainability, ensuring consistent use of temporary variables across methods.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.