diff options
Diffstat (limited to 'OpenSim/OpenSim.Physics/BasicPhysicsPlugin')
4 files changed, 0 insertions, 471 deletions
diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/AssemblyInfo.cs b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/AssemblyInfo.cs deleted file mode 100644 index 177c49d..0000000 --- a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/AssemblyInfo.cs +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System.Reflection; | ||
29 | using System.Runtime.CompilerServices; | ||
30 | using System.Runtime.InteropServices; | ||
31 | |||
32 | // Information about this assembly is defined by the following | ||
33 | // attributes. | ||
34 | // | ||
35 | // change them to the information which is associated with the assembly | ||
36 | // you compile. | ||
37 | |||
38 | [assembly: AssemblyTitle("PhysXplugin")] | ||
39 | [assembly: AssemblyDescription("")] | ||
40 | [assembly: AssemblyConfiguration("")] | ||
41 | [assembly: AssemblyCompany("")] | ||
42 | [assembly: AssemblyProduct("PhysXplugin")] | ||
43 | [assembly: AssemblyCopyright("")] | ||
44 | [assembly: AssemblyTrademark("")] | ||
45 | [assembly: AssemblyCulture("")] | ||
46 | |||
47 | // This sets the default COM visibility of types in the assembly to invisible. | ||
48 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. | ||
49 | [assembly: ComVisible(false)] | ||
50 | |||
51 | // The assembly version has following format : | ||
52 | // | ||
53 | // Major.Minor.Build.Revision | ||
54 | // | ||
55 | // You can specify all values by your own or you can build default build and revision | ||
56 | // numbers with the '*' character (the default): | ||
57 | |||
58 | [assembly: AssemblyVersion("1.0.*")] | ||
diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs deleted file mode 100644 index 3d8c9aa..0000000 --- a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ /dev/null | |||
@@ -1,278 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using OpenSim.Physics.Manager; | ||
31 | |||
32 | namespace OpenSim.Physics.BasicPhysicsPlugin | ||
33 | { | ||
34 | /// <summary> | ||
35 | /// Will be the PhysX plugin but for now will be a very basic physics engine | ||
36 | /// </summary> | ||
37 | public class BasicPhysicsPlugin : IPhysicsPlugin | ||
38 | { | ||
39 | private BasicScene _mScene; | ||
40 | |||
41 | public BasicPhysicsPlugin() | ||
42 | { | ||
43 | |||
44 | } | ||
45 | |||
46 | public bool Init() | ||
47 | { | ||
48 | return true; | ||
49 | } | ||
50 | |||
51 | public PhysicsScene GetScene() | ||
52 | { | ||
53 | if(_mScene == null) | ||
54 | { | ||
55 | _mScene = new BasicScene(); | ||
56 | } | ||
57 | return(_mScene); | ||
58 | } | ||
59 | |||
60 | public string GetName() | ||
61 | { | ||
62 | return("basicphysics"); | ||
63 | } | ||
64 | |||
65 | public void Dispose() | ||
66 | { | ||
67 | |||
68 | } | ||
69 | } | ||
70 | |||
71 | public class BasicScene :PhysicsScene | ||
72 | { | ||
73 | private List<BasicActor> _actors = new List<BasicActor>(); | ||
74 | private float[] _heightMap; | ||
75 | |||
76 | public BasicScene() | ||
77 | { | ||
78 | |||
79 | } | ||
80 | |||
81 | public override PhysicsActor AddAvatar(PhysicsVector position) | ||
82 | { | ||
83 | BasicActor act = new BasicActor(); | ||
84 | act.Position = position; | ||
85 | _actors.Add(act); | ||
86 | return act; | ||
87 | } | ||
88 | |||
89 | public override void RemoveAvatar(PhysicsActor actor) | ||
90 | { | ||
91 | BasicActor act = (BasicActor)actor; | ||
92 | if(_actors.Contains(act)) | ||
93 | { | ||
94 | _actors.Remove(act); | ||
95 | } | ||
96 | |||
97 | } | ||
98 | |||
99 | public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size) | ||
100 | { | ||
101 | return null; | ||
102 | } | ||
103 | |||
104 | public override void Simulate(float timeStep) | ||
105 | { | ||
106 | foreach (BasicActor actor in _actors) | ||
107 | { | ||
108 | actor.Position.X = actor.Position.X + (actor.Velocity.X * timeStep); | ||
109 | actor.Position.Y = actor.Position.Y + (actor.Velocity.Y * timeStep); | ||
110 | actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep); | ||
111 | /*if(actor.Flying) | ||
112 | { | ||
113 | actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep); | ||
114 | } | ||
115 | else | ||
116 | { | ||
117 | actor.Position.Z = actor.Position.Z + ((-9.8f + actor.Velocity.Z) * timeStep); | ||
118 | } | ||
119 | if(actor.Position.Z < (_heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X]+1)) | ||
120 | {*/ | ||
121 | if ((actor.Position.Y > 0 && actor.Position.Y < 256) && (actor.Position.X > 0 && actor.Position.X < 256)) | ||
122 | { | ||
123 | actor.Position.Z = _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 1; | ||
124 | } | ||
125 | //} | ||
126 | |||
127 | |||
128 | |||
129 | // This code needs sorting out - border crossings etc | ||
130 | /* if(actor.Position.X<0) | ||
131 | { | ||
132 | ControllingClient.CrossSimBorder(new LLVector3(this.Position.X,this.Position.Y,this.Position.Z)); | ||
133 | actor.Position.X = 0; | ||
134 | actor.Velocity.X = 0; | ||
135 | } | ||
136 | if(actor.Position.Y < 0) | ||
137 | { | ||
138 | ControllingClient.CrossSimBorder(new LLVector3(this.Position.X,this.Position.Y,this.Position.Z)); | ||
139 | actor.Position.Y = 0; | ||
140 | actor.Velocity.Y = 0; | ||
141 | } | ||
142 | if(actor.Position.X > 255) | ||
143 | { | ||
144 | ControllingClient.CrossSimBorder(new LLVector3(this.Position.X,this.Position.Y,this.Position.Z)); | ||
145 | actor.Position.X = 255; | ||
146 | actor.Velocity.X = 0; | ||
147 | } | ||
148 | if(actor.Position.Y > 255) | ||
149 | { | ||
150 | ControllingClient.CrossSimBorder(new LLVector3(this.Position.X,this.Position.Y,this.Position.Z)); | ||
151 | actor.Position.Y = 255; | ||
152 | actor.Velocity.X = 0; | ||
153 | }*/ | ||
154 | } | ||
155 | } | ||
156 | |||
157 | public override void GetResults() | ||
158 | { | ||
159 | |||
160 | } | ||
161 | |||
162 | public override bool IsThreaded | ||
163 | { | ||
164 | get | ||
165 | { | ||
166 | return(false); // for now we won't be multithreaded | ||
167 | } | ||
168 | } | ||
169 | |||
170 | public override void SetTerrain(float[] heightMap) | ||
171 | { | ||
172 | this._heightMap = heightMap; | ||
173 | } | ||
174 | |||
175 | public override void DeleteTerrain() | ||
176 | { | ||
177 | |||
178 | } | ||
179 | } | ||
180 | |||
181 | public class BasicActor : PhysicsActor | ||
182 | { | ||
183 | private PhysicsVector _position; | ||
184 | private PhysicsVector _velocity; | ||
185 | private PhysicsVector _acceleration; | ||
186 | private bool flying; | ||
187 | public BasicActor() | ||
188 | { | ||
189 | _velocity = new PhysicsVector(); | ||
190 | _position = new PhysicsVector(); | ||
191 | _acceleration = new PhysicsVector(); | ||
192 | } | ||
193 | |||
194 | public override bool Flying | ||
195 | { | ||
196 | get | ||
197 | { | ||
198 | return false; | ||
199 | } | ||
200 | set | ||
201 | { | ||
202 | flying= value; | ||
203 | } | ||
204 | } | ||
205 | |||
206 | public override PhysicsVector Position | ||
207 | { | ||
208 | get | ||
209 | { | ||
210 | return _position; | ||
211 | } | ||
212 | set | ||
213 | { | ||
214 | _position = value; | ||
215 | } | ||
216 | } | ||
217 | |||
218 | public override PhysicsVector Velocity | ||
219 | { | ||
220 | get | ||
221 | { | ||
222 | return _velocity; | ||
223 | } | ||
224 | set | ||
225 | { | ||
226 | _velocity = value; | ||
227 | } | ||
228 | } | ||
229 | |||
230 | public override Axiom.MathLib.Quaternion Orientation | ||
231 | { | ||
232 | get | ||
233 | { | ||
234 | return Axiom.MathLib.Quaternion.Identity; | ||
235 | } | ||
236 | set | ||
237 | { | ||
238 | |||
239 | } | ||
240 | } | ||
241 | |||
242 | public override PhysicsVector Acceleration | ||
243 | { | ||
244 | get | ||
245 | { | ||
246 | return _acceleration; | ||
247 | } | ||
248 | |||
249 | } | ||
250 | |||
251 | public override bool Kinematic | ||
252 | { | ||
253 | get | ||
254 | { | ||
255 | return true; | ||
256 | } | ||
257 | set | ||
258 | { | ||
259 | |||
260 | } | ||
261 | } | ||
262 | public void SetAcceleration (PhysicsVector accel) | ||
263 | { | ||
264 | this._acceleration = accel; | ||
265 | } | ||
266 | |||
267 | public override void AddForce(PhysicsVector force) | ||
268 | { | ||
269 | |||
270 | } | ||
271 | |||
272 | public override void SetMomentum(PhysicsVector momentum) | ||
273 | { | ||
274 | |||
275 | } | ||
276 | } | ||
277 | |||
278 | } | ||
diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.csproj b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.csproj deleted file mode 100644 index f88eb32..0000000 --- a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.csproj +++ /dev/null | |||
@@ -1,93 +0,0 @@ | |||
1 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
2 | <PropertyGroup> | ||
3 | <ProjectType>Local</ProjectType> | ||
4 | <ProductVersion>8.0.50727</ProductVersion> | ||
5 | <SchemaVersion>2.0</SchemaVersion> | ||
6 | <ProjectGuid>{4F874463-0000-0000-0000-000000000000}</ProjectGuid> | ||
7 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
8 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
9 | <ApplicationIcon></ApplicationIcon> | ||
10 | <AssemblyKeyContainerName> | ||
11 | </AssemblyKeyContainerName> | ||
12 | <AssemblyName>OpenSim.Physics.BasicPhysicsPlugin</AssemblyName> | ||
13 | <DefaultClientScript>JScript</DefaultClientScript> | ||
14 | <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> | ||
15 | <DefaultTargetSchema>IE50</DefaultTargetSchema> | ||
16 | <DelaySign>false</DelaySign> | ||
17 | <OutputType>Library</OutputType> | ||
18 | <AppDesignerFolder></AppDesignerFolder> | ||
19 | <RootNamespace>OpenSim.Physics.BasicPhysicsPlugin</RootNamespace> | ||
20 | <StartupObject></StartupObject> | ||
21 | <FileUpgradeFlags> | ||
22 | </FileUpgradeFlags> | ||
23 | </PropertyGroup> | ||
24 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
25 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> | ||
26 | <BaseAddress>285212672</BaseAddress> | ||
27 | <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
28 | <ConfigurationOverrideFile> | ||
29 | </ConfigurationOverrideFile> | ||
30 | <DefineConstants>TRACE;DEBUG</DefineConstants> | ||
31 | <DocumentationFile></DocumentationFile> | ||
32 | <DebugSymbols>True</DebugSymbols> | ||
33 | <FileAlignment>4096</FileAlignment> | ||
34 | <Optimize>False</Optimize> | ||
35 | <OutputPath>..\..\..\bin\Physics\</OutputPath> | ||
36 | <RegisterForComInterop>False</RegisterForComInterop> | ||
37 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | ||
38 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | ||
39 | <WarningLevel>4</WarningLevel> | ||
40 | <NoWarn></NoWarn> | ||
41 | </PropertyGroup> | ||
42 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
43 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> | ||
44 | <BaseAddress>285212672</BaseAddress> | ||
45 | <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
46 | <ConfigurationOverrideFile> | ||
47 | </ConfigurationOverrideFile> | ||
48 | <DefineConstants>TRACE</DefineConstants> | ||
49 | <DocumentationFile></DocumentationFile> | ||
50 | <DebugSymbols>False</DebugSymbols> | ||
51 | <FileAlignment>4096</FileAlignment> | ||
52 | <Optimize>True</Optimize> | ||
53 | <OutputPath>..\..\..\bin\Physics\</OutputPath> | ||
54 | <RegisterForComInterop>False</RegisterForComInterop> | ||
55 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | ||
56 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | ||
57 | <WarningLevel>4</WarningLevel> | ||
58 | <NoWarn></NoWarn> | ||
59 | </PropertyGroup> | ||
60 | <ItemGroup> | ||
61 | <Reference Include="Axiom.MathLib.dll" > | ||
62 | <HintPath>..\..\..\bin\Axiom.MathLib.dll</HintPath> | ||
63 | <Private>False</Private> | ||
64 | </Reference> | ||
65 | <Reference Include="System" > | ||
66 | <HintPath>System.dll</HintPath> | ||
67 | <Private>False</Private> | ||
68 | </Reference> | ||
69 | </ItemGroup> | ||
70 | <ItemGroup> | ||
71 | <ProjectReference Include="..\Manager\OpenSim.Physics.Manager.csproj"> | ||
72 | <Name>OpenSim.Physics.Manager</Name> | ||
73 | <Project>{8BE16150-0000-0000-0000-000000000000}</Project> | ||
74 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | ||
75 | <Private>False</Private> | ||
76 | </ProjectReference> | ||
77 | </ItemGroup> | ||
78 | <ItemGroup> | ||
79 | <Compile Include="AssemblyInfo.cs"> | ||
80 | <SubType>Code</SubType> | ||
81 | </Compile> | ||
82 | <Compile Include="BasicPhysicsPlugin.cs"> | ||
83 | <SubType>Code</SubType> | ||
84 | </Compile> | ||
85 | </ItemGroup> | ||
86 | <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> | ||
87 | <PropertyGroup> | ||
88 | <PreBuildEvent> | ||
89 | </PreBuildEvent> | ||
90 | <PostBuildEvent> | ||
91 | </PostBuildEvent> | ||
92 | </PropertyGroup> | ||
93 | </Project> | ||
diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build deleted file mode 100644 index 00ca3f9..0000000 --- a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | <?xml version="1.0" ?> | ||
2 | <project name="OpenSim.Physics.BasicPhysicsPlugin" default="build"> | ||
3 | <target name="build"> | ||
4 | <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" /> | ||
5 | <mkdir dir="${project::get-base-directory()}/${build.dir}" /> | ||
6 | <copy todir="${project::get-base-directory()}/${build.dir}"> | ||
7 | <fileset basedir="${project::get-base-directory()}"> | ||
8 | </fileset> | ||
9 | </copy> | ||
10 | <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll"> | ||
11 | <resources prefix="OpenSim.Physics.BasicPhysicsPlugin" dynamicprefix="true" > | ||
12 | </resources> | ||
13 | <sources failonempty="true"> | ||
14 | <include name="AssemblyInfo.cs" /> | ||
15 | <include name="BasicPhysicsPlugin.cs" /> | ||
16 | </sources> | ||
17 | <references basedir="${project::get-base-directory()}"> | ||
18 | <lib> | ||
19 | <include name="${project::get-base-directory()}" /> | ||
20 | <include name="${project::get-base-directory()}/${build.dir}" /> | ||
21 | </lib> | ||
22 | <include name="../../../bin/Axiom.MathLib.dll" /> | ||
23 | <include name="../../../bin/OpenSim.Physics.Manager.dll" /> | ||
24 | <include name="System.dll" /> | ||
25 | </references> | ||
26 | </csc> | ||
27 | <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/Physics/" /> | ||
28 | <mkdir dir="${project::get-base-directory()}/../../../bin/Physics/"/> | ||
29 | <copy todir="${project::get-base-directory()}/../../../bin/Physics/"> | ||
30 | <fileset basedir="${project::get-base-directory()}/${build.dir}/" > | ||
31 | <include name="*.dll"/> | ||
32 | <include name="*.exe"/> | ||
33 | </fileset> | ||
34 | </copy> | ||
35 | </target> | ||
36 | <target name="clean"> | ||
37 | <delete dir="${bin.dir}" failonerror="false" /> | ||
38 | <delete dir="${obj.dir}" failonerror="false" /> | ||
39 | </target> | ||
40 | <target name="doc" description="Creates documentation."> | ||
41 | </target> | ||
42 | </project> | ||