/** Returns the list of {@link Contact} instances produced by the last call to {@link #step(float, int, int)}. Note that the * returned list will have O(1) access times when using indexing. contacts are created and destroyed in the middle of a time * step. Use {@link ContactListener} to avoid missing contacts * @return the contact list */ public Array<Contact> getContactList () { int numContacts = getContactCount(); if (numContacts > contactAddrs.length) { int newSize = 2 * numContacts; contactAddrs = new long[newSize]; contacts.ensureCapacity(newSize); freeContacts.ensureCapacity(newSize); } if (numContacts > freeContacts.size) { int freeConts = freeContacts.size; for (int i = 0; i < numContacts - freeConts; i++) freeContacts.add(new Contact(this, 0)); } jniGetContactList(addr, contactAddrs); contacts.clear(); for (int i = 0; i < numContacts; i++) { Contact contact = freeContacts.get(i); contact.addr = contactAddrs[i]; contacts.add(contact); } return contacts; }
for (int i = 0; i < world.getContactCount(); i++) { Contact contact = contacts.get(i); contact.resetFriction();
renderer.begin(ShapeType.Point); renderer.setColor(0, 1, 0, 1); for (int i = 0; i < world.getContactCount(); i++) { Contact contact = world.getContactList().get(i);
/** Returns the list of {@link Contact} instances produced by the last call to {@link #step(float, int, int)}. Note that the * returned list will have O(1) access times when using indexing. contacts are created and destroyed in the middle of a time * step. Use {@link ContactListener} to avoid missing contacts * @return the contact list */ public Array<Contact> getContactList () { int numContacts = getContactCount(); if (numContacts > contactAddrs.length) { int newSize = 2 * numContacts; contactAddrs = new long[newSize]; contacts.ensureCapacity(newSize); freeContacts.ensureCapacity(newSize); } if (numContacts > freeContacts.size) { int freeConts = freeContacts.size; for (int i = 0; i < numContacts - freeConts; i++) freeContacts.add(new Contact(this, 0)); } jniGetContactList(addr, contactAddrs); contacts.clear(); for (int i = 0; i < numContacts; i++) { Contact contact = freeContacts.get(i); contact.addr = contactAddrs[i]; contacts.add(contact); } return contacts; }