Tag Info

Hot answers tagged

2

Ok, think I got an answer for you. The short version: compute the friction force F = friction * velocity before you start the loop and apply it in do Physics() like this: v -= F * deltaTime. Long version: the assumption you're making that it should work independent of frame time only works with constant acceleration, like the one you're applying in ...


1

Remember that SpriteKit's physics system is based on "SKPhysicsBody"s, which are added to "SKSpriteNode"s. Those physics bodies, however, needn't be attached to visible nodes. The simplest method is to create a SpriteNode with no actual sprite or visible body, add it as a child to the area you want on the visible shape, and categorize it differently from ...


1

Typically a physics engine will follow these steps: Broad-phase collision detection. Typically using bounding volumes, this reduces the set of all objects to a small subset of potentially colliding objects. Some data structures to handle broad-phase are AABB trees, KD-trees, Octrees, etc. Narrow-phase collision detection. From the subset of potential ...



Only top voted, non community-wiki answers of a minimum length are eligible