public LTouchLocation(int aId, LTouchLocationState aState, Vector2f aPosition, float aPressure) { id = aId; position = aPosition; previousPosition = Vector2f.ZERO(); state = aState; previousState = LTouchLocationState.Invalid; pressure = aPressure; previousPressure = 0.0f; }
public LTouchLocation(int aId, LTouchLocationState aState, float x, float y) { id = aId; position = new Vector2f(x, y); previousPosition = Vector2f.ZERO(); state = aState; previousState = LTouchLocationState.Invalid; pressure = 0.0f; previousPressure = 0.0f; }
public boolean tryGetPreviousLocation(RefObject<LTouchLocation> aPreviousLocation) { if (aPreviousLocation.argvalue == null) { aPreviousLocation.argvalue = new LTouchLocation(); } if (previousState == LTouchLocationState.Invalid) { aPreviousLocation.argvalue.id = -1; aPreviousLocation.argvalue.state = LTouchLocationState.Invalid; aPreviousLocation.argvalue.position = Vector2f.ZERO(); aPreviousLocation.argvalue.previousState = LTouchLocationState.Invalid; aPreviousLocation.argvalue.previousPosition = Vector2f.ZERO(); aPreviousLocation.argvalue.pressure = 0.0f; aPreviousLocation.argvalue.previousPressure = 0.0f; return false; } else { aPreviousLocation.argvalue.id = this.id; aPreviousLocation.argvalue.state = this.previousState; aPreviousLocation.argvalue.position = this.previousPosition.cpy(); aPreviousLocation.argvalue.previousState = LTouchLocationState.Invalid; aPreviousLocation.argvalue.previousPosition = Vector2f.ZERO(); aPreviousLocation.argvalue.pressure = this.previousPressure; aPreviousLocation.argvalue.previousPressure = 0.0f; return true; } }