cocos2d

FacebookTwitter
Change sprite frame

Box2D Tutorial: Collision filtering | Aurelien Ribon's Dev Blog

Hello, Today I want to make a tutorial about collision filtering in the Box2D engine, because it is something that is not that easy to master, and yet it is a very powerful and useful feature. Note : examples and source code are related to the LibGDX (Android) implementation of the Box2D API, but the concepts are the same for any other implementation, only the syntax may differ. There are two ways to deal with collision filtering: by using categories and masks , or by using groups . These parameters can be found in the Filter component of a Fixture . Filtering collisions with any of these attributes will assure you that collision checks between two bodies that should not collide with each other will not be evaluated at all, resulting in a gain of speed. http://www.aurelienribon.com/blog/2011/07/box2d-tutorial-collision-filtering/

Capture OpenGL ES View as an Image

https://gist.github.com/803265 - (UIImage*)snapshot:(UIView*)eaglview // Get the size of the backing CAEAGLLayer GLint backingWidth, backingHeight;