working on it ...

Filters

Explore Public Snippets

Sort by

Found 47 snippets matching: box2d

    public by leonardo  2916  1  5  1

    SNIPPET - Box2d_LibGdx_Integration

    /*
    <SNIPPET>
    	<TAGS = "JAVA,LIBGDX,BOX2D" />
    	<NAME="Box2d_LibGdx_Integration" />
    	<DESCR>Codice per integrare una texture region con un oggetto Box2D</DESCR>
    </SNIPPET>
    */
    
    public TextureWrapper{
         TextureRegion region;
         int width;
         int height;
         Vector2 position;
         float scaleX;
         float scaleY;
         float originX;
         float originY;
         float rotation;
         public TextureWrapper(TextureRegion region,Vector2 pos){
              this.position=pos;
              SetTextureRegion(region);
         } 
         public void SetTextureRegion(TextureRegion region){
              this.region=region;
              width=region.getRegionWidth();
              height=region.getRegionHeight();
              originX=width/2;
              originY=height/2;
              scaleX=1;
              scaleY=1;
         }
         public int GetWidth(){
            return width;
         } 
         public int GetHeight(){
              return height;
         } 
    
         public void SetPosition(float x,float y){
              position.set(x,y);
         } 
         public void SetRotation(float r){
              rotation=r;
         } 
    
         public void Draw(SpriteBatch sp){
              sp.draw(region,position.x-width/2, position.y-height/2,
               originX, originY, width, height,
              scaleX, scaleY, rotation);
         }
         ....
    }
    
    
    
    public class BoxUserData{
            int collisionGroup;
            int boxId;
            public BoxUserData(int boxid,int collisiongroup){
                      Set(boxid,collisiongroup);
            }
            public void Set(int boxid,int collisiongroup){
                      this.boxId=boxid;
                      this.collisionGroup=collisiongroup;
            }
            public int GetBoxId(){
                   return this.boxId;
            }
            public int GetCollisionGroup{ 
                    return this.collisionGroup;
            }
    
    }

    public by leonardo  2691  2  6  0

    SNIPPET - Box2d_Java

    Codice Box2D per creare una simulazione fisica con oggetti fisici
    /*
    <SNIPPET>
    	<TAGS="JAVA,LIBGDX,BOX2D" />
    	<NAME="Box2d_Java" />
    	<DESCR>Codice Box2D per creare una simulazione fisica con oggetti fisici</DESCR>
    </SNIPPET>
    */
    
    // Codice Generico Box2D (only box2d debug mode is visible)
    
    // 100 pixels <-> 1 meter
    static final float WORLD_TO_BOX=0.01f; 
    static final float BOX_WORLD_TO=100f;
    float ConvertToBox(float x){
        return x*WORLD_TO_BOX;
    }
    
    // Step 1 - Create World
    World world=new World(new Vector2(0,-20),true) // World(Vector2 gravity, boolean doSleep) // com.badlogic.gdx.math
    
    // Step 2 - Create Body
    public void CreateBody(World world,Vector2 pos,float angle){
        BodyDef bodyDef = new BodyDef(); 
        bodyDef.type = bodyType; // The body type: static, kinematic, or dynamic
        bodyDef.position.set(ConvertToBox(pos.x),ConvertToBox(pos.y)); // The world position of the body.
        bodyDef.angle=angle; // The world angle of the body in radians.
        body = world.createBody(bodyDef);
    }
    
    // Step 3 - Create Fixture/Shape
    private void MakeRectFixture(float width,float height,BodyDef.BodyType bodyType,
         float density,float restitution, Vector2 pos,float angle){
         PolygonShape bodyShape = new PolygonShape();
    
         float w=ConvertToBox(width/2f);
         float h=ConvertToBox(height/2f);
         bodyShape.setAsBox(w,h);
    
         FixtureDef fixtureDef=new FixtureDef();
         fixtureDef.density=density; // The density, usually in kg/m^2.
         fixtureDef.restitution=restitution; // The restitution (elasticity) usually in the range [0,1].
         fixtureDef.shape=bodyShape;
         /*
         com.badlogic.gdx.physics.box2d.Shape
    		com.badlogic.gdx.physics.box2d.PolygonShape {ChainShape, CircleShape, EdgeShape, PolygonShape}
    			PolygonShape (->setAsBox(float hx, float hy) Build vertices to represent an axis-aligned box.)
         */
    
         body.createFixture(fixtureDef);
         bodyShape.dispose(); // lo puoi fare perchè la shape è clonata quando viene assegnata alla fixture
     }
    
    private void MakeCircleFixture(float radius,BodyDef.BodyType bodyType,
         float density,float restitution, Vector2 pos,float angle){
    
         FixtureDef fixtureDef=new FixtureDef();
         fixtureDef.density=density;
         fixtureDef.restitution=restitution;
         fixtureDef.shape=new CircleShape();
         fixtureDef.shape.setRadius(BoxObjectManager.ConvertToBox(radius));
    
         body.createFixture(fixtureDef);
         fixtureDef.shape.dispose();
     }
    
    // Step 4 - World Update Fixed TimeStep
    static final float BOX_STEP=1/120f;
    static final int  BOX_VELOCITY_ITERATIONS=8;
    static final int BOX_POSITION_ITERATIONS=3;
    float accumulator;
    
    public void Update(float dt){
       accumulator+=dt;
        while(accumulator>BOX_STEP){
          world.step(BOX_STEP,BOX_VELOCITY_ITERATIONS,BOX_POSITION_ITERATIONS);
          accumulator-=BOX_STEP;
       }
    
    }
    
    

    external by bobabongi  125  0  2  0

    LibGDX rendering routine using a TiledMap renderer, the Box2D debug renderer and sprites

    LibGDX rendering routine using a TiledMap renderer, the Box2D debug renderer and sprites: WorldRenderingSystem_extract.java
    @Override
    public void update(float deltaTime) {
        /* glClear etc... */
    
        // mapCamera is an OrthogonalCamera
        mapCamera.position.set(cameraMovable.position.x * mapComponent.pixelsPerMeter,
                cameraMovable.position.y * mapComponent.pixelsPerMeter, 0);
        mapCamera.zoom = 1.0f/cameraComponent.camera_zoom;
        mapCamera.update();
    
        // render the map - mapRenderer is an OrthogonalTiledMapRenderer
        NavigationScreen.spriteBatch.setProjectionMatrix(mapCamera.combined);
        mapRenderer.render();
    
        // render physical bodies and triggers - debugRenderer is a Box2DDebugRenderer
        if(displayDebugRenderer) {
            debugProjectionMatrix = mapCamera.combined.cpy();
            debugProjectionMatrix.scale(mapComponent.pixelsPerMeter, mapComponent.pixelsPerMeter, 1f);
            debugRenderer.render(Managers.physics.world, debugProjectionMatrix);
        }
    
        // render sprites
        NavigationScreen.spriteBatch.begin();
        for(/* ... */) {
            // spritePosition := position in world coordinates
    
            sprite.setCenter(spritePosition.x * mapComponent.pixelsPerMeter,
                    spritePosition.y * mapComponent.pixelsPerMeter);
    
            sprite.draw(NavigationScreen.spriteBatch);
        }
        NavigationScreen.spriteBatch.end();
    }
    
    @Override
    public void resize(int width, int height) {
            float aspectRatio = (float) width / (float) height;
            // in my code this is called howManyTexturePixelsWeSeeInAScreenHeight
            float camHeight = screenHeightInMeters*mapComponent.pixelsPerMeter;
            cameraComponent.mapCamera = new OrthographicCamera(aspectRatio*camHeight, camHeight);
    }
    
    

    external by bpander  68  1  1  0

    Parse an svg file to create a Box2D hit box

    Parse an svg file to create a Box2D hit box: b2SVGParser
    function b2SVGParser () {
    
    }
    
    b2SVGParser.prototype.parse = function (svg, world, bodyDef, fixtureDef) {
        fixtureDef.shape = new b2PolygonShape();
        var body = world.CreateBody(bodyDef);
        var traverse = function (nodes) {
            var i = -1;
            var node;
            var fixture;
            while ((node = nodes[++i]) !== undefined) {
                switch (node.tagName) {
                    case 'line':
                        fixtureDef.shape.SetAsEdge(
                            new b2Vec2(node.getAttribute('x1'), node.getAttribute('y1')),
                            new b2Vec2(node.getAttribute('x2'), node.getAttribute('y2'))
                        );
                        body.CreateFixture(fixtureDef);
                        break;
    
                    case 'polyline':
                        // Basically just iterate over the node's [points] attribute to make a bunch of 'line's
                        break;
                }
                traverse(node.children);
            }
        };
        traverse(svg.children);
        return body;
    };
    
    
    var svgParser = new b2SVGParser();
    svgParser.parse(svg, world, bodyDef, fixtureDef);
    
    
    

    external by Github  3098  17  4  0

    Script: Love2D, Box2D Top Down Player Movement with Keyboard + Mouse

    Script: Love2D, Box2D Top Down Player Movement with Keyboard + Mouse: main.lua
    Lua
    -- http://forums.tigsource.com/index.php?topic=38448.msg989600#msg989600
    -- main.lua
    
    local lk, lp, lg = love.keyboard, love.physics, love.graphics
    
    local world, player, box
    
    function unitVector(x, y)
      local len = math.sqrt(x * x + y * y)
      if len == 0 then return x, y end
      return x / len, y / len
    end
    
    -- trig goes anti clock wise from 1, 0
    -- love2D goes clock wise from 0, -1
    function vectorAngle(x, y)
      local angle = -(-math.atan2(y, x) - math.rad(90))
      if angle < 0 then
        return math.rad(360) + angle
      elseif angle == -0 then
        return 0
      else
        return angle
      end
    end
    
    -- a box2d physics object needs a boody
    -- a body needs a shape attached by a fixture
    function newRectangle(type, x, y, w, h, mass, angle)
      local o = {}
      o.b = lp.newBody(world, x, y, type)
      o.b:setMass(mass)
      o.b:setAngle(angle)
      o.s = lp.newRectangleShape(w, h)
      o.f = lp.newFixture(o.b, o.s)
      return o
    end
    
    function love.load()
      -- no gravity
      world = lp.newWorld(0, 0, true)
      box = newRectangle('static', 300, 300, 200, 100, 0, 2)
      player = newRectangle('dynamic', 400, 400, 50, 40, 0, 0)
      -- slows down by itself
      player.b:setLinearDamping(5)
      -- won't spin out of control on collisions
      -- we will set angle based on mouse position
      player.b:setFixedRotation(true)
      -- bouncyness
      player.f:setRestitution(0.2)
      player.speed = 3000
    end
    
    function love.update(dt)
      if love.keyboard.isDown('escape') then love.event.quit() end
    
      -- movement
      if love.keyboard.isDown('w') then
        -- move negative y
        player.b:applyForce(0, -player.speed)
      elseif love.keyboard.isDown('s') then
        -- move positive y
        player.b:applyForce(0, player.speed)
      end
      if love.keyboard.isDown('a') then
        -- move negative x
        player.b:applyForce(-player.speed, 0)
      elseif love.keyboard.isDown('d') then
        -- move positive x
        player.b:applyForce(player.speed, 0)
      end
    
      -- look
      -- player center
      -- note if you change the viewport/camera you need to convert the player
      -- world position to a camera position
      local x, y = player.b:getWorldCenter()
      -- unit vector of mouse vector - player position vector
      x, y = unitVector(love.mouse.getX() - x, love.mouse.getY() - y)
      -- finally set the angle so the player looks at the mouse cursor
      player.b:setAngle(vectorAngle(x, y))
    
      world:update(dt)
    end
    
    function love.draw()
      lg.setColor(200, 200, 200)
      lg.polygon("fill", box.b:getWorldPoints(box.s:getPoints()))
      lg.setColor(20, 200, 20)
      lg.polygon("fill", player.b:getWorldPoints(player.s:getPoints()))
      lg.setColor(255, 255, 255)
      lg.print(love.timer.getFPS(), 10, 10)
    end
    
    
    

    external by ichiko  45  0  1  0

    libGDX with Box2D PolygonShape Definition

    libGDX with Box2D PolygonShape Definition: PlayGroundScreen.java
    package cc.clv.revjune.pts.screen;
    
    import cc.clv.revjune.pts.PTSGame;
    import com.badlogic.gdx.Gdx;
    import com.badlogic.gdx.Screen;
    import com.badlogic.gdx.graphics.GL20;
    import com.badlogic.gdx.graphics.OrthographicCamera;
    import com.badlogic.gdx.graphics.Texture;
    import com.badlogic.gdx.graphics.g2d.Sprite;
    import com.badlogic.gdx.math.MathUtils;
    import com.badlogic.gdx.math.Vector2;
    import com.badlogic.gdx.physics.box2d.*;
    import com.badlogic.gdx.utils.Array;
    
    /**
     * Created by ichiko on 2015/02/07.
     */
    public class PlayGroundScreen implements Screen {
        private final PTSGame game;
    
        private OrthographicCamera cam;
    
        private World world;
        private Box2DDebugRenderer debugRenderer;
    
        private Array<Body> bodiesList;
    
        public PlayGroundScreen(final PTSGame game) {
            this.game = game;
    
            float w = Gdx.graphics.getWidth();
            float h = Gdx.graphics.getHeight();
            cam = new OrthographicCamera();
            cam.setToOrtho(false, w, h);
    
            Box2D.init();
            // no gravity
            world = new World(new Vector2(0, 0), true);
            debugRenderer = new Box2DDebugRenderer();
            bodiesList = new Array<Body>();
    
            addWorldObjects();
    
            world.getBodies(bodiesList);
        }
    
        private void addWorldObjects() {
            Texture img = new Texture("square.png");
            Sprite sprite = new Sprite(img);
    
            float w = sprite.getWidth();   // 100px
            float h = sprite.getHeight();  // 100px
    
            // ここから剛体の定義
    
            BodyDef bodyDef = new BodyDef();
            bodyDef.type = BodyDef.BodyType.DynamicBody;
            bodyDef.position.set(300, 200);
    
            Body body = world.createBody(bodyDef);
            body.setUserData(sprite);
    
            PolygonShape shape = new PolygonShape();
    //        shape.setAsBox(w, h);
            shape.setAsBox(w/2, h/2);
    
            FixtureDef fixtureDef = new FixtureDef();
            fixtureDef.shape = shape;
            fixtureDef.density = 1.0f;
            fixtureDef.friction = 1.0f;
            fixtureDef.restitution = 0.6f; // make it bounce little bit
    
            body.createFixture(fixtureDef);
    
            shape.dispose();
        }
    
        @Override
        public void show() {
    
        }
    
        @Override
        public void render(float delta) {
            Gdx.gl.glClearColor(0, 0, 1, 1);
            Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    
            game.batch.begin();
            for (Body body : bodiesList) {
                if (body.getUserData() != null) {
                    Vector2 pos = body.getPosition();
                    if (body.getUserData() instanceof Sprite) {
                        Sprite sprite = (Sprite) body.getUserData();
                        sprite.setRotation(MathUtils.radiansToDegrees * body.getAngle());
                        sprite.setPosition(pos.x - sprite.getWidth() / 2f,
                                pos.y - sprite.getHeight() / 2f);
                        sprite.draw(game.batch);
                    }
                }
            }
            game.batch.end();
    
            debugRenderer.render(world, cam.combined);
    
            world.step(1/60f, 6, 2);
        }
    
        @Override
        public void resize(int width, int height) {
    
        }
    
        @Override
        public void pause() {
    
        }
    
        @Override
        public void resume() {
    
        }
    
        @Override
        public void hide() {
    
        }
    
        @Override
        public void dispose() {
    
        }
    }
    
    
    

    external by Will Sams  34  0  1  0

    Compiling/Installing Box2d on LInux

    Compiling/Installing Box2d on LInux: Compiling and Installing Box2d on Linux
    sudo su && apt-get install g++ cmake libglu-dev libxi-dev freeglut3-dev p7zip-full  #only step in this gist Debian/Ubuntu/LinuxMint specific
    wget http://box2d.googlecode.com/files/Box2D_v2.3.0.7z
    7z x Box2D_v2.3.0.7z
    cd Box2D_v2.3.0/Box2D/Build
    cmake -DBOX2D_VERSION=2.3.0 \
        -DBOX2D_INSTALL=ON \
        -DBOX2D_INSTALL_DOC=ON \
        -DBOX2D_BUILD_SHARED=ON \
        -DBOX2D_BUILD_STATIC=ON \
        -DBOX2D_BUILD_EXAMPLES=OFF \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_VERBOSE_MAKEFILE=ON \
        ..
    make
    make preinstall
    cmake -DCMAKE_INSTALL_PREFIX=/usr/local -P cmake_install.cmake
    
    
    

    external by tmpjr  294  12  3  0

    Box2d demo simulation for StackOverflow question

    Box2d demo simulation for StackOverflow question: Box2DStackOverflow.cpp
    C++
    #include <SDL2/SDL.h>
    #include <SDL2/SDL_opengl.h>
    #include <Box2D/Box2D.h>
    #include <stdio.h>
    #include <stdexcept>
    
    #include "TextureManager.h"
    
    SDL_Window* gameWindow;
    SDL_Renderer* gameRenderer;
    
    // Pixels Per Meter
    static constexpr float PPM{400.0f};
    static constexpr float FPS{60.f};
    static constexpr float DELAY_TIME = 1000.f / FPS;
    static constexpr float TIMESTEP = 1.f / 60.f;
    
    static constexpr int WIDTH = 800;
    static constexpr int HEIGHT = 600;
    
    b2World* world;
    b2Body* body;
    
    b2Body* groundBody;
    b2Fixture* bottomFixture;
    
    class Ball 
    {
    private:
    
    
    public:
        static constexpr int WIDTH{22};
        static constexpr int HEIGHT{22};
        static constexpr int RADIUS{11};
    
        b2Vec2 position;
        float angle;
        b2Vec2 linearVelocity;
    
        Ball();
        void init(b2World* world);
        void render(TextureManager& textureManager);
        void kick();
    private:
        b2Body* body;
        b2BodyDef myBodyDef;
    };
    
    Ball::Ball()
    {
    }
    
    void Ball::init(b2World* world)
    {
        // setup dynamic body
        myBodyDef.type = b2_dynamicBody;
        myBodyDef.position.Set(100/PPM, 100/PPM);
        body = world->CreateBody(&myBodyDef);
    
        body->SetUserData(this);
        
        // add circle fixture
        b2CircleShape circleShape;
        circleShape.m_p.Set(0, 0);
        circleShape.m_radius = RADIUS;
        b2FixtureDef myFixtureDef;
        myFixtureDef.shape = &circleShape;
        myFixtureDef.density = 1;
        myFixtureDef.friction = 0.2f;
        myFixtureDef.restitution = 1.0f;
        body->CreateFixture(&myFixtureDef);
    }
    
    void Ball::kick()
    {
        b2Vec2 force = b2Vec2(0, 10.0f);
        body->ApplyLinearImpulse(force, myBodyDef.position, true);
    }
    
    void Ball::render(TextureManager& textureManager)
    {
        textureManager.render(position.x, position.y);
    }
    
    int main()
    {
        if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
            throw std::runtime_error("Initialized failure");
        }
    
        if (SDL_ShowCursor(SDL_DISABLE) < 0) {
            throw std::runtime_error("Could not disable cursor");
        }
    
        // Draw main window
        gameWindow = SDL_CreateWindow("Box2D Demo", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, WIDTH, HEIGHT, 0);
        gameRenderer = SDL_CreateRenderer(gameWindow, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
        if (gameWindow == nullptr) {
            throw std::runtime_error("gameWindow could not be created");
        }
        if (gameRenderer == nullptr) {
            throw std::runtime_error("gameRenderer could not be created");
        }
    
        SDL_SetRenderDrawColor(gameRenderer, 55, 55, 55, 255);
    
        TextureManager txtBall = { gameRenderer };
        txtBall.loadFromFile("img/ball.png");
    
        // Box2D
        b2Vec2 gravity = b2Vec2(0.0f, 10.0f);
        world = new b2World(gravity);
    
        // Create edges around entire screen
        b2BodyDef groundBodyDef;
        groundBodyDef.position.Set(0,HEIGHT/PPM);
        groundBody = world->CreateBody(&groundBodyDef);
    
        b2EdgeShape groundBox;
        b2FixtureDef groundBoxDef;
        groundBoxDef.shape = &groundBox;
      
        // ground 
        groundBox.Set(b2Vec2(0, HEIGHT/PPM), b2Vec2(WIDTH/PPM, HEIGHT/PPM));
        bottomFixture = groundBody->CreateFixture(&groundBoxDef); 
        // right wall
        groundBox.Set(b2Vec2(WIDTH - 11, 0), b2Vec2(WIDTH-11, HEIGHT/PPM));
        groundBody->CreateFixture(&groundBoxDef);
        // left wall
        groundBox.Set(b2Vec2(-11, 0), b2Vec2(-11, HEIGHT));
        groundBody->CreateFixture(&groundBoxDef);
        // top wall
        groundBox.Set(b2Vec2(0, -70), b2Vec2(WIDTH, -70));
        groundBody->CreateFixture(&groundBoxDef);
       
        Ball* ball = new Ball();
        ball->init(world);
        
        SDL_Event e;
    
        Uint32 lastTime, currentTime, frameTime;
        float deltaTime;
        currentTime = SDL_GetTicks();
    
        bool running = true;
        while (running) {
            lastTime = currentTime;
            currentTime = SDL_GetTicks();
            deltaTime = (currentTime - lastTime) / 1000.f;
    
            if (SDL_PollEvent(&e)) {
                if (e.type == SDL_QUIT) {
                    running = false;
                }
            }
    
            world->Step(TIMESTEP, 10, 10);
    
            b2Body* b = world->GetBodyList();
            while (b != nullptr) {
                Ball* ball = static_cast<Ball*>(b->GetUserData());
                if (ball != nullptr) {
                    ball->position = b2Vec2(b->GetPosition().x * PPM, b->GetPosition().y * PPM);
                    ball->linearVelocity = b->GetLinearVelocity();
                    ball->angle = b->GetAngle();
                }
    
                b = b->GetNext();
            }
            
            ball->kick();
    
            // Clear screen
            SDL_RenderClear(gameRenderer);
            ball->render(txtBall);
    
            // Update screen
            SDL_RenderPresent(gameRenderer);
    
    
            frameTime = SDL_GetTicks() - currentTime;
            if (frameTime < DELAY_TIME) {
                SDL_Delay((int)(DELAY_TIME - frameTime));
            }
        }
    
        world = nullptr;
        groundBody = nullptr;
        IMG_Quit();
        SDL_Quit();
        return 0;
    }
    
    
    

    external by pascience  1034  1  4  1

    Integrating gdx-ai's steering behaviours with Ashley and Box2D

    Integrating gdx-ai's steering behaviours with Ashley and Box2D: PhysicsSystem_extract.java
    // apply steering behaviors
    ImmutableArray<Entity> entities = engine.getEntitiesFor(Family.getFor(SteerAgentComponent.class));
    for(int i = 0; i < entities.size(); i++) {
        Entity e = entities.get(i);
        Body body = e.getComponent(PhysicalBodyComponent.class).body;
    
        SteerAgentComponent steer = e.getComponent(SteerAgentComponent.class);
        if(steer.steeringBehavior == null) {
            continue;
        }
    
        steer.steeringBehavior.calculateSteering(steer.steeringOutput);
    
        Vector2 linear_force = steer.steeringOutput.linear.cpy();
        linear_force.scl(body.getMass());
        body.applyForceToCenter(linear_force, true);
    
        body.applyTorque(steer.steeringOutput.angular*body.getInertia(), true);
    }
    
    // step the simulation
    world.step(Constants.PHYSICS_TIME_STEP, Constants.PHYSICS_VELOCITY_ITERATIONS, Constants.PHYSICS_POSITION_ITERATIONS);
    
    
    
    

    external by jarbot  888  0  3  0

    Mac osx 10.9 box2d emscripten errors

    Mac osx 10.9 box2d emscripten errors: gistfile1.txt
    D
    cpp -xc++ -DEM_NO_LIBCPP -IBox2D_v2.2.1 root.h > box2d.clean.h
    In file included from root.h:20:
    In file included from Box2D_v2.2.1/Box2D/Box2D.h:34:
    In file included from Box2D_v2.2.1/Box2D/Common/b2Settings.h:23:
    In file included from /usr/include/assert.h:44:
    In file included from /usr/include/stdlib.h:61:
    In file included from /usr/include/Availability.h:148:
    /usr/include/AvailabilityInternal.h:4098:10: error: #else without #if
            #else
             ^
    /usr/include/AvailabilityInternal.h:4158:10: error: unterminated conditional directive
            #if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6
             ^
    /usr/include/AvailabilityInternal.h:4131:10: error: unterminated conditional directive
            #if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_5
             ^
    /usr/include/AvailabilityInternal.h:4108:10: error: unterminated conditional directive
            #if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_4
             ^
    4 errors generated.
    make: *** [box2d.clean.h] Error 1
    
    
    
    • Public Snippets
    • Channels Snippets