Results 1 to 15 of 15

Thread: turn off collision detection?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Oct 2008
    Posts
    14
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3

    Default Re: turn off collision detection?

    Hi wysota, thanks for your response.

    > boundingRect() is necessary for the architecture to know which items to repaint when a
    > particular area needs refreshing.

    I already know which QGItems I need to repaint, and I've tried to force to update just the boundingRect of these items, through QGraphicsItem.update(QRect) and QGraphicsScene.update(QRect) calls. But I still encounter an onslaught of unnecessary boundingRect() calls, that kill my performance.

    > It also defines a local coordinate system for each item,
    > so unless you want to strip away everything the graphics view gives you (I mean all
    > benefits), it will be hard to get rid of boundingRect() and collision detection.

    So each QGraphicsItem.paint() call requires a boundingRect() call. I can dig that because I can tell the QGraphicsView framework which areas to repaint. Going back to my .update() use above, I'm still not clear why the .update(QRect) function can not just redefine the local coordinate system starting at the .x() .y() of the QRect I pass to .update(). Can I just repaint that QRect another way? is there some other intended functionality of applying this parameter to the update function?

    > On the other
    > hand if you want to get rid of them, maybe you shouldn't use graphics view at all?

    I disagree completely. There's lots of great stuff under the hood, that Indexing seems to kill the performance of when more than a few tens of thousands of QGraphicsItems are present in the scene. So an option is offered to turn indexing off, but no option to reimplement where to repaint? It just seems like not a very big step to uncover some real performance flexibility.

    Thanks again for your time.

    Deacon
    Last edited by Deacon; 2nd November 2008 at 16:40.

Similar Threads

  1. 2D Race Car collision detection
    By neonnds in forum Qt Programming
    Replies: 0
    Last Post: 6th July 2008, 08:10
  2. Collision detection QGraphicsItem
    By Blade in forum Qt Programming
    Replies: 5
    Last Post: 5th January 2007, 10:20
  3. Painting and collision detection
    By aamer4yu in forum Qt Programming
    Replies: 1
    Last Post: 18th October 2006, 08:57

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.