Package org.andengine.entity.shape

Examples of org.andengine.entity.shape.IShape


  // Methods for/from SuperClass/Interfaces
  // ===========================================================

  @Override
  public void onUpdate(final float pSecondsElapsed) {
    final IShape shape = this.mShape;
    final Body body = this.mBody;

    if(this.mUpdatePosition) {
      final Vector2 position = body.getPosition();
      final float pixelToMeterRatio = this.mPixelToMeterRatio;
      shape.setPosition(position.x * pixelToMeterRatio - this.mShapeHalfBaseWidth, position.y * pixelToMeterRatio - this.mShapeHalfBaseHeight);
    }

    if(this.mUpdateRotation) {
      final float angle = body.getAngle();
      shape.setRotation(MathUtils.radToDeg(angle));
    }
  }
View Full Code Here

TOP

Related Classes of org.andengine.entity.shape.IShape

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.