I have the following code to create a rectangular brick and a physics body associated with it. I expected the physics body to be a solid rectangle same size and position as that of the brick, but am getting a body which I think has a poition offset and perhaps also a size difference. Is there some issue with the coordinate systems I have missed? What is the right way to approach this?
- (void)addBrick {
SKShapeNode *brick = [[SKShapeNode alloc] init];
CGRect brickBoundary = CGRectMake(0.0, 0.0, 100.0, 100.0);
brick.position = CGPointMake(100.0, 100.0);
brick.path = CGPathCreateWithRect(brickBoundary, nil);
brick.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:CGSizeMake(100.0,100.0)];
brick.physicsBody.restitution = 1.0;
brick.physicsBody.friction = 0.0;
brick.physicsBody.dynamic = NO;
[self addChild:brick];
}