/// <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);
        }
        /// <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);
        }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        public void Update()
        {
            //If no camera has been set, then return without doing anything
            if (mSceneCam == null)
            {
                return;
            }
            //Calculate time since last update
            long deltaTime = 0, tmp = 0;

            tmp       = mTimer.Milliseconds;
            deltaTime = tmp - mLastTime;
            mLastTime = tmp;

            //Get camera position and speed
            Vector3 camPos   = ConvertToLocal(mSceneCam.DerivedPosition);
            Vector3 camSpeed = Vector3.Zero;

            if (deltaTime == 0)
            {
                camSpeed = new Vector3(0, 0, 0);
            }
            else
            {
                camSpeed = (camPos - mOldCamPos) / deltaTime;
            }

            mOldCamPos = camPos;

            if (mPageLoader != null)
            {
                //Update the PageLoader
                mPageLoader.FrameUpdate();
                //Update all the page managers
                bool enableCache            = true;
                GeometryPageManager prevMgr = null;
                foreach (GeometryPageManager it in mMangerList)
                {
                    GeometryPageManager mgr = it;
                    mgr.Update(deltaTime, camPos, camSpeed, enableCache, prevMgr);
                    prevMgr = mgr;
                }
            }

            //Update misc. subsystems
            StaticBillboardSet.UpdateAll(ConvertToLocal(Camera.DerivedDirection));
        }