| java.lang.Object org.jdesktop.j3dfly.utils.vpbehaviors.VPDefaultCollision
All known Subclasses: org.jdesktop.j3dfly.utils.vpbehaviors.VPDriveCollision, org.jdesktop.j3dfly.utils.vpbehaviors.VPVehicleCollision,
VPDefaultCollision | public class VPDefaultCollision implements VPCollisionInterface(Code) | | A simple collision implementation that uses Picking to determine if
a collision will occurr.
The rays of a SweptVolume are cast between the current viewPlatform and
next viewPlatform transform. Only the rays for the non-zero velocity
directions are cast. For example if the VP is moving forward (-ve Z) then
frontRays are checked.
This opimization means that this collision implementation is not appropriate for
checking for collision between the viewPlatform and fast moving animated geometry.
This feature will be added in a future version of the API.
author: Paul Byrne version: 1.11, 01/18/02 |
Method Summary | |
public void | addCollisionBG(BranchGroup bg) | protected PickResult | checkDirection(Transform3D currentLocation, Transform3D nextLocation, Vector3f rayStart, Vector3f rayEnd, float stepSize) | protected boolean | checkXDirection(Transform3D currentLocation, Transform3D destination, Vector3f velocity, SweptVolumeCollision ret) | protected boolean | checkYDirection(Transform3D currentLocation, Transform3D destination, Vector3f velocity, SweptVolumeCollision ret) | protected boolean | checkZDirection(Transform3D currentLocation, Transform3D destination, Vector3f velocity, SweptVolumeCollision ret) | public BranchGroup | getCollisionBG(int index) | public int | getCollisionBGCount() | public SweptVolumeCollision | getCollisions(Transform3D currentLocation, Transform3D nextLocation, Vector3f velocity, float roll, float pitch, float yaw) Check for collision when casting the swept bounds from currentLocation to
nextLocation. | public SweptVolume | getVPSweptVolume() | public void | setCapabilities(BranchGroup branchGroup) | public void | setCollisionLocale(Locale locale) | public void | setVPSweptVolume(SweptVolume volume) |
ALLOW_COLLISION_GEOMETRY | final public static int ALLOW_COLLISION_GEOMETRY(Code) | | Return the geometry for each collision
|
ALLOW_COLLISION_POINT | final public static int ALLOW_COLLISION_POINT(Code) | | Return the point3d for each collision
|
ALLOW_COLLISION_SHAPE | final public static int ALLOW_COLLISION_SHAPE(Code) | | Return minimal amount of information of collision
which is the Shape3D and the RayIndex and Direction
|
VPDefaultCollision | public VPDefaultCollision(int mode)(Code) | | |
VPDefaultCollision | public VPDefaultCollision()(Code) | | Creates a default VPDefaultCollision with a mode of
ALLOW_COLLISION
|
addCollisionBG | public void addCollisionBG(BranchGroup bg)(Code) | | Add a BranchGroup to check for collision
Current implementation only support a single BranchGroup
See Also: setCollisionLocale Parameters: bg - BranchGroup to add to set of BranchGroups checked forcollision |
getCollisionBG | public BranchGroup getCollisionBG(int index)(Code) | | Get the BranchGroup at the specified index that is used for
collision detection
|
getCollisionBGCount | public int getCollisionBGCount()(Code) | | Get the number of collision BranchGroups that are checked for
collision
|
getCollisions | public SweptVolumeCollision getCollisions(Transform3D currentLocation, Transform3D nextLocation, Vector3f velocity, float roll, float pitch, float yaw)(Code) | | Check for collision when casting the swept bounds from currentLocation to
nextLocation. The orientation of the swept bounds is set to the orientation at
nextLocation.
This implementation only processes the first ray in each direction. It
also requires that a ray exists in each direction.
Parameters: currentLocation - The current location of the view Parameters: nextLocation - Will contain the next non collision location of the view on return Parameters: velocity - The current velocity vector for the view Parameters: roll - The change in roll for this frame Parameters: pitch - The change in pitch for this frame Parameters: yaw - The change in yaw for this frame |
getVPSweptVolume | public SweptVolume getVPSweptVolume()(Code) | | Get the SweptVolume used in collision calculations
|
setCapabilities | public void setCapabilities(BranchGroup branchGroup)(Code) | | Set the capabilities in the BranchGroup to allow this collision
detection to work
|
setCollisionLocale | public void setCollisionLocale(Locale locale)(Code) | | Check for collision with all geometry in locale
|
setVPSweptVolume | public void setVPSweptVolume(SweptVolume volume)(Code) | | Set the SweptsweptVolume to be used in collision calculations
|
|
|