diff options
author | MW | 2007-05-26 13:40:19 +0000 |
---|---|---|
committer | MW | 2007-05-26 13:40:19 +0000 |
commit | 3436961bb5c01d659d09be134368f4f69460cef9 (patch) | |
tree | 3753ba4d7818df2a6bce0bbe863ff033cdfd568a /OpenSim/OpenSim.Physics/Manager/PhysicsActor.cs | |
download | opensim-SC_OLD-3436961bb5c01d659d09be134368f4f69460cef9.zip opensim-SC_OLD-3436961bb5c01d659d09be134368f4f69460cef9.tar.gz opensim-SC_OLD-3436961bb5c01d659d09be134368f4f69460cef9.tar.bz2 opensim-SC_OLD-3436961bb5c01d659d09be134368f4f69460cef9.tar.xz |
Start of rewrite 5279!
Diffstat (limited to 'OpenSim/OpenSim.Physics/Manager/PhysicsActor.cs')
-rw-r--r-- | OpenSim/OpenSim.Physics/Manager/PhysicsActor.cs | 161 |
1 files changed, 161 insertions, 0 deletions
diff --git a/OpenSim/OpenSim.Physics/Manager/PhysicsActor.cs b/OpenSim/OpenSim.Physics/Manager/PhysicsActor.cs new file mode 100644 index 0000000..a0b6c21 --- /dev/null +++ b/OpenSim/OpenSim.Physics/Manager/PhysicsActor.cs | |||
@@ -0,0 +1,161 @@ | |||
1 | /* | ||
2 | * Copyright (c) OpenSim project, http://sim.opensecondlife.org/ | ||
3 | * | ||
4 | * Redistribution and use in source and binary forms, with or without | ||
5 | * modification, are permitted provided that the following conditions are met: | ||
6 | * * Redistributions of source code must retain the above copyright | ||
7 | * notice, this list of conditions and the following disclaimer. | ||
8 | * * Redistributions in binary form must reproduce the above copyright | ||
9 | * notice, this list of conditions and the following disclaimer in the | ||
10 | * documentation and/or other materials provided with the distribution. | ||
11 | * * Neither the name of the <organization> nor the | ||
12 | * names of its contributors may be used to endorse or promote products | ||
13 | * derived from this software without specific prior written permission. | ||
14 | * | ||
15 | * THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY | ||
16 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
18 | * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY | ||
19 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
25 | * | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | |||
32 | namespace OpenSim.Physics.Manager | ||
33 | { | ||
34 | public abstract class PhysicsActor | ||
35 | { | ||
36 | public static PhysicsActor Null | ||
37 | { | ||
38 | get | ||
39 | { | ||
40 | return new NullPhysicsActor(); | ||
41 | } | ||
42 | } | ||
43 | |||
44 | public abstract PhysicsVector Position | ||
45 | { | ||
46 | get; | ||
47 | set; | ||
48 | } | ||
49 | |||
50 | public abstract PhysicsVector Velocity | ||
51 | { | ||
52 | get; | ||
53 | set; | ||
54 | } | ||
55 | |||
56 | public abstract PhysicsVector Acceleration | ||
57 | { | ||
58 | get; | ||
59 | } | ||
60 | |||
61 | public abstract Axiom.MathLib.Quaternion Orientation | ||
62 | { | ||
63 | get; | ||
64 | set; | ||
65 | } | ||
66 | |||
67 | public abstract bool Flying | ||
68 | { | ||
69 | get; | ||
70 | set; | ||
71 | } | ||
72 | |||
73 | public abstract bool Kinematic | ||
74 | { | ||
75 | get; | ||
76 | set; | ||
77 | } | ||
78 | |||
79 | public abstract void AddForce(PhysicsVector force); | ||
80 | |||
81 | public abstract void SetMomentum(PhysicsVector momentum); | ||
82 | } | ||
83 | |||
84 | public class NullPhysicsActor : PhysicsActor | ||
85 | { | ||
86 | public override PhysicsVector Position | ||
87 | { | ||
88 | get | ||
89 | { | ||
90 | return PhysicsVector.Zero; | ||
91 | } | ||
92 | set | ||
93 | { | ||
94 | return; | ||
95 | } | ||
96 | } | ||
97 | |||
98 | public override PhysicsVector Velocity | ||
99 | { | ||
100 | get | ||
101 | { | ||
102 | return PhysicsVector.Zero; | ||
103 | } | ||
104 | set | ||
105 | { | ||
106 | return; | ||
107 | } | ||
108 | } | ||
109 | |||
110 | public override Axiom.MathLib.Quaternion Orientation | ||
111 | { | ||
112 | get | ||
113 | { | ||
114 | return Axiom.MathLib.Quaternion.Identity; | ||
115 | } | ||
116 | set | ||
117 | { | ||
118 | |||
119 | } | ||
120 | } | ||
121 | |||
122 | public override PhysicsVector Acceleration | ||
123 | { | ||
124 | get { return PhysicsVector.Zero; } | ||
125 | } | ||
126 | |||
127 | public override bool Flying | ||
128 | { | ||
129 | get | ||
130 | { | ||
131 | return false; | ||
132 | } | ||
133 | set | ||
134 | { | ||
135 | return; | ||
136 | } | ||
137 | } | ||
138 | |||
139 | public override bool Kinematic | ||
140 | { | ||
141 | get | ||
142 | { | ||
143 | return true; | ||
144 | } | ||
145 | set | ||
146 | { | ||
147 | return; | ||
148 | } | ||
149 | } | ||
150 | |||
151 | public override void AddForce(PhysicsVector force) | ||
152 | { | ||
153 | return; | ||
154 | } | ||
155 | |||
156 | public override void SetMomentum(PhysicsVector momentum) | ||
157 | { | ||
158 | return; | ||
159 | } | ||
160 | } | ||
161 | } | ||