public Node<E> obtain (Node<E> p, Node<E> n, E value, int index) { Node<E> newNode = super.obtain(); newNode.p = p; newNode.n = n; newNode.value = value; newNode.index = index; return newNode; } }
private void postTouchEvent (AndroidInput input, int type, int x, int y, int pointer, int button, long timeStamp) { TouchEvent event = input.usedTouchEvents.obtain(); event.timeStamp = timeStamp; event.pointer = pointer; event.x = x; event.y = y; event.type = type; event.button = button; input.touchEvents.add(event); }
private void postTouchEvent (AndroidInput input, int type, int x, int y, int scrollAmount, long timeStamp) { TouchEvent event = input.usedTouchEvents.obtain(); event.timeStamp = timeStamp; event.x = x; event.y = y; event.type = type; event.scrollAmount = scrollAmount; input.touchEvents.add(event); }
/** Reuses a previous freed instance or creates a new instance and set it to reflect the specified native object */ public static btBroadphasePair obtain(long cPtr, boolean own) { final btBroadphasePair result = pool.obtain(); result.reset(cPtr, own); return result; } /** delete the native object if required and allow the instance to be reused by the obtain method */
private Cell obtainCell () { Cell cell = cellPool.obtain(); cell.setLayout(this); return cell; }
private Cell obtainCell () { Cell cell = cellPool.obtain(); cell.setLayout(this); return cell; }
/** Reuses a previous freed instance or creates a new instance and set it to reflect the specified native object */ public static btBroadphaseProxy obtain(long cPtr, boolean own) { final btBroadphaseProxy result = pool.obtain(); result.reset(cPtr, own); return result; } /** delete the native object if required and allow the instance to be reused by the obtain method */
/** Reuses a previous freed instance or creates a new instance and set it to reflect the specified native object */ public static btBroadphasePair obtain(long cPtr, boolean own) { final btBroadphasePair result = pool.obtain(); result.reset(cPtr, own); return result; } /** delete the native object if required and allow the instance to be reused by the obtain method */
/** Reuses a previous freed instance or creates a new instance and set it to reflect the specified native object */ public static btBroadphaseProxy obtain(long cPtr, boolean own) { final btBroadphaseProxy result = pool.obtain(); result.reset(cPtr, own); return result; } /** delete the native object if required and allow the instance to be reused by the obtain method */
@Override public T obtain () { T result = super.obtain(); obtained.add(result); return result; }
@Override public void keyTyped (java.awt.event.KeyEvent e) { synchronized (this) { KeyEvent event = usedKeyEvents.obtain(); event.keyChar = e.getKeyChar(); event.keyCode = 0; event.type = KeyEvent.KEY_TYPED; event.timeStamp = System.nanoTime(); keyEvents.add(event); lwjglAwtCanvas.graphics.requestRendering(); } }
/** Returns a new or pooled action of the specified type. */ static public <T extends Action> T action (Class<T> type) { Pool<T> pool = Pools.get(type); T action = pool.obtain(); action.setPool(pool); return action; }
@Override public void onGamepadDisconnected (int index) { GwtController controller = controllerMap.remove(index); if (controller != null) { synchronized (eventQueue) { GwtControllerEvent event = eventPool.obtain(); event.type = GwtControllerEvent.DISCONNECTED; event.controller = controller; eventQueue.add(event); } } }
@Override public void getRenderables (Array<Renderable> renderables, Pool<Renderable> pool) { for (Renderable renderable : this.renderables) renderables.add(pool.obtain().set(renderable)); }
@Override public Renderable obtain () { Renderable renderable = super.obtain(); renderable.environment = null; renderable.material = null; renderable.meshPart.set("", null, 0, 0, 0); renderable.shader = null; obtained.add(renderable); return renderable; }
/** Returns a new or pooled action of the specified type. */ static public <T extends Action> T action (Class<T> type) { Pool<T> pool = Pools.get(type); T action = pool.obtain(); action.setPool(pool); return action; }
protected void getRenderables (Node node, Array<Renderable> renderables, Pool<Renderable> pool) { if (node.parts.size > 0) { for (NodePart nodePart : node.parts) { if (nodePart.enabled) renderables.add(getRenderable(pool.obtain(), node, nodePart)); } } for (Node child : node.getChildren()) { getRenderables(child, renderables, pool); } }
private void addDebugRect (float x, float y, float w, float h, Color color) { if (debugRects == null) debugRects = new Array(); DebugRect rect = DebugRect.pool.obtain(); rect.color = color; rect.set(x, getHeight() - y - h, w, h); debugRects.add(rect); }
protected void getRenderables (Node node, Array<Renderable> renderables, Pool<Renderable> pool) { if (node.parts.size > 0) { for (NodePart nodePart : node.parts) { if (nodePart.enabled) renderables.add(getRenderable(pool.obtain(), node, nodePart)); } } for (Node child : node.getChildren()) { getRenderables(child, renderables, pool); } }
public void renderSkeleton (final Vector3 from, final Node node) { final Vector3 pos = vectorPool.obtain(); node.globalTransform.getTranslation(pos); shapeRenderer.setColor(node.isAnimated ? Color.RED : Color.YELLOW); shapeRenderer.box(pos.x, pos.y, pos.z, 0.5f, 0.5f, 0.5f); shapeRenderer.setColor(Color.WHITE); shapeRenderer.line(from.x, from.y, from.z, pos.x, pos.y, pos.z); for (Node child : node.getChildren()) renderSkeleton(pos, child); vectorPool.free(pos); }