示例#1
0
        void HitScenes(int x, int y)
        {
            HitEntityId = 0;
            if (Camera.Current == null || Camera.Current.HostEntity == null)
            {
                return;
            }
            float u = 0, v = 0;
            var   mouseDir = Camera.Unproject(x, y);

            HitEntityId   = (uint)Env.Renderer.RayToUV(Camera.Current.Position, mouseDir, ref u, ref v);
            HitEntityUV.x = u;
            HitEntityUV.y = v;
        }
示例#2
0
        public static void HitScenes(int x, int y)
        {
            if (!Global.gEnv.pGameFramework.GetILevelSystem().IsLevelLoaded())
            {
                return;
            }

            HitEntityId = 0;
            float u = 0, v = 0;
            var   mouseDir = Camera.Unproject(x, y);

            HitEntityId    = (uint)Global.gEnv.pRenderer.RayToUV(Camera.Position, mouseDir, ref u, ref v);
            _hitEntityUV.x = u;
            _hitEntityUV.y = v;
        }
示例#3
0
        public static void HitScenes(int x, int y)
        {
            if (!Global.gEnv.pGameFramework.GetILevelSystem().IsLevelLoaded())
            {
                return;
            }

            HitEntityId = 0;
            var        mouseDir = Camera.Unproject(x, y);
            RaycastHit hit;

            if (Physics.Raycast(Camera.Position, mouseDir, 100, out hit))
            {
                HitEntityId  = hit.EntityId;
                _hitEntityUV = hit.UvPoint;
            }
            else
            {
                _hitEntityUV.x = 0;
                _hitEntityUV.y = 0;
            }
        }