标题: Collider for Walkthroughs (Physics Behavior) [打印本页] 作者: Asen 时间: 2011-10-20 15:41 标题: Collider for Walkthroughs (Physics Behavior)
Collider for Walkthroughs (Physics Behavior)
Summary
Causes the parent object to interact with any Collision Shells in a way that is appropriate for walkthroughs.
Category
Latest Behaviors
Author
Gavin Kistner
Difficulty
(Reference)
Time to Complete
5 Minutes
Downloads
Click Here
to download the associated files.
(This document covers version 3.3.2 of the 'Collider for Walkthroughs' behavior, current as of 2005-Feb-11)
Description
Attach this behavior to an object to cause it to collide with any objects which have the Collision Shell behavior attached.
When an object collides with a collision shell:
the Collision Shell fires a ‘Collided With’ event
this behavior fires a
Collided
event
This behavior is designed to be placed on a Camera or other other object which is controlled by a behavior like ‘Fly’ or ‘Walk’. It prevents the object from penetrating any collision shells, and (unlike Collider for Simulations) does so without ‘reflecting’ the parent object.
The parent object must be in ‘global space’ for this behavior to work properly. If it is placed inside any parent object which is scaled, rotated, of offset, this behavior will not work as expected.
While the geometry of the collision shells are used to find the collision, the geometry of the Collider object is
NOT
used. Instead, the
Collision Distance
property is used to set up rays which extend in front of the object (along the direction of movement) radiating from the ‘center’ (pivot point) of the object out to the distance specified by the
Radius
property. As the object is moved, these rays test whether or not the parent object has hit any Collision Shell.
It does not matter whether the parent object is moved due to its position velocity, animation or script setting its position directly; the difference in position of the object is used in all cases to determine that it has moved.
Unlike the Collider for Simulations behavior, this behavior does not use the
Elasticity
setting for collision shells.
Finally, note that the collision detection is only based on the movement of the collider,
NOT
the collision shell. If you have the collider sitting still and you move/rotate a collision shell into it (for example, a moving wall) the collider may not experience a collision.
Basic Properties
Collision Distance
How far from the center of the parent should a collision be looked for?
Advanced Properties
Stay in XZ?
Never affect the global Y position of the parent? (Needed with 'Walk')
Events
Collided
Fires when the parent object collides with a collision shell.