Getting Bone/Joint positions of Sim in C# script at runtime
Hey everyone!
I am trying to make a first person mod for the Sims 3. Now, I've figured out that you can use the CameraController to manipulate the camera, and point it somewhere. And you can also get a sims location and forward direction. bada bing bada boom. Just take the camera and set it's position and view direction to the sim's position and forward direction, and you kinda got something. It's a little jank, but I think I can improve it.
My question though is if there's a real way to get the head position and angle of the Sim Actor. Because that position and forward direction are just the logical descriptors of the sim. They don't describe where the sim's head is ACTUALLY pointing. I haven't done anything with animations before, so I am not really sure where to start. Essentially, I need some reference to the head, neck, eyeball, etc... literally anything would probably do. And I just need to be able to get the position and direction at runtime.
I did some digging around with ILSpy and I found a couple of things. The LookAtManager has some references to the Sim pose or posture. But those did not look like what I am looking for? There is the FXJoints with slots for different parts of the actor. But I didn't see anywhere to use elements of that enum. The animation class in Script core references animation handles, but doesn't quite let you query the current running animation. It really only lets you start or stop animations.
I'm very unfamiliar with the animation and assets side of modding the sims. I've only ever really done logical scripting in C#.... I feel like I must be missing something because I don't really know how the animations work in this game....
Is this something I would have to dig out of the C++ side? Do I gotta pop open Ghidra or is there a simpler way to get this information?
Any pointers or direction would be really appreciated!
Thank you!