OK. How about, if I was using a regular QGraphicsView and Scene to add items.
Is there something available for that ??
Thanks & Regards,
Raj
OK. How about, if I was using a regular QGraphicsView and Scene to add items.
Is there something available for that ??
Thanks & Regards,
Raj
QGraphicsView/Scene/Item is strictly 2 dimensional, but it does offer collision detection if that's what you're looking for.
There has been some complaining here about performance of this algorithm, however.
Yup, thats exactly what I am looking for ... I do not care about the 3D.
It will be great if you could please provide me some info related to the collision detection and its pros & cons so that I will have a better idea.
Regards,
Raj
What is it exactly that you want to do? Why were you asking about QGLWidget?
Here is what I am trying ....
MyGraphicsView::MyGraphicsView(QWidget *parent):QGraphicsView(parent)
{
myScene = new QGraphicsScene(this);
setScene(myScene);
setViewport(new GLWidget(this));
}
Here I am setting my custom QGLWidget as as viewport of my QGraphicsView.
So this is where I need help with.
Regards,
Raj
I mean what is your ultimate goal of doing all that? The GL viewport doesn't change anything if you are using Graphics View, it just gives you hardware acceleration without changing the API layer. So collision detection is still done by Graphics View and not QGLWidget. For collision detection in the scene see the family of QGraphicsScene::items() and QGraphicsScene::collidingItems() methods.
Yes, I am using QGLWidget on QGraphicsView for hardware acceleration.
I am trying to create a map control with very high refresh rate something similar to TomTom device in a moving vehicle(i.e a fast moving map). But it supports interaction with items on the map.
So my confusion was that once I set the QGLWidget as viewport how is it going to change the behavior ... May be I didnt put my question properly in the beginning
As you are suggested that Collision detection is still done by QGraphicsView. I will go ahead and try it out.
Thanks for your help.
Regards,
Raj
Bookmarks