diff options
author | Teravus Ovares | 2008-05-03 04:33:17 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-05-03 04:33:17 +0000 |
commit | 07167c9a3f6d93fddf66e6f252f4a9b3a4fde8de (patch) | |
tree | 7b19dfcf5db2afcd1bbacbf55298f14669b0f615 /OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |
parent | Thank you kindly, Melanie for a patch to solve (diff) | |
download | opensim-SC-07167c9a3f6d93fddf66e6f252f4a9b3a4fde8de.zip opensim-SC-07167c9a3f6d93fddf66e6f252f4a9b3a4fde8de.tar.gz opensim-SC-07167c9a3f6d93fddf66e6f252f4a9b3a4fde8de.tar.bz2 opensim-SC-07167c9a3f6d93fddf66e6f252f4a9b3a4fde8de.tar.xz |
* Committing some collision stuffs that I'm working on.
* Nothing user facing yet.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 47 |
1 files changed, 41 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 58dbd63..4e1696d 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -136,8 +136,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
136 | private PhysicsVector _target_velocity; | 136 | private PhysicsVector _target_velocity; |
137 | public d.Mass pMass; | 137 | public d.Mass pMass; |
138 | 138 | ||
139 | public int m_eventsubscription = 0; | ||
140 | private CollisionEventUpdate CollisionEventsThisFrame = null; | ||
141 | |||
139 | private IntPtr m_linkJoint = (IntPtr)0; | 142 | private IntPtr m_linkJoint = (IntPtr)0; |
140 | 143 | ||
144 | |||
141 | public OdePrim(String primName, OdeScene parent_scene, PhysicsVector pos, PhysicsVector size, | 145 | public OdePrim(String primName, OdeScene parent_scene, PhysicsVector pos, PhysicsVector size, |
142 | Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical, CollisionLocker dode) | 146 | Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical, CollisionLocker dode) |
143 | { | 147 | { |
@@ -201,12 +205,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
201 | 205 | ||
202 | } | 206 | } |
203 | 207 | ||
204 | /// <summary> | ||
205 | /// Nasty, however without this you get | ||
206 | /// 'invalid operation for locked space' when things are really loaded down | ||
207 | /// </summary> | ||
208 | /// <param name="space"></param> | ||
209 | |||
210 | public override int PhysicsActorType | 208 | public override int PhysicsActorType |
211 | { | 209 | { |
212 | get { return (int) ActorTypes.Prim; } | 210 | get { return (int) ActorTypes.Prim; } |
@@ -2229,5 +2227,42 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2229 | d.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f); | 2227 | d.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f); |
2230 | d.JointSetAMotorParam(Amotor, (int)dParam.FMax, m_tensor); | 2228 | d.JointSetAMotorParam(Amotor, (int)dParam.FMax, m_tensor); |
2231 | } | 2229 | } |
2230 | public override void SubscribeEvents(int ms) | ||
2231 | { | ||
2232 | m_eventsubscription = ms; | ||
2233 | _parent_scene.addCollisionEventReporting(this); | ||
2234 | } | ||
2235 | public override void UnSubscribeEvents() | ||
2236 | { | ||
2237 | _parent_scene.remCollisionEventReporting(this); | ||
2238 | m_eventsubscription = 0; | ||
2239 | } | ||
2240 | public void AddCollisionEvent(uint CollidedWith, float depth) | ||
2241 | { | ||
2242 | if (CollisionEventsThisFrame == null) | ||
2243 | CollisionEventsThisFrame = new CollisionEventUpdate(); | ||
2244 | CollisionEventsThisFrame.addCollider(CollidedWith,depth); | ||
2245 | } | ||
2246 | |||
2247 | public void SendCollisions() | ||
2248 | { | ||
2249 | if (CollisionEventsThisFrame == null) | ||
2250 | return; | ||
2251 | |||
2252 | //if (CollisionEventsThisFrame.m_objCollisionList == null) | ||
2253 | // return; | ||
2254 | |||
2255 | if (CollisionEventsThisFrame.m_objCollisionList.Count > 0) | ||
2256 | { | ||
2257 | base.SendCollisionUpdate(CollisionEventsThisFrame); | ||
2258 | CollisionEventsThisFrame = new CollisionEventUpdate(); | ||
2259 | } | ||
2260 | } | ||
2261 | public override bool SubscribedEvents() | ||
2262 | { | ||
2263 | if (m_eventsubscription > 0) | ||
2264 | return true; | ||
2265 | return false; | ||
2266 | } | ||
2232 | } | 2267 | } |
2233 | } | 2268 | } |