Scrolling in UIView interrupting physic engine

Official forum for the Chipmunk2D Physics Library.
Post Reply
Rabu
Posts: 2
Joined: Wed Aug 31, 2011 2:16 pm
Contact:

Scrolling in UIView interrupting physic engine

Post by Rabu »

Hello, I''m new to chipmunk and I'm working on an exiting iPad user interface.
I'm using chipmunk objective-c wrapper 6.0.1. In my interface I'm mixing CocoaTouch Table Views and other UiScrollviews in addition to Chipmunk space with rigid bodys.
The problem ist, every time I scroll in an UIView, the chipmunk engine is interrupting and stops the calculation till scrolling animations are finished.
Is there a solution for this? Thank you for your tipps.
Rabu.
Qi Apps for your mind http://www.i-qi-clock.com
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Scrolling in UIView interrupting physic engine

Post by slembcke »

Hmm. I'm not really an AppKit expert. I've run into a similar problem before where scrolling would block my timers, but it wasn't that big of a deal in my case so I ignored it. A more general iOS developer forum could probably point you in the right direction.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Rabu
Posts: 2
Joined: Wed Aug 31, 2011 2:16 pm
Contact:

Re: Scrolling in UIView interrupting physic engine

Post by Rabu »

I found a simple solution. I run the loop in a different thread. I change the mode to NSRunLoopCommonModes and the animation runs without interruption.
[displaylink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];

Rabu.
Qi Apps for your mind http://www.i-qi-clock.com
Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests