Operating System: Ubuntu 20.04
Render System: OpenGL Rendering Subsystem
I create a AxisAlignedBoxSceneQuery in my scenemanager, and place a light into it, but the query result is not contain the light
How do i get Lights by a scene query
Code: Select all
Light *l = sm->createLight("main_light");
l->setType(Light::LT_POINT);
light_node->setPosition(Vector3(50));
light_node->attachObject(l);
const unsigned int QM_LIGHT = 0x3232;
l->setQueryFlags(QM_LIGHT);
AxisAlignedBox aab(-Vector3(10), Vector3(100));
AxisAlignedBoxSceneQuery *light_query = sm->createAABBQuery(aab, QM_LIGHT);
SceneQueryResult &results = light_query->execute();
if (results.movables.size()) {
for (auto &m : results.movables) {
if (m->getQueryFlags() != 0xffffffff) {
if ((m->getQueryFlags() & QM_LIGHT) == QM_LIGHT) {
printf("find! -- %s\n", m->getName().c_str());
} else {
puts("find unkown!");
}
}
}
} else {
puts("empty!");
}