Skip to content

Commit

Permalink
Starting 'GLES2' branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGramlich committed Aug 14, 2011
1 parent 43eed57 commit e0c1513
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
3 changes: 1 addition & 2 deletions src/com/badlogic/gdx/utils/LongMap.java
Expand Up @@ -15,11 +15,10 @@
******************************************************************************/
package com.badlogic.gdx.utils;

import java.lang.reflect.Array;
import java.util.Iterator;
import java.util.NoSuchElementException;

import org.anddev.andengine.util.MathUtils;
import org.anddev.andengine.util.math.MathUtils;

/**
* An unordered map that uses long keys. This implementation is a cuckoo hash map using 3 hashes, random walking, and a small
Expand Down
@@ -1,9 +1,10 @@
package org.anddev.andengine.extension.physics.box2d;

import org.anddev.andengine.engine.handler.IUpdateHandler;
import org.anddev.andengine.entity.shape.IAreaShape;
import org.anddev.andengine.entity.shape.IShape;
import org.anddev.andengine.extension.physics.box2d.util.constants.PhysicsConstants;
import org.anddev.andengine.util.MathUtils;
import org.anddev.andengine.util.math.MathUtils;

import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
Expand Down Expand Up @@ -38,28 +39,28 @@ public class PhysicsConnector implements IUpdateHandler, PhysicsConstants {
// Constructors
// ===========================================================

public PhysicsConnector(final IShape pShape, final Body pBody) {
this(pShape, pBody, true, true);
public PhysicsConnector(final IAreaShape pAreaShape, final Body pBody) {
this(pAreaShape, pBody, true, true);
}

public PhysicsConnector(final IShape pShape, final Body pBody, final float pPixelToMeterRatio) {
this(pShape, pBody, true, true, pPixelToMeterRatio);
public PhysicsConnector(final IAreaShape pAreaShape, final Body pBody, final float pPixelToMeterRatio) {
this(pAreaShape, pBody, true, true, pPixelToMeterRatio);
}

public PhysicsConnector(final IShape pShape, final Body pBody, final boolean pUdatePosition, final boolean pUpdateRotation) {
this(pShape, pBody, pUdatePosition, pUpdateRotation, PIXEL_TO_METER_RATIO_DEFAULT);
public PhysicsConnector(final IAreaShape pAreaShape, final Body pBody, final boolean pUdatePosition, final boolean pUpdateRotation) {
this(pAreaShape, pBody, pUdatePosition, pUpdateRotation, PIXEL_TO_METER_RATIO_DEFAULT);
}

public PhysicsConnector(final IShape pShape, final Body pBody, final boolean pUdatePosition, final boolean pUpdateRotation, final float pPixelToMeterRatio) {
this.mShape = pShape;
public PhysicsConnector(final IAreaShape pAreaShape, final Body pBody, final boolean pUdatePosition, final boolean pUpdateRotation, final float pPixelToMeterRatio) {
this.mShape = pAreaShape;
this.mBody = pBody;

this.mUpdatePosition = pUdatePosition;
this.mUpdateRotation = pUpdateRotation;
this.mPixelToMeterRatio = pPixelToMeterRatio;

this.mShapeHalfBaseWidth = pShape.getBaseWidth() * 0.5f;
this.mShapeHalfBaseHeight = pShape.getBaseHeight() * 0.5f;
this.mShapeHalfBaseWidth = pAreaShape.getBaseWidth() * 0.5f;
this.mShapeHalfBaseHeight = pAreaShape.getBaseHeight() * 0.5f;
}

// ===========================================================
Expand Down
Expand Up @@ -6,10 +6,11 @@
import java.util.List;

import org.anddev.andengine.entity.primitive.Line;
import org.anddev.andengine.entity.shape.IAreaShape;
import org.anddev.andengine.entity.shape.IShape;
import org.anddev.andengine.extension.physics.box2d.util.constants.PhysicsConstants;
import org.anddev.andengine.util.MathUtils;
import org.anddev.andengine.util.constants.Constants;
import org.anddev.andengine.util.math.MathUtils;

import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
Expand Down Expand Up @@ -75,15 +76,15 @@ public static FixtureDef createFixtureDef(final float pDensity, final float pEla
return fixtureDef;
}

public static Body createBoxBody(final PhysicsWorld pPhysicsWorld, final IShape pShape, final BodyType pBodyType, final FixtureDef pFixtureDef) {
return PhysicsFactory.createBoxBody(pPhysicsWorld, pShape, pBodyType, pFixtureDef, PIXEL_TO_METER_RATIO_DEFAULT);
public static Body createBoxBody(final PhysicsWorld pPhysicsWorld, final IAreaShape pAreaShape, final BodyType pBodyType, final FixtureDef pFixtureDef) {
return PhysicsFactory.createBoxBody(pPhysicsWorld, pAreaShape, pBodyType, pFixtureDef, PIXEL_TO_METER_RATIO_DEFAULT);
}

public static Body createBoxBody(final PhysicsWorld pPhysicsWorld, final IShape pShape, final BodyType pBodyType, final FixtureDef pFixtureDef, final float pPixelToMeterRatio) {
final float[] sceneCenterCoordinates = pShape.getSceneCenterCoordinates();
public static Body createBoxBody(final PhysicsWorld pPhysicsWorld, final IAreaShape pAreaShape, final BodyType pBodyType, final FixtureDef pFixtureDef, final float pPixelToMeterRatio) {
final float[] sceneCenterCoordinates = pAreaShape.getSceneCenterCoordinates();
final float centerX = sceneCenterCoordinates[Constants.VERTEX_INDEX_X];
final float centerY = sceneCenterCoordinates[Constants.VERTEX_INDEX_Y];
return PhysicsFactory.createBoxBody(pPhysicsWorld, centerX, centerY, pShape.getWidthScaled(), pShape.getHeightScaled(), pShape.getRotation(), pBodyType, pFixtureDef, pPixelToMeterRatio);
return PhysicsFactory.createBoxBody(pPhysicsWorld, centerX, centerY, pAreaShape.getWidthScaled(), pAreaShape.getHeightScaled(), pAreaShape.getRotation(), pBodyType, pFixtureDef, pPixelToMeterRatio);
}

public static Body createBoxBody(final PhysicsWorld pPhysicsWorld, final float pCenterX, final float pCenterY, final float pWidth, final float pHeight, final float pRotation, final BodyType pBodyType, final FixtureDef pFixtureDef) {
Expand Down Expand Up @@ -116,15 +117,15 @@ public static Body createBoxBody(final PhysicsWorld pPhysicsWorld, final float p
return boxBody;
}

public static Body createCircleBody(final PhysicsWorld pPhysicsWorld, final IShape pShape, final BodyType pBodyType, final FixtureDef pFixtureDef) {
return PhysicsFactory.createCircleBody(pPhysicsWorld, pShape, pBodyType, pFixtureDef, PIXEL_TO_METER_RATIO_DEFAULT);
public static Body createCircleBody(final PhysicsWorld pPhysicsWorld, final IAreaShape pAreaShape, final BodyType pBodyType, final FixtureDef pFixtureDef) {
return PhysicsFactory.createCircleBody(pPhysicsWorld, pAreaShape, pBodyType, pFixtureDef, PIXEL_TO_METER_RATIO_DEFAULT);
}

public static Body createCircleBody(final PhysicsWorld pPhysicsWorld, final IShape pShape, final BodyType pBodyType, final FixtureDef pFixtureDef, final float pPixelToMeterRatio) {
final float[] sceneCenterCoordinates = pShape.getSceneCenterCoordinates();
public static Body createCircleBody(final PhysicsWorld pPhysicsWorld, final IAreaShape pAreaShape, final BodyType pBodyType, final FixtureDef pFixtureDef, final float pPixelToMeterRatio) {
final float[] sceneCenterCoordinates = pAreaShape.getSceneCenterCoordinates();
final float centerX = sceneCenterCoordinates[Constants.VERTEX_INDEX_X];
final float centerY = sceneCenterCoordinates[Constants.VERTEX_INDEX_Y];
return PhysicsFactory.createCircleBody(pPhysicsWorld, centerX, centerY, pShape.getWidthScaled() * 0.5f, pShape.getRotation(), pBodyType, pFixtureDef, pPixelToMeterRatio);
return PhysicsFactory.createCircleBody(pPhysicsWorld, centerX, centerY, pAreaShape.getWidthScaled() * 0.5f, pAreaShape.getRotation(), pBodyType, pFixtureDef, pPixelToMeterRatio);
}

public static Body createCircleBody(final PhysicsWorld pPhysicsWorld, final float pCenterX, final float pCenterY, final float pRadius, final float pRotation, final BodyType pBodyType, final FixtureDef pFixtureDef) {
Expand Down

0 comments on commit e0c1513

Please sign in to comment.