public static boolean isUnsafeByteBuffer (ByteBuffer buffer) { synchronized (unsafeBuffers) { return unsafeBuffers.contains(buffer, true); } }
public static boolean isUnsafeByteBuffer (ByteBuffer buffer) { synchronized (unsafeBuffers) { return unsafeBuffers.contains(buffer, true); } }
@Override public boolean supportsExtension (String extension) { return extensions.contains(extension, false); }
/** Adds a {@link Disposable} to be managed and disposed by this Model. Can be used to keep track of manually loaded textures * for {@link ModelInstance}. * @param disposable the Disposable */ public void manageDisposable (Disposable disposable) { if (!disposables.contains(disposable, true)) disposables.add(disposable); }
/** @return whether the supported OpenGL (not ES) version is compatible with OpenGL ES 2.x. */ private static boolean fullCompatibleWithGLES2 () { // OpenGL ES 2.0 is compatible with OpenGL 4.1 core // see https://www.opengl.org/registry/specs/ARB/ES2_compatibility.txt return glVersion.isVersionEqualToOrHigher(4, 1) || extensions.contains("GL_ARB_ES2_compatibility", false); }
/** Adds a {@link Disposable} to be managed and disposed by this Model. Can be used to keep track of manually loaded textures * for {@link ModelInstance}. * @param disposable the Disposable */ public void manageDisposable (Disposable disposable) { if (!disposables.contains(disposable, true)) disposables.add(disposable); }
/** @return whether the supported OpenGL (not ES) version is compatible with OpenGL ES 2.x. */ private static boolean fullCompatibleWithGLES2 () { // OpenGL ES 2.0 is compatible with OpenGL 4.1 core // see https://www.opengl.org/registry/specs/ARB/ES2_compatibility.txt return glVersion.isVersionEqualToOrHigher(4, 1) || extensions.contains("GL_ARB_ES2_compatibility", false); }
public void setRandomPos () { float max = 100; this.pos.x = -max + MathUtils.random(max * 2); this.pos.y = -max + MathUtils.random(max * 2); float xShift = 100; if (player.contains(this, true)) { this.pos.x -= xShift; } else if (enemy.contains(this, true)) { this.pos.x += xShift; } else { throw new RuntimeException("unhandled"); } }
/** Starts the timer if it was stopped. */ public void start () { synchronized (threadLock) { TimerThread thread = thread(); Array<Timer> instances = thread.instances; if (instances.contains(this, true)) return; instances.add(this); threadLock.notifyAll(); } }
/** Starts the timer if it was stopped. */ public void start () { synchronized (threadLock) { TimerThread thread = thread(); Array<Timer> instances = thread.instances; if (instances.contains(this, true)) return; instances.add(this); threadLock.notifyAll(); } }
private static void rebuildReferences (final Model model, final Node node) { for (final NodePart mpm : node.parts) { if (!model.materials.contains(mpm.material, true)) model.materials.add(mpm.material); if (!model.meshParts.contains(mpm.meshPart, true)) { model.meshParts.add(mpm.meshPart); if (!model.meshes.contains(mpm.meshPart.mesh, true)) model.meshes.add(mpm.meshPart.mesh); model.manageDisposable(mpm.meshPart.mesh); } } for (final Node child : node.getChildren()) rebuildReferences(model, child); }
private static void rebuildReferences (final Model model, final Node node) { for (final NodePart mpm : node.parts) { if (!model.materials.contains(mpm.material, true)) model.materials.add(mpm.material); if (!model.meshParts.contains(mpm.meshPart, true)) { model.meshParts.add(mpm.meshPart); if (!model.meshes.contains(mpm.meshPart.mesh, true)) model.meshes.add(mpm.meshPart.mesh); model.manageDisposable(mpm.meshPart.mesh); } } for (final Node child : node.getChildren()) rebuildReferences(model, child); }
public void addConstructor (final String name, final Constructor<T> constructor) { constructors.put(name, constructor); if (constructor.model != null && !models.contains(constructor.model, true)) models.add(constructor.model); }
/** Sets the selection to only the passed item, if it is a possible choice, else selects the first item. */ public void setSelected (T item) { if (items.contains(item, false)) selection.set(item); else if (items.size > 0) selection.set(items.first()); else selection.clear(); }
/** Sets the selection to only the passed item, if it is a possible choice, else selects the first item. */ public void setSelected (T item) { if (items.contains(item, false)) selection.set(item); else if (items.size > 0) selection.set(items.first()); else selection.clear(); }
@Override public float addSingleResult (btManifoldPoint cp, btCollisionObjectWrapper colObj0Wrap, int partId0, int index0, btCollisionObjectWrapper colObj1Wrap, int partId1, int index1) { btCollisionObject other = colObj0Wrap.getCollisionObject() == projectile.body ? colObj1Wrap.getCollisionObject() : colObj0Wrap.getCollisionObject(); if (other != null && other.userData != null && other.userData instanceof BulletEntity) { BulletEntity ent = (BulletEntity)other.userData; if (ent != ground && !hits.contains(ent, true)) hits.add((BulletEntity)other.userData); } return 0f; } }
/** Sets the selection to only the passed item, if it is a possible choice. * @param item May be null. */ public void setSelected (T item) { if (items.contains(item, false)) selection.set(item); else if (selection.getRequired() && items.size > 0) selection.set(items.first()); else selection.clear(); }
/** Sets the selection to only the passed item, if it is a possible choice. * @param item May be null. */ public void setSelected (T item) { if (items.contains(item, false)) selection.set(item); else if (selection.getRequired() && items.size > 0) selection.set(items.first()); else selection.clear(); }