Game Development Reference
In-Depth Information
void CToon3DDoc::UpdateAllObjects()
{
if (!m_selScene) return;
CToon3DObject *obj=m_selScene->m_ObjectList.m_next;
POINT3D *pt;
//Zero any bendy objects world points
while(obj){
if (obj->m_type == OBJECT_TYPE_TARGET){
pt=&obj->m_pts;
for (int i=0;i<obj->m_numpoints;i++){
pt->mx=0.0; pt->my=0.0; pt->mz=0.0;
pt->wx=0.0; pt->wy=0.0; pt->wz=0.0;
}
pt++;
}
obj=obj->m_next;
}
//Do the real transforming
obj=m_selScene->m_ObjectList.next;
while(obj){
if (obj->m_parent==NULL){
obj->SetTime(m_selScene->m_curtime);
obj->Transform();
UpdateChildObjects(obj, m_selScene->m_curtime);
}
obj=obj->m_next;
}
//Divide any bendy point objects vertices by vertex weights
obj=m_selScene->m_ObjectList.next;
while(obj){
if (obj->m_type == OBJECT_TYPE_TARGET){
pt=&obj->m_pts;
for (int i=0;i<obj->m_numpoints;i++){
if (pt->w){
pt->wx/=pt->w; pt->mx/=pt->w;
pt->wy/=pt->w; pt->my/=pt->w;
pt->wz/=pt->w; pt->mz/=pt->w;
}
}
Search Nedrilad ::




Custom Search