bone ang/pos

Posted By: 3run

bone ang/pos - 06/23/18 13:41

Hi guys!

I'm currently working on ragdolls. Used Helghast's old contribution as a base. I already converted it previously into physX, but wanted to improve it a bit. So far I got everything working the way I wanted to, but well.. there is a problem. Helghats's ragdolls can blend to animation. It uses 'vec_to_bone' and 'ang_to_bone' to get pos/angle of the bone and blends each ragdoll part entity to it's own bone pos/ang. And here where the problem comes from, cause all hinge limits will 'remember' position/angle they spawn at. It will be 'center' pos/ang to the hinge. This will result in pretty weird ragdoll, f.e. if player was walking zombie like putting his arms infront, ragdoll will keep that position when he will get on the ground.

What I want to do is:
Quote:
-use 'default pose' to take pos/angle of each bone
-blend ragdoll parts to those pos/angles
-create all joints and set their parameters
-blend ragdoll parts to pos/angles taken from the current animation frame

So my question is, how do I get pos/angle of a specific frame (f.e. default pose) without using 'ent_animate'.

Edit: the only way I can think of, is saving those pos/angle right when entity get's created.. but I wanted to know, maybe there is more elegant way to solve this. Manual doesn't answer.

Best regards!
Posted By: 3run

Re: bone ang/pos - 06/24/18 23:49

I guess I will just save all needed pos/angles at the start. Thx.
Posted By: Superku

Re: bone ang/pos - 06/25/18 10:39

Sounds like the best option you have.
Alternatively, you could file_load the MDL and look up bone matrices and frames in the buffer but that... is a nightmare compared to any other option.
Posted By: 3run

Re: bone ang/pos - 06/25/18 13:24

Thank you, Superku laugh
© 2024 lite-C Forums