Esempio n. 1
0
 private void updateTransform() {
   if (transformNeedsUpdate) {
     nativeGetTransform(IntercomHelper.getBuffer());
     transformCache = IntercomHelper.decodeTransform();
     inverseTransformCache = transformCache.getInverse();
     transformNeedsUpdate = false;
   }
 }
Esempio n. 2
0
 private void sync() {
   nativeGetViewport(IntercomHelper.getBuffer());
   this.viewport = IntercomHelper.decodeFloatRect();
   this.size = IntercomHelper.decodeVector2f(nativeGetSize());
   this.center = IntercomHelper.decodeVector2f(nativeGetCenter());
   this.rotation = nativeGetRotation();
   transformNeedsUpdate = true;
 }
Esempio n. 3
0
 /**
  * Resets the view to a certain viewport rectangle, resetting the rotation angle in the process.
  *
  * @param rect the viewport rectangle.
  */
 public void reset(FloatRect rect) {
   nativeReset(IntercomHelper.encodeFloatRect(rect));
   sync();
 }
Esempio n. 4
0
 /**
  * Sets the viewport rectangle of this view.
  *
  * <p>The viewport defines which portion of the render target is used by this view and is
  * expressed using factors between 0 and 1 (percentage of the target's width and height).
  *
  * <p>The default viewport rectangle is (0, 0, 1, 1).
  *
  * @param rect the new viewport rectangle.
  */
 public void setViewport(FloatRect rect) {
   nativeSetViewport(IntercomHelper.encodeFloatRect(rect));
   this.viewport = rect;
 }