|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsim.physics2D.constraint.Collision
public class Collision
Created when a collision is detected between two objects and used to solve for the collision impulses.
Field Summary | |
---|---|
PhysicalObject2D |
obj1
|
PhysicalObject2D |
obj2
|
Constructor Summary | |
---|---|
Collision()
|
Method Summary | |
---|---|
void |
AddPhysicalObject(PhysicalObject2D mobjRigidBody)
|
void |
AddPhysicalObject(PhysicalObject2D mobjRigidBody,
Double2D connectionPoint)
Add a physical object to the collision and specify the vector pointing from the center of the object to the collision point. |
void |
applyImpulses(int curAnswerRow,
Vector answers)
Applies the calculated impulses to the objects involved in the collision |
int |
GetCollisionResponseRows()
Returns the number of rows in the collision response matrix |
void |
setCollisionMatrices(int curConstraintRow,
BorderedDiagonalIdentityMatrix collisionMatrix,
Vector answerVector)
Sets the blocks of the global matrices represented by this collision |
void |
setColNormal(Double2D colNormal)
|
void |
setRelVel(double relVel)
Sets the relative velocity along the collision normal |
void |
setSticky()
Set this collision to be perfectly inelastic |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public PhysicalObject2D obj1
public PhysicalObject2D obj2
Constructor Detail |
---|
public Collision()
Method Detail |
---|
public void setSticky()
public int GetCollisionResponseRows()
GetCollisionResponseRows
in interface ImpulseConstraint
public void setColNormal(Double2D colNormal)
public void setRelVel(double relVel)
public void AddPhysicalObject(PhysicalObject2D mobjRigidBody)
public void AddPhysicalObject(PhysicalObject2D mobjRigidBody, Double2D connectionPoint)
public void setCollisionMatrices(int curConstraintRow, BorderedDiagonalIdentityMatrix collisionMatrix, Vector answerVector)
setCollisionMatrices
in interface ImpulseConstraint
public void applyImpulses(int curAnswerRow, Vector answers)
applyImpulses
in interface ImpulseConstraint
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |