-- Trying to get trunk to run from first build
* Collected required dll's into /bin * Moved timer start for great justice * Added some Writes to Console, and a Status field * Added dumb NullPhysicsScene and NullPhysicsActor that kicks in if Physics Plugin not specified * Svn-ignored a shitloadadam
parent
a299fde68c
commit
0587158f92
|
@ -8,7 +8,7 @@
|
||||||
<ProjectGuid>{B063760D-DB8D-4F64-B6FE-335FAD1E650A}</ProjectGuid>
|
<ProjectGuid>{B063760D-DB8D-4F64-B6FE-335FAD1E650A}</ProjectGuid>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>..\..\..\bin\</OutputPath>
|
||||||
<Optimize>False</Optimize>
|
<Optimize>False</Optimize>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<DebugSymbols>True</DebugSymbols>
|
<DebugSymbols>True</DebugSymbols>
|
||||||
|
|
14
src/Main.cs
14
src/Main.cs
|
@ -71,7 +71,7 @@ namespace OpenSim
|
||||||
private PhysicsManager physManager;
|
private PhysicsManager physManager;
|
||||||
private System.Timers.Timer timer1 = new System.Timers.Timer();
|
private System.Timers.Timer timer1 = new System.Timers.Timer();
|
||||||
private string ConfigDll = "SimConfig.dll";
|
private string ConfigDll = "SimConfig.dll";
|
||||||
private string _physicsEngine = "PhysX";
|
private string _physicsEngine = "";
|
||||||
public bool sandbox = false;
|
public bool sandbox = false;
|
||||||
public bool loginserver = false;
|
public bool loginserver = false;
|
||||||
|
|
||||||
|
@ -84,12 +84,17 @@ namespace OpenSim
|
||||||
|
|
||||||
sim = new OpenSim_Main();
|
sim = new OpenSim_Main();
|
||||||
|
|
||||||
|
sim.sandbox = false;
|
||||||
|
sim.loginserver = false;
|
||||||
|
sim._physicsEngine = "";
|
||||||
|
|
||||||
for (int i = 0; i < args.Length; i++)
|
for (int i = 0; i < args.Length; i++)
|
||||||
{
|
{
|
||||||
if(args[i] == "-sandbox")
|
if(args[i] == "-sandbox")
|
||||||
{
|
{
|
||||||
sim.sandbox = true;
|
sim.sandbox = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(args[i] == "-loginserver")
|
if(args[i] == "-loginserver")
|
||||||
{
|
{
|
||||||
sim.loginserver = true;
|
sim.loginserver = true;
|
||||||
|
@ -136,9 +141,6 @@ namespace OpenSim
|
||||||
|
|
||||||
private void Startup() {
|
private void Startup() {
|
||||||
startuptime=DateTime.Now;
|
startuptime=DateTime.Now;
|
||||||
timer1.Enabled = true;
|
|
||||||
timer1.Interval = 100;
|
|
||||||
timer1.Elapsed +=new ElapsedEventHandler( this.Timer1Tick );
|
|
||||||
|
|
||||||
// We check our local database first, then the grid for config options
|
// We check our local database first, then the grid for config options
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - Loading configuration");
|
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - Loading configuration");
|
||||||
|
@ -151,6 +153,10 @@ namespace OpenSim
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("Initialising world");
|
ServerConsole.MainConsole.Instance.WriteLine("Initialising world");
|
||||||
local_world = cfg.LoadWorld();
|
local_world = cfg.LoadWorld();
|
||||||
|
|
||||||
|
timer1.Enabled = true;
|
||||||
|
timer1.Interval = 100;
|
||||||
|
timer1.Elapsed += new ElapsedEventHandler(this.Timer1Tick);
|
||||||
|
|
||||||
this.physManager = new PhysicsSystem.PhysicsManager();
|
this.physManager = new PhysicsSystem.PhysicsManager();
|
||||||
this.physManager.LoadPlugins();
|
this.physManager.LoadPlugins();
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - Starting up messaging system");
|
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - Starting up messaging system");
|
||||||
|
|
|
@ -61,6 +61,7 @@ namespace OpenSim
|
||||||
ConsType = constype;
|
ConsType = constype;
|
||||||
switch(constype) {
|
switch(constype) {
|
||||||
case ConsoleType.Local:
|
case ConsoleType.Local:
|
||||||
|
|
||||||
Console.WriteLine("ServerConsole.cs - creating new local console");
|
Console.WriteLine("ServerConsole.cs - creating new local console");
|
||||||
Console.WriteLine("Logs will be saved to current directory in opensim-console.log");
|
Console.WriteLine("Logs will be saved to current directory in opensim-console.log");
|
||||||
Log=File.AppendText("opensim-console.log");
|
Log=File.AppendText("opensim-console.log");
|
||||||
|
@ -83,14 +84,22 @@ namespace OpenSim
|
||||||
Log.Close();
|
Log.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
// You know what ReadLine() and WriteLine() do, right? And Read() and Write()? Right, you do actually know C#, right? Are you actually a programmer? Do you know english? Do you find my sense of humour in comments irritating? Good, glad you're still here
|
public override void Write(string format, params object[] args)
|
||||||
public override void WriteLine(string Line) {
|
{
|
||||||
Log.WriteLine(Line);
|
Log.Write(format, args);
|
||||||
Console.WriteLine(Line);
|
Console.Write(format, args);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ReadLine() {
|
public override void WriteLine(string format, params object[] args)
|
||||||
|
{
|
||||||
|
Log.WriteLine(format, args);
|
||||||
|
Console.WriteLine(format, args);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ReadLine()
|
||||||
|
{
|
||||||
string TempStr=Console.ReadLine();
|
string TempStr=Console.ReadLine();
|
||||||
Log.WriteLine(TempStr);
|
Log.WriteLine(TempStr);
|
||||||
return TempStr;
|
return TempStr;
|
||||||
|
@ -102,12 +111,6 @@ namespace OpenSim
|
||||||
return TempInt;
|
return TempInt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Write(string Line) {
|
|
||||||
Console.Write(Line);
|
|
||||||
Log.Write(Line);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Displays a command prompt and waits for the user to enter a string, then returns that string
|
// Displays a command prompt and waits for the user to enter a string, then returns that string
|
||||||
public override string CmdPrompt(string prompt) {
|
public override string CmdPrompt(string prompt) {
|
||||||
this.Write(prompt);
|
this.Write(prompt);
|
||||||
|
@ -196,6 +199,12 @@ namespace OpenSim
|
||||||
string[] cmdparams=(string[])tempstrarray;
|
string[] cmdparams=(string[])tempstrarray;
|
||||||
RunCmd(cmd,cmdparams);
|
RunCmd(cmd,cmdparams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public override void SetStatus(string status)
|
||||||
|
{
|
||||||
|
Console.Write( status + "\r" );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("opensim")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("Playahead AB")]
|
||||||
|
[assembly: AssemblyProduct("opensim")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © Playahead AB 2007")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("1d09756b-a461-4302-b6fe-15c455317909")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -35,6 +35,9 @@
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<FileAlignment>4096</FileAlignment>
|
<FileAlignment>4096</FileAlignment>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<OutputPath>..\bin\</OutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
|
@ -73,16 +76,26 @@
|
||||||
<Compile Include="VersionInfo.cs" />
|
<Compile Include="VersionInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="GridServers" />
|
|
||||||
<Folder Include="Assets" />
|
|
||||||
<ProjectReference Include="GridInterfaces\GridInterfaces.csproj">
|
<ProjectReference Include="GridInterfaces\GridInterfaces.csproj">
|
||||||
<Project>{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}</Project>
|
<Project>{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}</Project>
|
||||||
<Name>GridInterfaces</Name>
|
<Name>GridInterfaces</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="LocalServers\LocalGridServers\LocalGridServers.csproj">
|
||||||
|
<Project>{D7F0395B-FADC-4936-80A0-D95AACE92F62}</Project>
|
||||||
|
<Name>LocalGridServers</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="LocalStorage\Db4LocalStorage\Db4LocalStorage.csproj">
|
||||||
|
<Project>{74784F23-B0FD-484C-82C1-96C0215733DC}</Project>
|
||||||
|
<Name>Db4LocalStorage</Name>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="physics\PhysicsManager.csproj">
|
<ProjectReference Include="physics\PhysicsManager.csproj">
|
||||||
<Project>{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}</Project>
|
<Project>{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}</Project>
|
||||||
<Name>PhysicsManager</Name>
|
<Name>PhysicsManager</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="RemoteServers\RemoteGridServers\RemoteGridServers.csproj">
|
||||||
|
<Project>{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}</Project>
|
||||||
|
<Name>RemoteGridServers</Name>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="ServerConsole\ServerConsole\ServerConsole.csproj">
|
<ProjectReference Include="ServerConsole\ServerConsole\ServerConsole.csproj">
|
||||||
<Project>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</Project>
|
<Project>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</Project>
|
||||||
<Name>ServerConsole</Name>
|
<Name>ServerConsole</Name>
|
||||||
|
|
|
@ -43,11 +43,6 @@ namespace ServerConsole
|
||||||
instance = value;
|
instance = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MainConsole()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class ConsoleBase
|
public abstract class ConsoleBase
|
||||||
|
@ -61,15 +56,14 @@ namespace ServerConsole
|
||||||
|
|
||||||
public abstract void Close();
|
public abstract void Close();
|
||||||
|
|
||||||
// You know what ReadLine() and WriteLine() do, right? And Read() and Write()? Right, you do actually know C#, right? Are you actually a programmer? Do you know english? Do you find my sense of humour in comments irritating? Good, glad you're still here
|
public abstract void Write(string format, params object[] args);
|
||||||
public abstract void WriteLine(string Line) ;
|
|
||||||
|
public abstract void WriteLine(string format, params object[] args);
|
||||||
|
|
||||||
public abstract string ReadLine();
|
public abstract string ReadLine();
|
||||||
|
|
||||||
public abstract int Read() ;
|
public abstract int Read() ;
|
||||||
|
|
||||||
public abstract void Write(string Line) ;
|
|
||||||
|
|
||||||
// Displays a command prompt and waits for the user to enter a string, then returns that string
|
// Displays a command prompt and waits for the user to enter a string, then returns that string
|
||||||
public abstract string CmdPrompt(string prompt) ;
|
public abstract string CmdPrompt(string prompt) ;
|
||||||
|
|
||||||
|
@ -87,5 +81,7 @@ namespace ServerConsole
|
||||||
|
|
||||||
// Displays a prompt to the user and then runs the command they entered
|
// Displays a prompt to the user and then runs the command they entered
|
||||||
public abstract void MainConsolePrompt() ;
|
public abstract void MainConsolePrompt() ;
|
||||||
|
|
||||||
|
public abstract void SetStatus( string status );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||||
|
# Visual Studio 2005
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Second-server", "Second-server.csproj", "{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GridInterfaces", "GridInterfaces\GridInterfaces.csproj", "{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhysicsManager", "physics\PhysicsManager.csproj", "{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerConsole", "ServerConsole\ServerConsole\ServerConsole.csproj", "{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalGridServers", "LocalServers\LocalGridServers\LocalGridServers.csproj", "{D7F0395B-FADC-4936-80A0-D95AACE92F62}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemoteGridServers", "RemoteServers\RemoteGridServers\RemoteGridServers.csproj", "{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimConfig", "Config\SimConfig\SimConfig.csproj", "{B063760D-DB8D-4F64-B6FE-335FAD1E650A}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Db4LocalStorage", "LocalStorage\Db4LocalStorage\Db4LocalStorage.csproj", "{74784F23-B0FD-484C-82C1-96C0215733DC}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{D7F0395B-FADC-4936-80A0-D95AACE92F62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{D7F0395B-FADC-4936-80A0-D95AACE92F62}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{D7F0395B-FADC-4936-80A0-D95AACE92F62}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{D7F0395B-FADC-4936-80A0-D95AACE92F62}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{74784F23-B0FD-484C-82C1-96C0215733DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{74784F23-B0FD-484C-82C1-96C0215733DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{74784F23-B0FD-484C-82C1-96C0215733DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{74784F23-B0FD-484C-82C1-96C0215733DC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
|
@ -46,6 +46,11 @@ namespace PhysicsSystem
|
||||||
|
|
||||||
public PhysicsScene GetPhysicsScene(string engineName)
|
public PhysicsScene GetPhysicsScene(string engineName)
|
||||||
{
|
{
|
||||||
|
if( String.IsNullOrEmpty( engineName ) )
|
||||||
|
{
|
||||||
|
return new NullPhysicsScene();
|
||||||
|
}
|
||||||
|
|
||||||
if(_plugins.ContainsKey(engineName))
|
if(_plugins.ContainsKey(engineName))
|
||||||
{
|
{
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("creating "+engineName);
|
ServerConsole.MainConsole.Instance.WriteLine("creating "+engineName);
|
||||||
|
@ -53,8 +58,9 @@ namespace PhysicsSystem
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ServerConsole.MainConsole.Instance.WriteLine("couldn't find physicsEngine: "+ engineName);
|
string error = String.Format("couldn't find physicsEngine: {0}", engineName);
|
||||||
return null;
|
ServerConsole.MainConsole.Instance.WriteLine( error );
|
||||||
|
throw new ArgumentException( error );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,6 +114,14 @@ namespace PhysicsSystem
|
||||||
|
|
||||||
public abstract class PhysicsScene
|
public abstract class PhysicsScene
|
||||||
{
|
{
|
||||||
|
public static PhysicsScene Null
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new NullPhysicsScene();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public abstract PhysicsActor AddAvatar(PhysicsVector position);
|
public abstract PhysicsActor AddAvatar(PhysicsVector position);
|
||||||
|
|
||||||
public abstract PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size);
|
public abstract PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size);
|
||||||
|
@ -124,8 +138,49 @@ namespace PhysicsSystem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class NullPhysicsScene : PhysicsScene
|
||||||
|
{
|
||||||
|
private static int m_workIndicator;
|
||||||
|
|
||||||
|
public override PhysicsActor AddAvatar(PhysicsVector position)
|
||||||
|
{
|
||||||
|
ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : AddAvatar({0})", position );
|
||||||
|
return PhysicsActor.Null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size)
|
||||||
|
{
|
||||||
|
ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : AddPrim({0},{1})", position, size );
|
||||||
|
return PhysicsActor.Null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Simulate(float timeStep)
|
||||||
|
{
|
||||||
|
m_workIndicator = ( m_workIndicator + 1 ) % 10;
|
||||||
|
|
||||||
|
ServerConsole.MainConsole.Instance.SetStatus( m_workIndicator.ToString() );
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void GetResults()
|
||||||
|
{
|
||||||
|
ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : GetResults()" );
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetTerrain(float[] heightMap)
|
||||||
|
{
|
||||||
|
ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : SetTerrain({0} items)", heightMap.Length );
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool IsThreaded
|
||||||
|
{
|
||||||
|
get { return false; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public abstract class PhysicsActor
|
public abstract class PhysicsActor
|
||||||
{
|
{
|
||||||
|
public static readonly PhysicsActor Null = new NullPhysicsActor();
|
||||||
|
|
||||||
public abstract PhysicsVector Position
|
public abstract PhysicsVector Position
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
|
@ -153,6 +208,60 @@ namespace PhysicsSystem
|
||||||
public abstract void SetMomentum(PhysicsVector momentum);
|
public abstract void SetMomentum(PhysicsVector momentum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class NullPhysicsActor : PhysicsActor
|
||||||
|
{
|
||||||
|
public override PhysicsVector Position
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return PhysicsVector.Zero;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override PhysicsVector Velocity
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return PhysicsVector.Zero;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override PhysicsVector Acceleration
|
||||||
|
{
|
||||||
|
get { return PhysicsVector.Zero; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Flying
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void AddForce(PhysicsVector force)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetMomentum(PhysicsVector momentum)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class PhysicsVector
|
public class PhysicsVector
|
||||||
{
|
{
|
||||||
public float X;
|
public float X;
|
||||||
|
@ -170,5 +279,7 @@ namespace PhysicsSystem
|
||||||
Y = y;
|
Y = y;
|
||||||
Z = z;
|
Z = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static readonly PhysicsVector Zero = new PhysicsVector(0f, 0f, 0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue