Page 1 of 1

Move the object like a movie

Posted: Wed Apr 26, 2017 2:12 pm
by snfge
Hi
I want move the object 5 m /s, so I use the qtimer, like the fllow code, but it can't move like my think, why?
ccHObject* root = MainWindow::dbRootObject();//得到数据目录中的所有文件夹
if (root)
{
ccHObject::Container objects;
root->filterChildren(objects, true, CC_TYPES::OBJECT);
for (size_t i = 0; i < objects.size(); ++i)
{
ccHObject *object = objects;
QString kk = object->getName();
if (object->getName() == "111")
{
movefromtwopoint(object, pt1, pt2);
refreshAll(true);
}
}
}