Hello, I am setting up some points to specify how agents should be placed on different kinds of furniture. Here I grabbed the middle of the seat with a velocity vector I am using to feed heading for my Crowd Source SOP. When spawning agents, by default the root is what gets snapped to the point. I am curious if this can be overriden in any way to specify a different joint as the agent's spawning point. Or if not directly, how could one pre calculate an offset to figure out how to move the spawn points for correct spawning? Hope this makes sense and any ideas are appreciated! My only idea so far is storing a global attribute all the way from the agent clip I am using, but that seems a bit overkill..
The point position and overall transform of an agent is always the agent's root transform, so I think the easiest approach here is to move the point so that other joint is positioned where you want.
After spawning the agents, you can read the transform of the relevant joint, and then use that to adjust P however you want e.g. to get started:
stringjoint_name = "your_joint_name";
intjoint_idx = agentrigfind(0, @primnum, joint_name);
matrixjoint_xform = agentworldtransform(0, @primnum, joint_idx);
// Or, to get the joint transform in world space, rather than relative to the agent's transform:matrixagent_prim_xform = primintrinsic(0, "packedfulltransform", @primnum);
matrixjoint_xform_world = joint_xform * agent_prim_xform;