UpdateMesh() public méthode

public UpdateMesh ( float timeSinceLastFrame ) : void
timeSinceLastFrame float
Résultat void
Exemple #1
0
        }         // end ReadUserModeInputs()

        // Process Rapid Inputs (adjust Demo settings)
        //protected override bool RapidUpdateCustom() {
        protected bool RapidUpdateCustom()
        {
            // Update Animations and Water Mesh
            AnimateHead(inputTimer);          // animate the Ogre Head
            ProcessRain();                    // Process the Rain
            waterMesh.UpdateMesh(inputTimer); // Update the Water Mesh (i.e. waves)

            // Press Left-SHIFT to speed up rate of change for adjust demo parameters
            changeSpeed = (int)(inputTimer * 1000);             // round to nearest millisecond, use bit shift for speed
            if (input.IsKeyPressed(KeyCodes.LeftShift))
            {
                changeSpeed *= 10;
            }                                                                              // multiply by 8

            // Adjust Demo settings (mostly WaterMesh attributes) - Head height, and Water Properties
            if (AdjustRange(ref headDepth, KeyCodes.J, KeyCodes.U, 0, 10, 0.0005f))
            {
                UpdateInfoHeadDepth();
            }
            if (AdjustRange(ref waterMesh.PARAM_C, KeyCodes.D2, KeyCodes.D1, 0, 10, 0.0001f))
            {
                UpdateInfoParamC();
            }
            if (AdjustRange(ref waterMesh.PARAM_D, KeyCodes.D4, KeyCodes.D3, 0.1f, 10, 0.0001f))
            {
                UpdateInfoParamD();
            }
            if (AdjustRange(ref waterMesh.PARAM_U, KeyCodes.D6, KeyCodes.D5, -2f, 10, 0.0001f))
            {
                UpdateInfoParamU();
            }
            if (AdjustRange(ref waterMesh.PARAM_T, KeyCodes.D8, KeyCodes.D7, 0, 10, 0.0001f))
            {
                UpdateInfoParamT();
            }
            if (AdjustRange(ref headSpeed, KeyCodes.D0, KeyCodes.D9, 0, 3, 0.0001f))
            {
                UpdateInfoHeadSpeed();
            }
            return(true);
        }