Back to project page gameengine.
The source code is released under:
Apache License
If you think the Android project gameengine listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.garrapeta.gameengine.actor; /*from w w w .j a va 2s . co m*/ import android.graphics.PointF; import com.badlogic.gdx.physics.box2d.Body; import com.badlogic.gdx.physics.box2d.CircleShape; import com.garrapeta.gameengine.Box2DWorld; /** * Actor basado en un crculo * * @author GaRRaPeTa */ public class Box2DCircleActor<T extends Box2DWorld> extends Box2DAtomicActor<T> { // -------------------------------------------------- Constructor /** * Constructor * * @param world * @param worldPos * , posicin en el mundo, en unidades del mundo * @param radius * , radio en unidades del mundo * @param dynamic */ public Box2DCircleActor(T world, PointF worldPos, float radius, boolean dynamic) { super(world); // Create Shape with Properties CircleShape circleShape = new CircleShape(); circleShape.setRadius(radius); Body body = world.createBody(this, worldPos, dynamic); // Assign shape to Body body.createFixture(circleShape, 1.0f); circleShape.dispose(); } }