HTML and CSS Reference
In-Depth Information
// draw sprites
var body = this.world.GetBodyList();
while (body) {
var sprite = body.GetUserData();
if (sprite) {
var position = body.GetWorldCenter();
sprite.x = position.x * pxPerMeter;
sprite.y = position.y * pxPerMeter;
sprite.rotation = body.GetAngle() * 180 / Math.PI; // rad to
degree
}
body = body.GetNext();
}
// existing bodies removal code goes here.
};
The following screenshot shows the result of represening the physics bodies with our graphics:
 
Search WWH ::




Custom Search