/// <summary>
        ///
        /// </summary>
        /// <param name="entity"></param>
        public static void Regenerate(Entity entity)
        {
            ImpostorTexture tex = ImpostorTexture.GetTexture(null, entity);

            if (tex != null)
            {
                tex.Regenerate();
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="group"></param>
        /// <param name="entity"></param>
        protected ImpostorBatch(ImpostorPage group, Entity entity)
        {
            //Render impostor texture for this entity
            mTex = ImpostorTexture.GetTexture(group, entity);

            //Create billboard set
            mBBSet = new StaticBillboardSet(group.SceneManager, group.PagedGeometry.SceneNode);
            mBBSet.SetTextureStacksAndSlices(ImpostorTexture.ImpostorPitchAngles, ImpostorTexture.ImpostorYawAngles);

            BillboardOrigin = ImpostorPage.ImpostorPivot;
            //Default the angle to 0 degrees
            mPitchIndex = -1;
            mYawIndex = -1;
            SetAngle(0.0f, 0.0f);
        }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="group"></param>
        /// <param name="entity"></param>
        /// <returns></returns>
        public static ImpostorTexture GetTexture(ImpostorPage group, Entity entity)
        {
            //Search for an existing impostor texture for the given entity
            string          entityKey = ImpostorBatch.GenerateEntityKey(entity);
            ImpostorTexture texture   = null;

            if (!mSelfList.TryGetValue(entityKey, out texture))
            {
                if (group != null)
                {
                    texture = new ImpostorTexture(group, entity);
                }
            }
            return(texture);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="group"></param>
        /// <param name="entity"></param>
        protected ImpostorBatch(ImpostorPage group, Entity entity)
        {
            //Render impostor texture for this entity
            mTex = ImpostorTexture.GetTexture(group, entity);

            //Create billboard set
            mBBSet = new StaticBillboardSet(group.SceneManager, group.PagedGeometry.SceneNode);
            mBBSet.SetTextureStacksAndSlices(ImpostorTexture.ImpostorPitchAngles, ImpostorTexture.ImpostorYawAngles);

            BillboardOrigin = ImpostorPage.ImpostorPivot;
            //Default the angle to 0 degrees
            mPitchIndex = -1;
            mYawIndex   = -1;
            SetAngle(0.0f, 0.0f);
        }
Beispiel #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="texture"></param>
        public static void RemoveTexture(ImpostorTexture texture)
        {
            string strToRemove = string.Empty;

            //Search for an existing impostor texture, in case it was already deleted
            if (mSelfList.ContainsValue(texture))
            {
                foreach (KeyValuePair <string, ImpostorTexture> kp in mSelfList)
                {
                    if (kp.Value == texture)
                    {
                        strToRemove = kp.Key;
                        break;
                    }
                }
            }
            if (strToRemove != string.Empty)
            {
                mSelfList.Remove(strToRemove);
            }
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="texture"></param>
 public static void RemoveTexture(ImpostorTexture texture)
 {
     string strToRemove = string.Empty;
     //Search for an existing impostor texture, in case it was already deleted
     if (mSelfList.ContainsValue(texture))
     {
         foreach (KeyValuePair<string, ImpostorTexture> kp in mSelfList)
         {
             if (kp.Value == texture)
             {
                 strToRemove = kp.Key;
                 break;
             }
         }
     }
     if (strToRemove != string.Empty)
         mSelfList.Remove(strToRemove);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="group"></param>
 /// <param name="entity"></param>
 /// <returns></returns>
 public static ImpostorTexture GetTexture(ImpostorPage group, Entity entity)
 {
     //Search for an existing impostor texture for the given entity
     string entityKey = ImpostorBatch.GenerateEntityKey(entity);
     ImpostorTexture texture = null;
     if (!mSelfList.TryGetValue(entityKey, out texture))
     {
         if (group != null)
         {
             texture = new ImpostorTexture(group, entity);
         }
     }
     return texture;
 }
 /// <summary>
 ///
 /// </summary>
 public static void RegenerateAll()
 {
     ImpostorTexture.RegenerateAll();
 }