Move the object like a movie

Feel free to ask any question here
Post Reply
snfge
Posts: 72
Joined: Thu Nov 20, 2014 4:12 am

Move the object like a movie

Post 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);
}
}
}
Post Reply