-
-
Notifications
You must be signed in to change notification settings - Fork 496
New bone functions and onClientPedsProcessed event #1673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Einheit-101
commented
Sep 24, 2020
My goodness, you are a LORD!
Thanks for this PR 🥇
all functions seem to work properly now..
Damn this is huge, good work
I did some more research and figured out a way to rotate all 32 bones. It seems to work fine. I removed setPedNodeOrientation and replaced it with setElementBoneRotation. When you rotate a bone, the child bones will also be affected. The API is much cleaner now. Check the first post for more detailed info. Now I just need to clean up the code and the PR is complete.
@saml1er Lemme know if I can help with anything.
@saml1er Lemme know if I can help with anything.
Sure, I'll let you know if I need help with something.
This took a lot more work than I expected. The PR is finally complete. I modified the argument parser for the PR because I wanted to add support for CMatrix. It works, but I'm not sure if I've done it properly.
Client/core/Core.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really useful we really need to just have this run in master when we're in Debug mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, and it's also much faster than MTA's GUI console.
Uh oh!
There was an error while loading. Please reload this page.
Video: https://cdn.discordapp.com/attachments/366384007535001612/758487499517198366/2020-09-24_05-36-42.mp4
This PR adds a new event and 8 new functions:
This new event also fixes the issue with bone frame delay #465
setElementBonePositionallows you to set the translation values for the bone.setElementBoneRotationallows you to set the orientation values for the bone.setElementBoneMatrixallows you to set the bone world matrix.updateElementRpHAnimshould be called after setElementBoneRotation. This is a bit heavy function, so it should be only called after you are completely done with rotating bones.You can rotate a ped head vertically, like this:
complete list of ped bone ids (32 bones)
I am thinking of creating a new function to get LTMs (Local Transformation Matrix) of bones. This will make it easy for people to implement their own animation system that they use to animate their models from Lua. A shader can be used for matrix multiplication, and this will give a very good performance boost. GTA SA doesn't use a shader for skinning, and that's why multiple animating peds will cause FPS drop when they are streamed in. Adding an additional function to disable GTA SA skinning to save performance would also be nice since it's very slow as it relies on the CPU for skinning rather than the GPU. Nonetheless, it would be only useful for people who want to implement a custom skeletal animation system.