Pregunta

Is there any way how to pause rendering in Sprite Kit runloop, but still simulate physics and run all actions?

I'm writing small simulator and I need to be able to check collisions and apply forces to objects so I think it would be great to use the new Sprite Kit physics. However I have to be able to turn off rendering and focus just on simulation, but I am not sure if this is possible with Sprite Kit.

So what do you think, is it possible or do I have to use some other physics engine (Box2D)?

¿Fue útil?

Solución

The short answer is no. There is no way to just stop rendering in Sprite Kit. The SKView is responsible for rendering which takes place as the last segment of the scene processing. SKView does have a paused command which causes no actions to be executed but it also stops the physics simulation.

Source: SKView Class Reference

Otros consejos

You should use the Box2D engine, as SpriteKit does the same.

The Wikipedia page for Box2D says:

The physics engine used in SpriteKit for iOS and OS X uses Box2D internally.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top