package com.as3dmod.modifiers {
import com.as3dmod.IModifier;
import com.as3dmod.core.Matrix4;
import com.as3dmod.core.MeshProxy;
import com.as3dmod.core.Modifier;
import com.as3dmod.core.Vector3;
import com.as3dmod.core.VertexProxy;
/**
* Wheel modifier. Use it with vehicle models for wheels.
*
*
The usual problem with a 3d wheel in a vahicle is that if it is
* supposed to turn (steer) and roll in the same time. So, this code:
*
*
* wheel.rotationY = 10; // Steer 10deg to the left
* wheel.rotationZ +- 5; // Roll with a speed of 5
*
* This will make the wheel roll incorectly.
A usual way to solve this problem is to put the wheel in another DisplayObject3D/Mesh,
* turn the parent and roll the child, like that:
*
* steer.rotationY = 10; // Steer 10deg to the left
* steer.wheel.rotationZ +- 5; // Roll with a speed of 5
*
* That will make the wheel behave correctly. But it can be uncomfortanble to apply, especially
* to imported complex Collada models.
The Wheel modifier elegantly solves this problem by doind the proper math in order to steer and roll * a single mesh at the same time. The only thing you need to do is to specify a steer vector and * roll vector - usually it will be 2 of the cardinal axes. The default value is: *
It should work with most car models imported from 3D editors as this is the natural position of a wheel.
* Please note, that Papervision primitive cylinder, which may also be used as wheel, will require different axes
* (Y for roll and Z or X for steer).