Skip to content

Instantly share code, notes, and snippets.

@codeinvain
Created July 22, 2010 06:23
Show Gist options
  • Save codeinvain/485646 to your computer and use it in GitHub Desktop.
Save codeinvain/485646 to your computer and use it in GitHub Desktop.
protected function application1_initializeHandler(event:FlexEvent):void
{
setupWorldPhysics();
}
private function setupWorldPhysics():void
{
worldUIContainer.parseCompiseteVisualElement(ball,new ComplexShapeParser(ShapeFidality.LOW));
var p1FixD:b2FixtureDef = new b2FixtureDef();
p1FixD.friction=0;
p1FixD.density=0;
var staticBody:ComponenetToBodyMap = new ComponenetToBodyMap(null,p1FixD,ComponenetToBodyMap.KINEMATIC_BODY);
worldUIContainer.map(p1,staticBody);
worldUIContainer.map(p2,staticBody);
worldUIContainer.map(p1Goal,staticBody);
worldUIContainer.map(p2Goal,staticBody);
worldUIContainer.world.addEventListener(b2World.BEGINCONTACT,onBodiesContact);
worldUIContainer.world.addEventListener(b2World.POSTSTEP,onPostStep);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment