artisynth.core.mechmodels
Class CollisionBehavior

java.lang.Object
  extended by artisynth.core.mechmodels.CollisionBehavior

public class CollisionBehavior
extends java.lang.Object

Contains information describing the appropriate collision response between two bodies.


Constructor Summary
CollisionBehavior()
          Creates a new CollisionBehavior with default values.
CollisionBehavior(boolean enabled, double mu)
          Creates a new CollisionBehavior with a specified enabling and friction.
CollisionBehavior(CollisionBehavior b)
          Creates a new CollisionBehavior whose values are copied from an existing one.
 
Method Summary
 boolean equals(CollisionBehavior b)
          Returns true if this behavior equals another.
 boolean equals(java.lang.Object obj)
          
 double getFriction()
          Gets the friction associated with this behavior.
 CollidablePair getPair()
          Returns the collision pair associated with this behavior.
 boolean isEnabled()
          Returns true if collisions are enabled in this behavior.
 void set(CollisionBehavior v)
           
 void setEnabled(boolean enabled)
          Enables or disabled collisions for this behavior.
 void setFriction(double mu)
          Sets the friction coefficent associated with this behavior.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CollisionBehavior

public CollisionBehavior()
Creates a new CollisionBehavior with default values.


CollisionBehavior

public CollisionBehavior(CollisionBehavior b)
Creates a new CollisionBehavior whose values are copied from an existing one.

Parameters:
b - behavior to copy

CollisionBehavior

public CollisionBehavior(boolean enabled,
                         double mu)
Creates a new CollisionBehavior with a specified enabling and friction.

Parameters:
enabled - true if collisions are enabled
mu - friction coefficient
Method Detail

getFriction

public double getFriction()
Gets the friction associated with this behavior.

Returns:
friction associated with this behavior

setFriction

public void setFriction(double mu)
Sets the friction coefficent associated with this behavior.

Parameters:
mu - friction associated with this behavior

isEnabled

public boolean isEnabled()
Returns true if collisions are enabled in this behavior.

Returns:
true if collisions are enabled

setEnabled

public void setEnabled(boolean enabled)
Enables or disabled collisions for this behavior.

Parameters:
enabled - if true, enables collisions

equals

public boolean equals(CollisionBehavior b)
Returns true if this behavior equals another. The values returned by getPair are not considered in this comparision.

Parameters:
b - behavior to compare with
Returns:
true if this behavior equals b

set

public void set(CollisionBehavior v)

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPair

public CollidablePair getPair()
Returns the collision pair associated with this behavior. This information is not normally set by the application.

Returns:
collision pair associated with this behavior.