Hardware Instancing and Animations

Of course all this would not happen without the help from rdb. Sorry for not writing that, but I’d be surprised if anyone here has any project that rdb didn’t help with.

Anyway, I just pushed an update, now you can attach a node to a joint, just like you could with the Panda3D Actor, the function for that is on the Crowd, not CrowdActor:

#yes!
self.crowd.attach_node_to_joint(node=hat, joint_name='head', actor_id=11)  
#no :(
#self.crowd[11].attach_node_to_joint(node=hat, joint_name='head')  

I did it this way because I didn’t want to create cyclic references where the Crowd keeps a pointer to each CrowdActor and each CrowdActor has a pointer to the Crowd and also because on the scene graph the attached node gets parented to Crowd.model not the dummy nodes of CrowdActors.

Behind the scenes attaching works by using the joint matrix as (part of) the model matrix in the shader, so if you attach something to the something attached to a joint - it won’t work. Also I had to set omni bounds on the attached object, so no culling.