Lua Physics

what would be the obj-c / xcode equivalent of

local physics = require(“physics”)
physics.start()

?

btw, this sdk is so cool =) [import]uid: 13743 topic_id: 5336 reply_id: 305336[/import]

[cpp]
// == HEADER : something.h == //

#import
#import “Box2D.h”

@interface something : NSObject
{
b2World* myWorld;
// et cetera … //
}

@property (nonatomic) b2World* world;
// other properties … //

- (b2World*)doSomething:(b2Body*)b withWorld:(b2World*)w;
// other methods … //

@end
//-------------------------------------//
// == IMPLEMENTATION : something.mm == //

#import “something.h”
@implementation something

@synthesize world = myWorld;

// init, dealloc, and all that other good stuff… //

- (b2World*)doSomething:(b2Body*)b withWorld:(b2World*)w
{
b2World* aWorld;
// do something… //
return aWorld;
}

@end
[/cpp] [import]uid: 6645 topic_id: 5336 reply_id: 17749[/import]

oh also you’d need something like

[cpp]
CGSize screenSize = [Director sharedDirector].winSize;
b2AABB worldAABB;
float borderSize = 96/PTM_RATIO;
worldAABB.lowerBound.Set(-borderSize, -borderSize);
worldAABB.upperBound.Set(screenSize.width/PTM_RATIO+borderSize, screenSize.height/PTM_RATIO+borderSize);
b2Vec2 gravity(0.0f, -30.0f);
bool doSleep = true;
myWorld = new b2World(worldAABB, gravity, doSleep);
[/cpp] [import]uid: 6645 topic_id: 5336 reply_id: 17754[/import]