亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dxmutmisc.cs

?? VC中使用C#作為腳本引擎編程
?? CS
?? 第 1 頁 / 共 5 頁
字號:
                if ( (string.Compare(ct.Source, filename, true) == 0) &&
                    ct.Width == w &&
                    ct.Height == h &&
                    ct.Depth == d &&
                    ct.MipLevels == mip &&
                    ct.Usage == usage &&
                    ct.Format == fmt &&
                    ct.Pool == pool &&
                    ct.Type == ResourceType.VolumeTexture)
                {
                    // A match was found, return that
                    return textureCache[ct] as VolumeTexture;
                }
            }

            // No matching entry, load the resource and add it to the cache
            VolumeTexture t = TextureLoader.FromVolumeFile(device, filename, w, h, d, mip, usage, fmt, pool, filter, mipfilter, colorkey);
            CachedTexture entry = new CachedTexture();
            entry.Source = filename;
            entry.Width = w;
            entry.Height = h;
            entry.Depth = d;
            entry.MipLevels = mip;
            entry.Usage = usage;
            entry.Format = fmt;
            entry.Pool = pool;
            entry.Type = ResourceType.VolumeTexture;

            textureCache.Add(entry, t);

            return t;
        }

        /// <summary>Create an effect from a file</summary>
        public Effect CreateEffectFromFile(Device device, string filename, Macro[] defines, Include includeFile, ShaderFlags flags, EffectPool effectPool, out string errors)
        {
            // No errors at first!
            errors = string.Empty;
            // Search the cache first
            foreach(CachedEffect ce in effectCache.Keys)
            {
                if ( (string.Compare(ce.Source, filename, true) == 0) &&
                    ce.Flags == flags)
                {
                    // A match was found, return that
                    return effectCache[ce] as Effect;
                }
            }

            // Nothing found in the cache
            Effect e = Effect.FromFile(device, filename, defines, includeFile, null, flags, effectPool, out errors);
            // Add this to the cache
            CachedEffect entry = new CachedEffect();
            entry.Flags = flags;
            entry.Source = filename;
            effectCache.Add(entry, e);

            // Return the new effect
            return e;
        }

        /// <summary>Create an effect from a file</summary>
        public Effect CreateEffectFromFile(Device device, string filename, Macro[] defines, Include includeFile, ShaderFlags flags, EffectPool effectPool)
        { 
            string temp; return CreateEffectFromFile(device, filename, defines, includeFile, flags, effectPool, out temp);
        }
        /// <summary>Create a font object</summary>
        public Font CreateFont(Device device, int height, int width, FontWeight weight, int mip, bool italic,
            CharacterSet charSet, Precision outputPrecision, FontQuality quality, PitchAndFamily pandf, string fontName)
        {
            // Create the font description
            FontDescription desc = new FontDescription();
            desc.Height = height;
            desc.Width = width;
            desc.Weight = weight;
            desc.MipLevels = mip;
            desc.IsItalic = italic;
            desc.CharSet = charSet;
            desc.OutputPrecision = outputPrecision;
            desc.Quality = quality;
            desc.PitchAndFamily = pandf;
            desc.FaceName = fontName;

            // return the font
            return CreateFont(device, desc);
        }
        /// <summary>Create a font object</summary>
        public Font CreateFont(Device device, FontDescription desc)
        {
            // Search the cache first
            foreach(FontDescription fd in fontCache.Keys)
            {
                if ( (string.Compare(fd.FaceName, desc.FaceName, true) == 0) &&
                    fd.CharSet == desc.CharSet &&
                    fd.Height == desc.Height &&
                    fd.IsItalic == desc.IsItalic &&
                    fd.MipLevels == desc.MipLevels &&
                    fd.OutputPrecision == desc.OutputPrecision &&
                    fd.PitchAndFamily == desc.PitchAndFamily &&
                    fd.Quality == desc.Quality &&
                    fd.Weight == desc.Weight &&
                    fd.Width == desc.Width)
                {
                    // A match was found, return that
                    return fontCache[fd] as Font;
                }
            }

            // Couldn't find anything in the cache, create one
            Font f = new Font(device, desc);
            // Create a new entry
            fontCache.Add(desc, f);

            // return the new font
            return f;
        }

        #endregion

        #region Device event callbacks
        /// <summary>
        /// Called when the device is created
        /// </summary>
        public void OnCreateDevice(Device device) {} // Nothing to do on device create
        /// <summary>
        /// Called when the device is reset
        /// </summary>
        public void OnResetDevice(Device device)
        {
            // Call OnResetDevice on all effect and font objects
            foreach(Font f in fontCache.Values)
                f.OnResetDevice();
            foreach(Effect e in effectCache.Values)
                e.OnResetDevice();
        }
        /// <summary>
        /// Clear any resources that need to be lost
        /// </summary>
        public void OnLostDevice()
        {
            foreach(Font f in fontCache.Values)
                f.OnLostDevice();
            foreach(Effect e in effectCache.Values)
                e.OnLostDevice();

            // Search the texture cache 
            foreach(CachedTexture ct in textureCache.Keys)
            {
                if (ct.Pool == Pool.Default)
                {
                    // A match was found, get rid of it
                    switch(ct.Type)
                    {
                        case ResourceType.Textures:
                            (textureCache[ct] as Texture).Dispose(); break;
                        case ResourceType.CubeTexture:
                            (textureCache[ct] as CubeTexture).Dispose();break;
                        case ResourceType.VolumeTexture:
                            (textureCache[ct] as VolumeTexture).Dispose();break;
                    }
                }
            }
        }
        /// <summary>
        /// Destroy any resources and clear the caches
        /// </summary>
        public void OnDestroyDevice()
        {
            // Cleanup the fonts
            foreach(Font f in fontCache.Values)
                f.Dispose();

            // Cleanup the effects
            foreach(Effect e in effectCache.Values)
                e.Dispose();

            // Dispose of any items in the caches
            foreach(BaseTexture texture in textureCache.Values)
            {
                if (texture != null)
                    texture.Dispose();
            }

            // Clear all of the caches
            textureCache.Clear();
            fontCache.Clear();
            effectCache.Clear();
        }

        #endregion
    }
    #endregion

    #region Arcball
    /// <summary>
    /// Class holds arcball data
    /// </summary>
    public class ArcBall
    {
        #region Instance Data
        protected Matrix rotation; // Matrix for arc ball's orientation
        protected Matrix translation; // Matrix for arc ball's position
        protected Matrix translationDelta; // Matrix for arc ball's position

        protected int width; // arc ball's window width
        protected int height; // arc ball's window height
        protected Vector2 center;  // center of arc ball 
        protected float radius; // arc ball's radius in screen coords
        protected float radiusTranslation; // arc ball's radius for translating the target

        protected Quaternion downQuat; // Quaternion before button down
        protected Quaternion nowQuat; // Composite quaternion for current drag
        protected bool isDragging; // Whether user is dragging arc ball

        protected System.Drawing.Point lastMousePosition; // position of last mouse point
        protected Vector3 downPt; // starting point of rotation arc
        protected Vector3 currentPt; // current point of rotation arc
        #endregion

        #region Simple Properties
        /// <summary>Gets the rotation matrix</summary>
        public Matrix RotationMatrix { get { return rotation = Matrix.RotationQuaternion(nowQuat); } }
        /// <summary>Gets the translation matrix</summary>
        public Matrix TranslationMatrix { get { return translation; } }
        /// <summary>Gets the translation delta matrix</summary>
        public Matrix TranslationDeltaMatrix { get { return translationDelta; } }
        /// <summary>Gets the dragging state</summary>
        public bool IsBeingDragged { get { return isDragging; } }
        /// <summary>Gets or sets the current quaternion</summary>
        public Quaternion CurrentQuaternion { get { return nowQuat; } set { nowQuat = value; } }
        #endregion

        // Class methods

        /// <summary>
        /// Create new instance of the arcball class
        /// </summary>
        public ArcBall()
        {
            Reset();
            downPt = Vector3.Empty;
            currentPt = Vector3.Empty;

            System.Windows.Forms.Form active = System.Windows.Forms.Form.ActiveForm;
            if (active != null)
            {
                System.Drawing.Rectangle rect = active.ClientRectangle;
                SetWindow(rect.Width, rect.Height);
            }
        }

        /// <summary>
        /// Resets the arcball
        /// </summary>
        public void Reset()
        {
            downQuat = Quaternion.Identity;
            nowQuat = Quaternion.Identity;
            rotation = Matrix.Identity;
            translation = Matrix.Identity;
            translationDelta = Matrix.Identity;
            isDragging = false;
            radius = 1.0f;
            radiusTranslation = 1.0f;
        }

        /// <summary>
        /// Convert a screen point to a vector
        /// </summary>
        public Vector3 ScreenToVector(float screenPointX, float screenPointY)
        {
            float x = -(screenPointX - width / 2.0f) / (radius * width/2.0f);
            float y = (screenPointY - height / 2.0f) / (radius * height/2.0f);
            float z = 0.0f;
            float mag = (x*x) + (y*y);

            if (mag > 1.0f)
            {
                float scale = 1.0f / (float)Math.Sqrt(mag);
                x *= scale;
                y *= scale;
            }
            else
                z = (float)Math.Sqrt(1.0f - mag);

            return new Vector3(x,y,z);
        }

        /// <summary>
        /// Set window paramters
        /// </summary>
        public void SetWindow(int w, int h, float r)
        {
            width = w; height = h; radius = r;
            center = new Vector2(w / 2.0f, h / 2.0f);
        }
        public void SetWindow(int w, int h)
        {
            SetWindow(w,h,0.9f); // default radius
        }

        /// <summary>
        /// Computes a quaternion from ball points
        /// </summary>
        public static Quaternion QuaternionFromBallPoints(Vector3 from, Vector3 to)
        {
            float dot = Vector3.Dot(from, to);
            Vector3 part = Vector3.Cross(from, to);
            return new Quaternion(part.X, part.Y, part.Z, dot);
        }

        /// <summary>
        /// Begin the arcball 'dragging'
        /// </summary>
        public void OnBegin(int x, int y)
        {
            isDragging = true;
            downQuat = nowQuat;
            downPt = ScreenToVector((float)x, (float)y);
        }
        /// <summary>
        /// The arcball is 'moving'

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品自拍三区| 秋霞av亚洲一区二区三| 日韩免费看的电影| 欧美丰满一区二区免费视频| 日本韩国一区二区| 在线观看免费一区| 欧美日韩一区二区三区四区 | 欧美成人官网二区| 欧美精品久久久久久久多人混战| 在线电影院国产精品| 日韩欧美在线综合网| 欧美大黄免费观看| 久久久www免费人成精品| 国产欧美精品在线观看| 国产精品美女视频| 亚洲免费观看高清在线观看| 一二三区精品视频| 日韩av在线发布| 激情av综合网| jlzzjlzz欧美大全| 精品视频1区2区| 久久综合久久久久88| 国产精品美女久久久久久久网站| 亚洲美女偷拍久久| 蜜臀av一区二区在线免费观看| 国产一区二区三区久久久| 处破女av一区二区| 欧美日韩精品一区视频| 精品少妇一区二区三区在线视频 | **性色生活片久久毛片| 一区二区久久久| 久久精品99国产精品| 成人动漫中文字幕| 6080午夜不卡| 亚洲欧洲综合另类| 久久www免费人成看片高清| eeuss影院一区二区三区| 这里只有精品电影| 国产精品福利影院| 久久精品国产一区二区三区免费看| 成人免费看的视频| 5566中文字幕一区二区电影| 国产精品久久久久久久裸模| 视频一区二区不卡| 91在线视频播放地址| 欧美tickling网站挠脚心| 伊人夜夜躁av伊人久久| 国产精品99久久久久久有的能看| 欧美日韩亚州综合| 日韩一区欧美小说| 国产精品一区二区久久精品爱涩| 欧美男人的天堂一二区| 亚洲日本在线a| 国产精品一区专区| 精品国产麻豆免费人成网站| 婷婷开心激情综合| 在线观看视频一区二区| 成人欧美一区二区三区1314| 国产成人av一区二区三区在线 | 日韩精品一区二区三区视频| 亚洲午夜免费电影| 99久久久久久99| 国产亚洲精品aa午夜观看| 男男gaygay亚洲| 欧美日韩国产一级二级| 尤物在线观看一区| 色婷婷精品久久二区二区蜜臀av| 国产精品麻豆99久久久久久| 国产福利精品导航| 精品国产乱码久久久久久1区2区| 日韩精品三区四区| 欧美精品一卡两卡| 午夜激情综合网| 欧美猛男gaygay网站| 亚洲午夜免费福利视频| 欧美日韩另类国产亚洲欧美一级| 亚洲精品成人a在线观看| 色偷偷88欧美精品久久久| 国产精品久久久久影院亚瑟 | 日韩高清不卡在线| 欧美精品在线视频| 青娱乐精品在线视频| 欧美mv日韩mv国产网站| 韩国一区二区三区| 国产日本亚洲高清| 成人精品视频.| 亚洲综合小说图片| 4438x成人网最大色成网站| 免费观看日韩电影| 国产蜜臀97一区二区三区 | 欧美人妖巨大在线| 日韩精品一区第一页| 欧美久久久久久久久久| 国精产品一区一区三区mba桃花| 久久久一区二区| 91小视频在线免费看| 一区二区三区在线视频观看58 | 26uuu久久综合| 国产精品一卡二卡在线观看| 国产精品毛片久久久久久 | 日韩精品成人一区二区在线| 精品久久久久久亚洲综合网| 成人免费视频caoporn| 亚洲在线观看免费视频| 欧美精品一区二区久久婷婷| 91丝袜国产在线播放| 视频一区二区三区在线| 国产欧美一区二区精品婷婷| 欧美性极品少妇| 国产乱色国产精品免费视频| 伊人开心综合网| 久久午夜色播影院免费高清| 在线一区二区三区做爰视频网站| 黄色日韩网站视频| 亚洲精品乱码久久久久| 久久精品夜夜夜夜久久| 欧美精品777| av午夜精品一区二区三区| 久久精品国产99国产精品| 夜夜操天天操亚洲| 欧美经典三级视频一区二区三区| 欧美日韩成人激情| 91视频在线观看| 国产伦精品一区二区三区视频青涩| 亚洲一区二区影院| 国产精品第一页第二页第三页| 日韩欧美三级在线| 69av一区二区三区| 精品视频在线免费看| caoporm超碰国产精品| 国产剧情一区在线| 精品在线你懂的| 日本美女一区二区三区| 一区二区三区精品视频在线| 中文字幕在线播放不卡一区| 国产午夜精品福利| 精品噜噜噜噜久久久久久久久试看| 欧美性大战xxxxx久久久| 成人黄色网址在线观看| 国产一区二区三区黄视频 | 久久久久久久久99精品| 这里只有精品免费| 欧美精品久久久久久久久老牛影院| 色婷婷久久综合| 在线亚洲人成电影网站色www| 99久久国产综合色|国产精品| 国产精品99久| 国产精品一二一区| 国产一区二区三区免费观看| 国产一区视频在线看| 精油按摩中文字幕久久| 国产一区二区看久久| 国产精品一线二线三线| 国产一区二区久久| 成人黄色av网站在线| 不卡的电影网站| 99久久精品一区| 91福利小视频| 欧美三级电影网| 欧美一区二区在线免费观看| 日韩午夜av电影| 久久精品在线免费观看| 亚洲国产精品激情在线观看| 成人免费在线视频| 亚洲午夜羞羞片| 免费成人av资源网| 国产福利一区二区三区视频 | 久久亚洲免费视频| 国产亚洲欧美日韩俺去了| 中文字幕一区二区三区在线播放 | 久久综合九色综合97_久久久| 精品国产乱码久久久久久蜜臀| 久久中文娱乐网| 亚洲欧洲三级电影| 香港成人在线视频| 蜜乳av一区二区| 成人爱爱电影网址| 欧美在线不卡一区| 欧美精品一区二区三区蜜桃视频 | 欧美一区二区三区视频免费播放| 日韩美女视频在线| 国产精品少妇自拍| 亚洲综合色丁香婷婷六月图片| 日韩精品一卡二卡三卡四卡无卡| 国产一区二区久久| 91久久精品网| 久久久国产一区二区三区四区小说| 中文字幕一区二区三区四区不卡| 亚洲成av人影院| 国产成人高清在线| 欧美精品九九99久久| 国产精品嫩草影院av蜜臀| 视频一区欧美日韩| av中文字幕一区| 久久伊99综合婷婷久久伊| 亚洲欧美电影一区二区| 狠狠色丁香久久婷婷综| 欧美在线影院一区二区| 日本一区二区三区在线观看| 香蕉影视欧美成人|