|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.odejava.collision.Contact
org.odejava.collision.BulkContact
public class BulkContact
This is an extended version of standard Contact class. This solution is faster on all occasions, but real performance gains occur when iterating over a large set of contacts (several hundreds per step). Transfers contact data from ByteBuffers to local arrays in a single ByteBuffer method call. Commit writes local arrays back to ByteBuffers in a single ByteBuffer method call.
Note: when iterating collision data in a tight loop, avoid creating any objects (e.g. Vector3f, Quaternion4f), this can seriously affect your simulation performance.
Created 13.03.2004 (dd.mm.yyyy)
| Field Summary | |
|---|---|
static int |
ARRAY_SIZE
|
| Fields inherited from class org.odejava.collision.Contact |
|---|
BODY_ID1, BODY_ID2, BOUNCE, BOUNCE_VEL, DEPTH, FDIR1, floatBuf, FLOATBUF_CHUNK_SIZE, GEOM_ID1, GEOM_ID2, index, INTBUF_CHUNK_SIZE, longBuf, maxContacts, MODE, MOTION1, MOTION2, MU, MU2, NORMAL, POSITION, SLIP1, SLIP2, SOFT_CFM, SOFT_ERP |
| Constructor Summary | |
|---|---|
BulkContact(LongBuffer longBuf,
FloatBuffer floatBuf)
|
|
| Method Summary | |
|---|---|
void |
commit()
Commit local arrays back to ByteBuffers in a single call. |
long |
getBodyID1()
|
long |
getBodyID1(int idx)
|
long |
getBodyID2()
|
long |
getBodyID2(int idx)
|
float |
getBounce()
|
float |
getBounce(int idx)
|
float |
getBounceVel()
|
float |
getBounceVel(int idx)
|
float |
getDepth()
|
float |
getDepth(int idx)
|
void |
getFdir1(float[] fdir1)
|
void |
getFdir1(float[] fdir1,
int idx)
|
long |
getGeomID1()
Returns the native address of the first Geom object involved in this contact. |
long |
getGeomID1(int idx)
Returns the native address of the first Geom object involved in this contact. |
long |
getGeomID2()
Returns the native address of the second Geom object involved in this contact. |
long |
getGeomID2(int idx)
Returns the native address of the second Geom object involved in this contact. |
long |
getMode()
Note, if mode = -1 then default surface parameter values are used. |
long |
getMode(int idx)
Note, if mode = -1 then default surface parameter values are used. |
float |
getMotion1()
|
float |
getMotion1(int idx)
|
float |
getMotion2()
|
float |
getMotion2(int idx)
|
float |
getMu()
|
float |
getMu(int idx)
|
float |
getMu2()
|
float |
getMu2(int idx)
|
float[] |
getNormal()
|
void |
getNormal(float[] normal)
|
void |
getNormal(float[] normal,
int idx)
|
float[] |
getNormal(int idx)
|
void |
getNormal(org.openmali.vecmath2.Vector3f normal)
|
void |
getNormal(org.openmali.vecmath2.Vector3f normal,
int idx)
|
float[] |
getPosition()
|
void |
getPosition(float[] position)
|
void |
getPosition(float[] position,
int idx)
|
float[] |
getPosition(int idx)
|
void |
getPosition(org.openmali.vecmath2.Tuple3f position)
|
void |
getPosition(org.openmali.vecmath2.Tuple3f position,
int idx)
|
float |
getSlip1()
|
float |
getSlip1(int idx)
|
float |
getSlip2()
|
float |
getSlip2(int idx)
|
float |
getSoftCfm()
|
float |
getSoftCfm(int idx)
|
float |
getSoftErp()
|
float |
getSoftErp(int idx)
|
void |
ignoreContact(int idx)
Ignore contact so it does not affect to simulation. |
void |
load(int contactCount)
Bulk load ByteBuffer data to local arrays on a single call. |
void |
setBodyID1(int id)
|
void |
setBodyID1(int id,
int idx)
|
void |
setBodyID2(int id,
int idx)
|
void |
setBodyID2(long id)
|
void |
setBounce(float bounce)
|
void |
setBounce(float bounce,
int idx)
|
void |
setBounceVel(float bounceVel)
|
void |
setBounceVel(float bounceVel,
int idx)
|
void |
setDepth(float depth)
|
void |
setDepth(float depth,
int idx)
|
void |
setFdir1(float[] fdir1)
|
void |
setFdir1(float[] fdir1,
int idx)
|
void |
setGeomID1(long id)
|
void |
setGeomID1(long id,
int idx)
|
void |
setGeomID2(long id)
|
void |
setGeomID2(long id,
int idx)
|
void |
setMode(int mode)
Note, if mode = -1 then default surface parameter values are used. |
void |
setMode(int mode,
int idx)
Note, if mode = -1 then default surface parameter values are used. |
void |
setMotion1(float motion1)
|
void |
setMotion1(float motion1,
int idx)
|
void |
setMotion2(float motion2)
|
void |
setMotion2(float motion2,
int idx)
|
void |
setMu(float mu)
|
void |
setMu(float mu,
int idx)
|
void |
setMu2(float mu2)
|
void |
setMu2(float mu2,
int idx)
|
void |
setNormal(float[] normal)
|
void |
setNormal(float[] normal,
int idx)
|
void |
setPosition(float[] position)
|
void |
setPosition(float[] position,
int idx)
|
void |
setSlip1(float slip1)
|
void |
setSlip1(float slip1,
int idx)
|
void |
setSlip2(float slip2)
|
void |
setSlip2(float slip2,
int idx)
|
void |
setSoftCfm(float softCfm)
|
void |
setSoftCfm(float softCfm,
int idx)
|
void |
setSoftErp(float softErp)
|
void |
setSoftErp(float softErp,
int idx)
|
| Methods inherited from class org.odejava.collision.Contact |
|---|
geom1EqualTo, geom2EqualTo, getGeom1, getGeom1, getGeom2, getGeom2, getMaxContacts, ignoreContact, nextContact, setFdir1, setFdir1, setIndex, setNormal, setNormal, setPosition, setPosition |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ARRAY_SIZE
| Constructor Detail |
|---|
public BulkContact(LongBuffer longBuf,
FloatBuffer floatBuf)
longBuf - floatBuf - | Method Detail |
|---|
public void load(int contactCount)
public void commit()
public void ignoreContact(int idx)
idx - The index of the contact to be ignoredpublic long getGeomID1()
Contact
getGeomID1 in class ContactGeom.getNativeAddr(),
Geom.getGeomFromNativeAddr(long)public long getGeomID1(int idx)
Contact
getGeomID1 in class ContactGeom.getNativeAddr(),
Geom.getGeomFromNativeAddr(long)public void setGeomID1(long id)
setGeomID1 in class Contact
public void setGeomID1(long id,
int idx)
setGeomID1 in class Contactpublic long getGeomID2()
Contact
getGeomID2 in class ContactGeom.getNativeAddr(),
Geom.getGeomFromNativeAddr(long)public long getGeomID2(int idx)
Contact
getGeomID2 in class ContactGeom.getNativeAddr(),
Geom.getGeomFromNativeAddr(long)public void setGeomID2(long id)
setGeomID2 in class Contact
public void setGeomID2(long id,
int idx)
setGeomID2 in class Contactpublic long getBodyID1()
getBodyID1 in class Contactpublic long getBodyID1(int idx)
getBodyID1 in class Contactpublic void setBodyID1(int id)
setBodyID1 in class Contact
public void setBodyID1(int id,
int idx)
setBodyID1 in class Contactpublic long getBodyID2()
getBodyID2 in class Contactpublic long getBodyID2(int idx)
getBodyID2 in class Contactpublic void setBodyID2(long id)
setBodyID2 in class Contact
public void setBodyID2(int id,
int idx)
setBodyID2 in class Contactpublic long getMode()
getMode in class Contactpublic long getMode(int idx)
getMode in class Contactpublic void setMode(int mode)
setMode in class Contactmode - of surface contact
public void setMode(int mode,
int idx)
setMode in class Contactmode - of surface contactpublic void getPosition(org.openmali.vecmath2.Tuple3f position)
getPosition in class Contact
public void getPosition(org.openmali.vecmath2.Tuple3f position,
int idx)
getPosition in class Contactpublic void getPosition(float[] position)
getPosition in class Contact
public void getPosition(float[] position,
int idx)
getPosition in class Contactpublic float[] getPosition()
getPosition in class Contactpublic float[] getPosition(int idx)
getPosition in class Contactpublic void setPosition(float[] position)
setPosition in class Contact
public void setPosition(float[] position,
int idx)
setPosition in class Contactpublic void getNormal(org.openmali.vecmath2.Vector3f normal)
getNormal in class Contact
public void getNormal(org.openmali.vecmath2.Vector3f normal,
int idx)
getNormal in class Contactpublic void getNormal(float[] normal)
getNormal in class Contact
public void getNormal(float[] normal,
int idx)
getNormal in class Contactpublic float[] getNormal()
getNormal in class Contactpublic float[] getNormal(int idx)
getNormal in class Contactpublic void setNormal(float[] normal)
setNormal in class Contact
public void setNormal(float[] normal,
int idx)
setNormal in class Contactpublic float getDepth()
getDepth in class Contactpublic float getDepth(int idx)
getDepth in class Contactpublic void setDepth(float depth)
setDepth in class Contact
public void setDepth(float depth,
int idx)
setDepth in class Contactpublic void getFdir1(float[] fdir1)
getFdir1 in class Contact
public void getFdir1(float[] fdir1,
int idx)
getFdir1 in class Contactpublic void setFdir1(float[] fdir1)
setFdir1 in class Contact
public void setFdir1(float[] fdir1,
int idx)
setFdir1 in class Contactpublic float getMu()
getMu in class Contactpublic float getMu(int idx)
getMu in class Contactpublic void setMu(float mu)
setMu in class Contact
public void setMu(float mu,
int idx)
setMu in class Contactpublic float getMu2()
getMu2 in class Contactpublic float getMu2(int idx)
getMu2 in class Contactpublic void setMu2(float mu2)
setMu2 in class Contact
public void setMu2(float mu2,
int idx)
setMu2 in class Contactpublic float getBounce()
getBounce in class Contactpublic float getBounce(int idx)
getBounce in class Contactpublic void setBounce(float bounce)
setBounce in class Contact
public void setBounce(float bounce,
int idx)
setBounce in class Contactpublic float getBounceVel()
getBounceVel in class Contactpublic float getBounceVel(int idx)
getBounceVel in class Contactpublic void setBounceVel(float bounceVel)
setBounceVel in class Contact
public void setBounceVel(float bounceVel,
int idx)
setBounceVel in class Contactpublic float getSoftErp()
getSoftErp in class Contactpublic float getSoftErp(int idx)
getSoftErp in class Contactpublic void setSoftErp(float softErp)
setSoftErp in class Contact
public void setSoftErp(float softErp,
int idx)
setSoftErp in class Contactpublic float getSoftCfm()
getSoftCfm in class Contactpublic float getSoftCfm(int idx)
getSoftCfm in class Contactpublic void setSoftCfm(float softCfm)
setSoftCfm in class Contact
public void setSoftCfm(float softCfm,
int idx)
setSoftCfm in class Contactpublic float getMotion1()
getMotion1 in class Contactpublic float getMotion1(int idx)
getMotion1 in class Contactpublic void setMotion1(float motion1)
setMotion1 in class Contact
public void setMotion1(float motion1,
int idx)
setMotion1 in class Contactpublic float getMotion2()
getMotion2 in class Contactpublic float getMotion2(int idx)
getMotion2 in class Contactpublic void setMotion2(float motion2)
setMotion2 in class Contact
public void setMotion2(float motion2,
int idx)
setMotion2 in class Contactpublic float getSlip1()
getSlip1 in class Contactpublic float getSlip1(int idx)
getSlip1 in class Contactpublic void setSlip1(float slip1)
setSlip1 in class Contact
public void setSlip1(float slip1,
int idx)
setSlip1 in class Contactpublic float getSlip2()
getSlip2 in class Contactpublic float getSlip2(int idx)
getSlip2 in class Contactpublic void setSlip2(float slip2)
setSlip2 in class Contact
public void setSlip2(float slip2,
int idx)
setSlip2 in class Contact
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||