perhaps I’m misunderstanding the usage of control joint or just missing something stupid, but I’ve got to ask.
I’m trying to use the code below to attach models to each other and use them like a multi-part actor.
NodePath character_path = window->load_model(window->get_panda_framework()->get_models(), "models/monster_body.egg");
NodePath new_leg_1 = window->load_model(window->get_panda_framework()->get_models(), "models/monster_leg_1.egg");
NodePath bodyNP = character_path.find("**/+Character");
PT(Character) bodyCH = DCAST(Character, bodyNP.node());
PT(CharacterJointBundle) bodyBundle = bodyCH->get_bundle(0);
NodePath hip1NP = character_path.attach_new_node("hip_1_node");
PT(CharacterJoint) hip1_joint = bodyCH->find_joint("hip_1");
hip1NP.set_mat(hip1_joint->get_default_value());
bodyBundle->control_joint("hip_1",hip1NP.node());
NodePath leg1NP = new_leg_1.find("**/+Character");
Character* leg1CH = DCAST(Character, leg1NP.node());
PT(CharacterJointBundle) leg1Bundle = leg1CH->get_bundle(0);
NodePath leg1NP = hip1NP.attach_new_node("leg_1_node");
PT(CharacterJoint) leg1_joint = leg1CH->find_joint("leg_2");
leg1NP.set_mat(hip1_joint->get_default_value());
leg1Bundle->control_joint("leg_1",leg1NP.node());
leg1NP.reparent_to(hip1NP);
I have been looking at the actor.py file and searching the forums for the proper way to do this in C++. Currently my models are loading properly and the joints seem to be found but the models are not parenting to each other. Does control joint govern the entire transform of a node?