Action::ResultE CPUSkinningAlgorithm::intersectEnter(Action *action) { Action::ResultE res = Action::Continue; SkinnedGeometry *skinGeo = getSkin (); Skeleton *skel = getSkeleton(); IntersectAction *iact = boost::polymorphic_downcast<IntersectAction *>(action); CPUSkinningDataAttachmentUnrecPtr data = getCPUSkinningData(skinGeo); if(data == NULL) { data = CPUSkinningDataAttachment::create(); skinGeo->addAttachment(data); } skel->intersectEnter(action, skinGeo); if(data->getDataValid() == false) { transformGeometry(skinGeo, skel, data); data->setDataValid(true); } intersectGeometry(iact, skinGeo, data); return res; }
Action::ResultE CPUSkinningAlgorithm::renderEnter(Action *action) { Action::ResultE res = Action::Continue; SkinnedGeometry *skinGeo = getSkin (); Skeleton *skel = getSkeleton(); RenderAction *ract = boost::polymorphic_downcast<RenderAction *>(action); OSG_ASSERT(skinGeo != NULL); OSG_ASSERT(skel != NULL); CPUSkinningDataAttachmentUnrecPtr data = getCPUSkinningData(skinGeo); if(data == NULL) { data = CPUSkinningDataAttachment::create(); skinGeo->addAttachment(data); } skel->renderEnter(action, skinGeo); if(data->getDataValid() == false) { transformGeometry(skinGeo, skel, data); data->setDataValid(true); } renderGeometry(ract, skinGeo, data); return res; }