zoukankan      html  css  js  c++  java
  • xna 触控操作 备忘

     private void HandleInput()
            {
                while (TouchPanel.IsGestureAvailable)
                {
                    GestureSample gestureSample = TouchPanel.ReadGesture();
                    switch (gestureSample.GestureType)
                    {
                        case GestureType.FreeDrag:
                            rotationXAmount += gestureSample.Delta.X;
                            rotationYAmount -= gestureSample.Delta.Y;
                            break;
    
                        case GestureType.Pinch:
                            float gestureValue = 0;
                            float minFOV = 60;
                            float maxFOV = 30;
                            float gestureLengthToZoomScale = 10;
    
                            Vector2 gestureDiff = gestureSample.Position - gestureSample.Position2;
                            gestureValue = gestureDiff.Length() / gestureLengthToZoomScale;
    
                            if (null != prevLength) // Skip the first pinch event
                                cameraFOV -= gestureValue - prevLength.Value;
    
                            cameraFOV = MathHelper.Clamp(cameraFOV, maxFOV, minFOV);
    
                            prevLength = gestureValue;
                            break;
    
                        case GestureType.PinchComplete:
                            prevLength = null;
                            break;
                        default:
                            break;
                    }
                }
            }


    windows phone xna 中 通过手势来旋转模型的矩阵.

    蝗虫的大腿--windows phone 平台的坚定支持者!

  • 相关阅读:
    jquery----->helloworld
    hibernate------->第一个程序
    spring使用jdbcTemplate和jdbcdaosupport和namedparameter
    spring--------------->AOP
    spring------>Helloworld
    JS全选
    表单重复提交
    session
    cookies
    83. Remove Duplicates from Sorted List
  • 原文地址:https://www.cnblogs.com/beyoung/p/2676656.html
Copyright © 2011-2022 走看看