Push() public méthode

Emulates an object pushing water out of its way (usually down)
public Push ( float fx, float fy, float depth, float height, float speed, bool absolute ) : void
fx float
fy float
depth float
height float
speed float
absolute bool
Résultat void
Exemple #1
0
        public void AnimateHead(float timeSinceLastFrame)
        {
            //animState.AddTime(timeSinceLastFrame);

            for (int i = 0; i < 4; i++)
            {
                sines[i] += adds[i] * headSpeed * timeSinceLastFrame;
            }
            float tx = (float)((Math.Sin(sines[0]) + Math.Sin(sines[1])) / 4 + 0.5) * (float)(CMPLX - 2) + 1;
            float ty = (float)((Math.Sin(sines[2]) + Math.Sin(sines[3])) / 4 + 0.5) * (float)(CMPLX - 2) + 1;

            // Push water down beneath the Ogre Head
            waterMesh.Push(tx, ty, headDepth, 150f, headSpeed, false);

            float step = PLANE_SIZE / CMPLX;

            headNode.ResetToInitialState();

            Vector3    newPos       = new Vector3(step * tx, 80f - 40f * headDepth, step * ty);
            Vector3    diffPos      = newPos - oldPos;
            Quaternion headRotation = Vector3.UnitZ.GetRotationTo(diffPos);

            oldPos = newPos;
            headNode.Scale(new Vector3(3.0f, 3.0f, 3.0f));
            headNode.Translate(newPos);
            headNode.Rotate(headRotation);
        }