Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="geom"></param>
        /// <param name="bounds"></param>
        public TreeLoader2D(PagedGeometry geom, TBounds bounds)
        {
            //Calculate grid size
            mGeom     = geom;
            mPageSize = mGeom.PageSize;

            //Reset height function
            mHeightFunction         = null;
            mHeightFunctionUserData = null;

            //Make sure the bounds are aligned with PagedGeometry's grid, so the TreeLoader's grid tiles will have a 1:1 relationship
            mActualBounds = bounds;
            mGridBounds   = bounds;

            mGridBounds.Left   = (float)(mPageSize * System.Math.Floor((mGridBounds.Left - mGeom.Bounds.Left) / mPageSize) + mGeom.Bounds.Left);
            mGridBounds.Top    = (float)(mPageSize * System.Math.Floor((mGridBounds.Top - mGeom.Bounds.Top) / mPageSize) + mGeom.Bounds.Top);
            mGridBounds.Right  = (float)(mPageSize * System.Math.Ceiling((mGridBounds.Right - mGeom.Bounds.Left) / mPageSize) + mGeom.Bounds.Left);
            mGridBounds.Bottom = (float)(mPageSize * System.Math.Ceiling((mGridBounds.Bottom - mGeom.Bounds.Top) / mPageSize) + mGeom.Bounds.Top);

            //Calculate page grid size
            mPageGridX = (int)(System.Math.Ceiling(mGridBounds.Width / mPageSize) + 1);
            mPageGridZ = (int)(System.Math.Ceiling(mGridBounds.Height / mPageSize) + 1);

            //Reset color map
            mColorMap       = null;
            mColorMapFilter = MapFilter.None;

            //Default scale range
            mMaximumScale = 2.0f;
            mMinimumScale = 0.0f;
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="mainGeom"></param>
 public GeometryPageManager(PagedGeometry mainGeom)
 {
     mMainGeom     = mainGeom;
     mCacheTimer   = 0;
     mScrollBuffer = null;
     mGeomGrid     = null;
     SetCacheSpeed(200, 2000);
     Transition  = 0;
     mGridBounds = new TBounds(0, 0, 0, 0);
 }
Пример #3
0
 /// <summary>
 /// Creates a new GrassLoader object.
 /// </summary>
 /// <param name="geom">The PagedGeometry object that this GrassLoader will be assigned to.</param>
 public GrassLoader(PagedGeometry geom)
 {
     mGeom = geom;
     mHeightFunctionUserData = null;
     mWindDir       = Vector3.UnitX;
     mDensityFactor = 1.0f;
     mRenderQueue   = RenderQueueGroupID.Six;
     mWindTimer     = new MogreLib.Core.Timer();//mWindTimer = Root.Singleton.Timer;
     mWindTimer.Reset();
     mLastTime = 0;
 }
Пример #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="geom"></param>
        public override void Init(PagedGeometry geom)
        {
            //Save pointers to PagedGeometry object
            mSceneMgr = geom.SceneManager;
            mGeom     = geom;

            //Init. variables
            ImpostorBlendMode = ImpostorBlendMode.AlphaReject;

            if (++mSelfInstances == 1)
            {
                //Set up a single instance of a scene node which will be used when rendering impostor textures
                mGeom.SceneNode.CreateChildSceneNode("ImpostorPage.RenderNode");
            }
        }
Пример #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="geom"></param>
        public override void Init(PagedGeometry geom)
        {
            mSceneMgr = geom.SceneManager;
            mBatch    = new BatchedGeometry(mSceneMgr, geom.SceneNode);

            mFadeEnabled = false;
            RenderSystemCapabilities caps = Root.Singleton.RenderSystem.Capabilities;

            if (caps.HasCapability(Capabilities.VertexPrograms))
            {
                mShadersSupported = true;
            }
            else
            {
                mShadersSupported = false;
            }

            ++mRefCount;
        }
Пример #6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="geom"></param>
 /// <param name="ldr"></param>
 internal GrassLayer(PagedGeometry geom, GrassLoader ldr)
 {
     mGeom              = geom;
     mParent            = ldr;
     mDensity           = 1.0f;
     mMinWidth          = 1.0f;
     mMinHeight         = 1.0f;
     mMaxWidth          = 1.0f;
     mMaxHeight         = 1.0f;
     mRenderTechnique   = GrassTechnique.Quad;
     mFadeTechnique     = FadeTechnique.Alpha;
     mAnimMag           = 1.0f;
     mAnimSpeed         = 1.0f;
     mAnimFreq          = 1.0f;
     mWaveCount         = 0.0f;
     mAnimate           = false;
     mShaderNeedsUpdate = true;
     mDensityMap        = null;
     mDensityMapFilter  = MapFilter.Bilinear;
     mColorMap          = null;
     mColorMapFilter    = MapFilter.Bilinear;
 }
Пример #7
0
 /// <summary>
 /// Prepare a geometry page for use.
 /// </summary>
 /// <param name="geom"></param>
 public abstract void Init(PagedGeometry geom);
Пример #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="geom"></param>
 public override void Init(PagedGeometry geom)
 {
     mSceneMgr = geom.SceneManager;
     mRootNode = geom.SceneNode;
 }