/** Remove the instance to the managed instances. * Be careful using this method. This method is intended for internal purposes only. */ public static void removeInstance(final btCollisionObject obj) { instances.remove(getCPtr(obj)); }
/** Remove the instance to the managed instances. * Be careful using this method. This method is intended for internal purposes only. */ public static void removeInstance(final btCollisionObject obj) { instances.remove(getCPtr(obj)); }
/** Destroy a joint. This may cause the connected bodies to begin colliding. * @warning This function is locked during callbacks. */ public void destroyJoint (Joint joint) { joint.setUserData(null); joints.remove(joint.addr); joint.jointEdgeA.other.joints.removeValue(joint.jointEdgeB, true); joint.jointEdgeB.other.joints.removeValue(joint.jointEdgeA, true); jniDestroyJoint(addr, joint.addr); }
@Override public void dispose() { doneFace(address); ByteBuffer buffer = library.fontData.get(address); if(buffer != null) { library.fontData.remove(address); if (BufferUtils.isUnsafeByteBuffer(buffer)) BufferUtils.disposeUnsafeByteBuffer(buffer); } }
@Override public void dispose() { doneFace(address); ByteBuffer buffer = library.fontData.get(address); if(buffer != null) { library.fontData.remove(address); if (BufferUtils.isUnsafeByteBuffer(buffer)) BufferUtils.disposeUnsafeByteBuffer(buffer); } }
/** Destroy a fixture. This removes the fixture from the broad-phase and destroys all contacts associated with this fixture. * This will automatically adjust the mass of the body if the body is dynamic and the fixture has positive density. All * fixtures attached to a body are implicitly destroyed when the body is destroyed. * @param fixture the fixture to be removed. * @warning This function is locked during callbacks. */ public void destroyFixture (Fixture fixture) { this.world.destroyFixture(this, fixture); fixture.setUserData(null); this.world.fixtures.remove(fixture.addr); this.fixtures.removeValue(fixture, true); this.world.freeFixtures.free(fixture); }
void freeSource (int sourceID) { if (noDevice) return; alSourceStop(sourceID); alSourcei(sourceID, AL_BUFFER, 0); if (sourceToSoundId.containsKey(sourceID)) { long soundId = sourceToSoundId.remove(sourceID); soundIdToSource.remove(soundId); } idleSources.add(sourceID); }
void freeSource (int sourceID) { if (noDevice) return; alSourceStop(sourceID); alSourcei(sourceID, AL_BUFFER, 0); if (sourceToSoundId.containsKey(sourceID)) { long soundId = sourceToSoundId.remove(sourceID); soundIdToSource.remove(soundId); } idleSources.add(sourceID); }
void freeSource (int sourceID) { if (noDevice) return; alSourceStop(sourceID); alSourcei(sourceID, AL_BUFFER, 0); if (sourceToSoundId.containsKey(sourceID)) { long soundId = sourceToSoundId.remove(sourceID); soundIdToSource.remove(soundId); } idleSources.add(sourceID); }
void freeSource (int sourceID) { if (noDevice) return; alSourceStop(sourceID); alSourcei(sourceID, AL_BUFFER, 0); if (sourceToSoundId.containsKey(sourceID)) { long soundId = sourceToSoundId.remove(sourceID); soundIdToSource.remove(soundId); } idleSources.add(sourceID); }
void stopSourcesWithBuffer (int bufferID) { if (noDevice) return; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceID = idleSources.get(i); if (alGetSourcei(sourceID, AL_BUFFER) == bufferID) { if (sourceToSoundId.containsKey(sourceID)) { long soundId = sourceToSoundId.remove(sourceID); soundIdToSource.remove(soundId); } alSourceStop(sourceID); } } }
void stopSourcesWithBuffer (int bufferID) { if (noDevice) return; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceID = idleSources.get(i); if (alGetSourcei(sourceID, AL_BUFFER) == bufferID) { if (sourceToSoundId.containsKey(sourceID)) { long soundId = sourceToSoundId.remove(sourceID); soundIdToSource.remove(soundId); } alSourceStop(sourceID); } } }
void stopSourcesWithBuffer (int bufferID) { if (noDevice) return; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceID = idleSources.get(i); if (alGetSourcei(sourceID, AL_BUFFER) == bufferID) { if (sourceToSoundId.containsKey(sourceID)) { long soundId = sourceToSoundId.remove(sourceID); soundIdToSource.remove(soundId); } alSourceStop(sourceID); } } }
void stopSourcesWithBuffer (int bufferID) { if (noDevice) return; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceID = idleSources.get(i); if (alGetSourcei(sourceID, AL_BUFFER) == bufferID) { if (sourceToSoundId.containsKey(sourceID)) { long soundId = sourceToSoundId.remove(sourceID); soundIdToSource.remove(soundId); } alSourceStop(sourceID); } } }
void freeBuffer (int bufferID) { if (noDevice) return; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceID = idleSources.get(i); if (alGetSourcei(sourceID, AL_BUFFER) == bufferID) { if (sourceToSoundId.containsKey(sourceID)) { long soundId = sourceToSoundId.remove(sourceID); soundIdToSource.remove(soundId); } alSourceStop(sourceID); alSourcei(sourceID, AL_BUFFER, 0); } } }
void freeBuffer (int bufferID) { if (noDevice) return; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceID = idleSources.get(i); if (alGetSourcei(sourceID, AL_BUFFER) == bufferID) { if (sourceToSoundId.containsKey(sourceID)) { long soundId = sourceToSoundId.remove(sourceID); soundIdToSource.remove(soundId); } alSourceStop(sourceID); alSourcei(sourceID, AL_BUFFER, 0); } } }
void freeBuffer (int bufferID) { if (noDevice) return; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceID = idleSources.get(i); if (alGetSourcei(sourceID, AL_BUFFER) == bufferID) { if (sourceToSoundId.containsKey(sourceID)) { long soundId = sourceToSoundId.remove(sourceID); soundIdToSource.remove(soundId); } alSourceStop(sourceID); alSourcei(sourceID, AL_BUFFER, 0); } } }
void freeBuffer (int bufferID) { if (noDevice) return; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceID = idleSources.get(i); if (alGetSourcei(sourceID, AL_BUFFER) == bufferID) { if (sourceToSoundId.containsKey(sourceID)) { long soundId = sourceToSoundId.remove(sourceID); soundIdToSource.remove(soundId); } alSourceStop(sourceID); alSourcei(sourceID, AL_BUFFER, 0); } } }
/** Destroy a rigid body given a definition. No reference to the definition is retained. This function is locked during * callbacks. * @warning This automatically deletes all associated shapes and joints. * @warning This function is locked during callbacks. */ public void destroyBody (Body body) { Array<JointEdge> jointList = body.getJointList(); while (jointList.size > 0) destroyJoint(body.getJointList().get(0).joint); jniDestroyBody(addr, body.addr); body.setUserData(null); this.bodies.remove(body.addr); Array<Fixture> fixtureList = body.getFixtureList(); while(fixtureList.size > 0) { Fixture fixtureToDelete = fixtureList.removeIndex(0); this.fixtures.remove(fixtureToDelete.addr).setUserData(null); freeFixtures.free(fixtureToDelete); } freeBodies.free(body); }
int obtainSource (boolean isMusic) { if (noDevice) return 0; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceId = idleSources.get(i); int state = alGetSourcei(sourceId, AL_SOURCE_STATE); if (state != AL_PLAYING && state != AL_PAUSED) { if (isMusic) { idleSources.removeIndex(i); } else { if (sourceToSoundId.containsKey(sourceId)) { long soundId = sourceToSoundId.get(sourceId); sourceToSoundId.remove(sourceId); soundIdToSource.remove(soundId); } long soundId = nextSoundId++; sourceToSoundId.put(sourceId, soundId); soundIdToSource.put(soundId, sourceId); } alSourceStop(sourceId); alSourcei(sourceId, AL_BUFFER, 0); AL10.alSourcef(sourceId, AL10.AL_GAIN, 1); AL10.alSourcef(sourceId, AL10.AL_PITCH, 1); AL10.alSource3f(sourceId, AL10.AL_POSITION, 0, 0, 1f); return sourceId; } } return -1; }