BolterLibrary.Navigation.ModelRotation C# (CSharp) Метод

ModelRotation() защищенный Метод

Rotates the character's model, to face the given destination point.
protected ModelRotation ( D3DXVECTOR2 pointB ) : void
pointB D3DXVECTOR2 The destination point
Результат void
        protected void ModelRotation(D3DXVECTOR2 pointB)
        {
            // Get new heading angle, for the given point.
            var newHeading = HeadingToRad(AllEntities.Get2DPos(), pointB);

            // Get new 3D matrix Y axis vector, rotated to the given angle.
            var newVector = GetNewVector(newHeading);

            // Set new heading
            Funcs.SetHeading(EntityType.PCMob, 0, newHeading);

            // Set new rotation vector.
            Funcs.Set3DVector(EntityType.PCMob, Axis.X, 0, newVector.x);
            Funcs.Set3DVector(EntityType.PCMob, Axis.Y, 0, newVector.y);
        }