Quote:
Originally Posted by jrrTolkien
Well, it basically changes the first object's x-y axis to that of the second object. Hence, if the second moves, the first moves according to the second's axis. The same thing with the turning and rolling. The same can be done temporarialy with the "as seen by" in the drop-down menu when you click "more" on a line of code.
-Jrr
|
I don't believe it does anything to the first objects axis. it just changes the object in the same way as the vehicle moves, turns or rolls within the world. The easiest way to think about the vehicle property is to think about you and a car, if I set your vehicle to the car then where ever the car goes so will you. The difference is that, in Alice, you do not have to be in the car. You can be anywhere in the world and if the car move so will you.
As one example, every sub object has its object set to its parent. If you move a leg away from its parent, the leg will still move whenever the parent object does even though it is not "attached" to the body any more.
A more complex example would be a skateboard movie. In this case you want the camera to follow the skateboarder most of the time, but when the skateboarder is doing something like a spin this arrangement does not look right (the skateboarder seems to stay in one place while the world spins around her.) So before the spin you would set the camera's vehicle to the world and after you would set it back to the skateboarder.
One pitfall can be illustrated with another skateboard example, that of switching vehicles between two objects. Your program must ensure that the vehicle is never set such that two or more objects form a "loop." For instances most of the time you might want the skateboarder's vehicle set to the skateboarder, but when doing some tricks it is easier to have the skateboarder to be the vehicle for the skateboard (like when doing a flipkick.)
In this case you start out with:
Skateboarder's vehicle = Skateboard.
Skateboard's vehicle = World
and what you want to end up with is:
Skateboarder's vehicle = World.
Skateboard's vehicle = Skateboarder
Here the order matters. if you try setting the Skateboard's vehicle to the Skateboarder before changing the Skateboarder's vehicle to something other than the Skateboard, the movie will crash!
On last point, if the Skateboarder's vehicle is set to the Skateboard, the Skateboarder can move around any way you want him to while he continues to "follow" the Skateboard. So, jumping over and object while the board goes under it just becomes a matter of causing the skater to move up and down while the board (the skater's vehicle) continues forward.
Mark