My solution was this:
#include "engine.h"
#include <iostream>
#include <cmath>
int main( int argn, char* argv[] )
{
Initialize() ;
RegisterAbstractPath("C:/Users/Sammy/Desktop/Leadwerks SDK");
SetAppTitle( "New" ) ;
Graphics( 800, 500 ) ;
AFilter() ;
TFilter() ;
TWorld world;
TBuffer gbuffer;
TCamera camera;
TMesh mesh;
TBody body;
TMesh mesh2;
TBody body2;
TLight light;
TMaterial material;
world = CreateWorld() ;
if (!world) {
MessageBoxA(0,"Error","Failed to create world.",0);
return Terminate();
}
gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);
camera=CreateCamera();
PositionEntity(camera,Vec3(0,0,-2));
mesh=CreateSphere(16);
body=CreateBodySphere();
EntityParent(mesh,body);
SetBodyMass(body,1);
EntityType(body,1);
PositionEntity(body,Vec3(-0.8,0,0));
mesh2=CreateSphere(16);
body2=CreateBodySphere();
EntityParent(mesh2,body2);
SetBodyMass(body2,1);
EntityType(body2,1);
PositionEntity(body2,Vec3(0.2,0,0));
DebugPhysics(1);
light=CreateDirectionalLight();
RotateEntity(light,Vec3(45,45,45));
Collisions(1,1,1);
SetWorldGravity(Vec3(0,0,0));
TVec3 b1Vec = Vec3(0,0,0);
TVec3 b2Vec = Vec3(0,0,0);
TVec3 fVec = Vec3(0,0,0);
// Game loop
while( !KeyHit() && !AppTerminate() )
{
b1Vec = EntityPosition(body);
b2Vec = EntityPosition(body2);
fVec = Vec3((b1Vec.X - b2Vec.X)*(-1), (b1Vec.Y - b2Vec.Y)*(-1), (b1Vec.Z - b2Vec.Z)*(-1));
AddBodyForce(body,fVec);
if(KeyDown(KEY_UP))
{
AddBodyForce(body,Vec3(0,10,0));
}
if(KeyDown(KEY_DOWN))
{
AddBodyForce(body,Vec3(0,-10,0));
}
// Update timing and world
UpdateAppTime();
UpdateWorld(AppSpeed()) ;
// Render
SetBuffer(gbuffer);
RenderWorld();
SetBuffer(BackBuffer());
RenderLights(gbuffer);
// Send to screen
Flip(0) ;
}
// Done
return Terminate() ;
}
And it works perfectly!