Exemple #1
0
		protected override bool OnInitLibrary( bool allowHardwareAcceleration, bool editor )
		{
			instance = this;

			NativeLibraryManager.PreLoadLibrary( "ode" );

			//int maxIterationCount = 20;
			//int hashSpaceMinLevel = 2;// 2^2 = 4 minimum cell size
			//int hashSpaceMaxLevel = 8;// 2^8 = 256 maximum cell size

			if( VirtualFile.Exists( "Base/Constants/PhysicsSystem.config" ) )
			{
				TextBlock block = TextBlockUtils.LoadFromVirtualFile( "Base/Constants/PhysicsSystem.config" );
				if( block != null )
				{
					TextBlock odeBlock = block.FindChild( "odeSpecific" );
					if( odeBlock != null )
					{
						if( odeBlock.IsAttributeExist( "maxIterationCount" ) )
							defaultMaxIterationCount = int.Parse( odeBlock.GetAttribute( "maxIterationCount" ) );
						if( odeBlock.IsAttributeExist( "hashSpaceMinLevel" ) )
							hashSpaceMinLevel = int.Parse( odeBlock.GetAttribute( "hashSpaceMinLevel" ) );
						if( odeBlock.IsAttributeExist( "hashSpaceMaxLevel" ) )
							hashSpaceMaxLevel = int.Parse( odeBlock.GetAttribute( "hashSpaceMaxLevel" ) );
					}
				}
			}

			Ode.dInitODE2( 0 );

			return true;
		}
Exemple #2
0
        protected override bool OnInitLibrary(bool allowHardwareAcceleration, bool editor)
        {
            instance = this;

            NativeLibraryManager.PreLoadLibrary("ode");

            //int maxIterationCount = 20;
            //int hashSpaceMinLevel = 2;// 2^2 = 4 minimum cell size
            //int hashSpaceMaxLevel = 8;// 2^8 = 256 maximum cell size

            if (VirtualFile.Exists("Base/Constants/PhysicsSystem.config"))
            {
                TextBlock block = TextBlockUtils.LoadFromVirtualFile("Base/Constants/PhysicsSystem.config");
                if (block != null)
                {
                    TextBlock odeBlock = block.FindChild("odeSpecific");
                    if (odeBlock != null)
                    {
                        if (odeBlock.IsAttributeExist("maxIterationCount"))
                        {
                            defaultMaxIterationCount = int.Parse(odeBlock.GetAttribute("maxIterationCount"));
                        }
                        if (odeBlock.IsAttributeExist("hashSpaceMinLevel"))
                        {
                            hashSpaceMinLevel = int.Parse(odeBlock.GetAttribute("hashSpaceMinLevel"));
                        }
                        if (odeBlock.IsAttributeExist("hashSpaceMaxLevel"))
                        {
                            hashSpaceMaxLevel = int.Parse(odeBlock.GetAttribute("hashSpaceMaxLevel"));
                        }
                    }
                }
            }

            Ode.dInitODE2(0);

            return(true);
        }
Exemple #3
0
		protected override void OnShutdownLibrary()
		{
			Ode.dCloseODE();

			instance = null;
		}
Exemple #4
0
        protected override void OnShutdownLibrary()
        {
            Ode.dCloseODE();

            instance = null;
        }