DIVE Collision Demo


Demo | Details

Demo

Getting the Demo

If you are at UCL a record and replay demo is currently copyable from our CVS repository. On cygwin the CVSROOT is //smbhelp/vr-dive/cvsroot and the package is collision. That is
export CVSROOT=//smbhelp/vr-dive/cvsroot
cvs checkout collision
If you aren't able to see the repository then you download a zipped version here:
collision-demo.tgz.

This demo works with all recent versions of DIVE.

Running It

The demo can be started with the run_desk command if you use UNIX or cygwin or run_winnt.bat if you use a PC. If you use UNIX or cygwin you will need to customise "dive_env". If you use run_winnt.bat note that the paths are hard-coded.

The demo is a version of 127, with collision detection, collision prevention, with invisible and visible objects and with gravity and surface following on.

Details

Note that collision detection in DIVE needs to be configured before starting. DIVE supports full avatar-object and object-object collision, but note that it isn't particularly reliable (collision detection is hard!), and is time consuming (DIVE's implementation could be better). That is, occasionally you will pass through an object, especially if you are colliding with two objects simultaneously. For those who know the field, this is DIVE does not do volume sweeping.

Collision detection depends critically on the avatar. Your avatar needs to have an AURA to cause collision events, and it needs to have a FOOT to enable collision prevention.

Collision events are caused by collision of the aura with objects in the scene. Thus when using the demo, you will notice when you get near an object. You can change this behaviour by changing the aura shape. If an avatar doesn't have an aura, then DIVE adds one automatically. See marking your avatar inside vishnu and then looking at the tree.

Collision penetration prevention, is configured using distance from the "bottom" or "right_foot" object. If neither exist "right_foot" will be added automatically. (You might also find "bottom" as an associated object name for "right_foot" - see the meny Self/Associated Objects). You can configure the distance for collision prevention (AJS TO CHECK HOW - something to do with "center" object - let me know if this is important).

For surface following, it is the "right_foot" or "bottom" object that follows the ground. You can "step up" a certain distance over obstacles. You will fall under gravity to the next lowest surface under you. (AJS TO CHECK CONFIGURATION OF THIS).

Configure

As noted, collision detection needs to be enabled at start up. There are three configure variables:
person_collision_solid  1
person_collision        0  # Set if you want auto collision detection
person_gravity          0  # Set if you want auto gravity (works only
                           # with person_collision)
person_collision_solid means that the avatar can only collide with solid objects.

World Definition

Relevant flags for collision can be seen in the following snipper from collision.vr:
    object {
        solid off
	collision on
	visibility off
        inline "box1.vr"
	begin.tcl

        proc oncollision {event id1 id2 type} {
    	  puts "Mel's old office"
        }

	dive_register COLLISION_SIGNAL DIVE_COLLISION [dive_self] "" oncollision
	end.tcl
    }
Objects can be collidable "collision on" regardless of whether they are visible or solid. "solid on" objects are solid(!). Note that the person_collision_solidn configure variable means that the avatar can only collide with solid objects.

In that code you can also see the syntax for registering interest in collisions. See the demo for more variations.


Anthony Steed, A.Steed@cs.ucl.ac.uk