aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/SharedBase
diff options
context:
space:
mode:
authorVegaslon2016-08-26 12:44:14 -0400
committerUbitUmarov2016-08-27 22:02:03 +0100
commitc918dd74dad732619d9496d02a1cc8c5eb51d8d0 (patch)
treed4dab43a3b1d51111e5c7f25190d47d188a61ec5 /OpenSim/Region/PhysicsModules/SharedBase
parent experimental function. Results still too volatile to be usefull (diff)
downloadopensim-SC_OLD-c918dd74dad732619d9496d02a1cc8c5eb51d8d0.zip
opensim-SC_OLD-c918dd74dad732619d9496d02a1cc8c5eb51d8d0.tar.gz
opensim-SC_OLD-c918dd74dad732619d9496d02a1cc8c5eb51d8d0.tar.bz2
opensim-SC_OLD-c918dd74dad732619d9496d02a1cc8c5eb51d8d0.tar.xz
Import plumbing from Halcyon for camera data to physics engine.
Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
Diffstat (limited to 'OpenSim/Region/PhysicsModules/SharedBase')
-rw-r--r--OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs25
1 files changed, 24 insertions, 1 deletions
diff --git a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs
index 04ccbf0..f140e09 100644
--- a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs
+++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs
@@ -55,6 +55,16 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
55 Absolute 55 Absolute
56 } 56 }
57 57
58 public struct CameraData
59 {
60 public Quaternion CameraRotation;
61 public Vector3 CameraPosition;
62 public bool MouseLook;
63 public bool Valid;
64 public Quaternion HeadRotation;
65 public Quaternion BodyRotation;
66 }
67
58 public struct ContactPoint 68 public struct ContactPoint
59 { 69 {
60 public Vector3 Position; 70 public Vector3 Position;
@@ -159,13 +169,15 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
159 public delegate void RequestTerseUpdate(); 169 public delegate void RequestTerseUpdate();
160 public delegate void CollisionUpdate(EventArgs e); 170 public delegate void CollisionUpdate(EventArgs e);
161 public delegate void OutOfBounds(Vector3 pos); 171 public delegate void OutOfBounds(Vector3 pos);
172 public delegate CameraData GetCameraData();
162 173
163// disable warning: public events 174 // disable warning: public events
164#pragma warning disable 67 175#pragma warning disable 67
165 public event PositionUpdate OnPositionUpdate; 176 public event PositionUpdate OnPositionUpdate;
166 public event VelocityUpdate OnVelocityUpdate; 177 public event VelocityUpdate OnVelocityUpdate;
167 public event OrientationUpdate OnOrientationUpdate; 178 public event OrientationUpdate OnOrientationUpdate;
168 public event RequestTerseUpdate OnRequestTerseUpdate; 179 public event RequestTerseUpdate OnRequestTerseUpdate;
180 public event GetCameraData OnPhysicsRequestingCameraData;
169 181
170 /// <summary> 182 /// <summary>
171 /// Subscribers to this event must synchronously handle the dictionary of collisions received, since the event 183 /// Subscribers to this event must synchronously handle the dictionary of collisions received, since the event
@@ -176,6 +188,17 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
176 public event OutOfBounds OnOutOfBounds; 188 public event OutOfBounds OnOutOfBounds;
177#pragma warning restore 67 189#pragma warning restore 67
178 190
191 public CameraData TryGetCameraData()
192 {
193 GetCameraData handler = OnPhysicsRequestingCameraData;
194 if (handler != null)
195 {
196 return handler();
197 }
198
199 return new CameraData { Valid = false };
200 }
201
179 public static PhysicsActor Null 202 public static PhysicsActor Null
180 { 203 {
181 get { return new NullPhysicsActor(); } 204 get { return new NullPhysicsActor(); }