Package | com.fileitup.fisixengine.collisions |
Class | public final class DetectionModes |
import com.fileitup.fisixengine.collisions. import com.fileitup.fisixengine.core. import com.fileitup.fisixengine.particles. var myEngine:FisixEngine = new FisixEngine() var p:CircleParticle = myEngine.newCircleParticle(100,100,10) p.setDetectionMode(DetectionModes.HYBRID_VELOCITY)
Constant | Defined by | ||
---|---|---|---|
HYBRID_RAYCAST : int = 3 [static]This is a happy medium between PENETRATION and RAYCAST.
| DetectionModes | ||
LIMIT_VELOCITY : int = 1 [static]Similar to PENETRATION but limits objects' velocities to the magnitude of their radius in order to prevent tunneling.
This method reduces physical accuracy, but is fairly quick. | DetectionModes | ||
PENETRATION : int = 0 [static]This is the simplest and fastest collision detection mode.
| DetectionModes | ||
RAYCAST : int = 2 [static]Uses the object's last position to find out if a collision occured at any time between the last timestep.
This method prevents tunneling, but is also much slower than simple penetration--Use discretely | DetectionModes |
HYBRID_RAYCAST | constant |
public static const HYBRID_RAYCAST:int = 3
This is a happy medium between PENETRATION and RAYCAST. it only raycasts when the velocity of the object is greater than it's radius.
This method is much faster than regular raycasting, but is a bit less accurate. Tunneling may occur in some cases.
LIMIT_VELOCITY | constant |
public static const LIMIT_VELOCITY:int = 1
Similar to PENETRATION but limits objects' velocities to the magnitude of their radius in order to prevent tunneling.
This method reduces physical accuracy, but is fairly quick. Usually best with larger objects.
PENETRATION | constant |
public static const PENETRATION:int = 0
This is the simplest and fastest collision detection mode. Use it whenever possible for faster simulations.
This mode does not prevent tunneling (fast moving objects moving through other objects
RAYCAST | constant |
public static const RAYCAST:int = 2
Uses the object's last position to find out if a collision occured at any time between the last timestep.
This method prevents tunneling, but is also much slower than simple penetration--Use discretely