diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 66 |
1 files changed, 31 insertions, 35 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 83021b0..951e987 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2153,26 +2153,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
2153 | if (ParentGroup.RootPart == this) | 2153 | if (ParentGroup.RootPart == this) |
2154 | AngularVelocity = new Vector3(0, 0, 0); | 2154 | AngularVelocity = new Vector3(0, 0, 0); |
2155 | 2155 | ||
2156 | if (PhysActor.Phantom) | 2156 | if (pa.Phantom) |
2157 | { | 2157 | { |
2158 | RemoveFromPhysics(); | 2158 | RemoveFromPhysics(); |
2159 | return; | 2159 | return; |
2160 | } | 2160 | } |
2161 | 2161 | ||
2162 | PhysActor.IsPhysical = UsePhysics; | 2162 | pa.IsPhysical = UsePhysics; |
2163 | PhysActor.OnRequestTerseUpdate -= PhysicsRequestingTerseUpdate; | 2163 | pa.OnRequestTerseUpdate -= PhysicsRequestingTerseUpdate; |
2164 | PhysActor.OnOutOfBounds -= PhysicsOutOfBounds; | 2164 | pa.OnOutOfBounds -= PhysicsOutOfBounds; |
2165 | PhysActor.delink(); | 2165 | pa.delink(); |
2166 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 2166 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
2167 | { | 2167 | { |
2168 | // destroy all joints connected to this now deactivated body | 2168 | // destroy all joints connected to this now deactivated body |
2169 | ParentGroup.Scene.PhysicsScene.RemoveAllJointsConnectedToActorThreadLocked(PhysActor); | 2169 | ParentGroup.Scene.PhysicsScene.RemoveAllJointsConnectedToActorThreadLocked(pa); |
2170 | } | 2170 | } |
2171 | } | 2171 | } |
2172 | } | 2172 | } |
2173 | 2173 | ||
2174 | if (PhysActor.IsPhysical != UsePhysics) | 2174 | if (pa.IsPhysical != UsePhysics) |
2175 | PhysActor.IsPhysical = UsePhysics; | 2175 | pa.IsPhysical = UsePhysics; |
2176 | 2176 | ||
2177 | if (UsePhysics) | 2177 | if (UsePhysics) |
2178 | { | 2178 | { |
@@ -2197,8 +2197,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2197 | } | 2197 | } |
2198 | 2198 | ||
2199 | bool phan = ((Flags & PrimFlags.Phantom) != 0); | 2199 | bool phan = ((Flags & PrimFlags.Phantom) != 0); |
2200 | if (PhysActor.Phantom != phan) | 2200 | if (pa.Phantom != phan) |
2201 | PhysActor.Phantom = phan; | 2201 | pa.Phantom = phan; |
2202 | 2202 | ||
2203 | 2203 | ||
2204 | // If this part is a sculpt then delay the physics update until we've asynchronously loaded the | 2204 | // If this part is a sculpt then delay the physics update until we've asynchronously loaded the |
@@ -2320,7 +2320,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2320 | PhysicsActor pa = PhysActor; | 2320 | PhysicsActor pa = PhysActor; |
2321 | 2321 | ||
2322 | if (pa != null) | 2322 | if (pa != null) |
2323 | return new Vector3(pa.CenterOfMass.X, pa.CenterOfMass.Y, pa.CenterOfMass.Z); | 2323 | { |
2324 | Vector3 vtmp = pa.CenterOfMass; | ||
2325 | return vtmp; | ||
2326 | } | ||
2324 | else | 2327 | else |
2325 | return new Vector3(0, 0, 0); | 2328 | return new Vector3(0, 0, 0); |
2326 | } | 2329 | } |
@@ -3524,18 +3527,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3524 | PhysicsActor pa = PhysActor; | 3527 | PhysicsActor pa = PhysActor; |
3525 | 3528 | ||
3526 | if (pa != null) | 3529 | if (pa != null) |
3527 | pa.FloatOnWater = floatYN == 1; | 3530 | pa.FloatOnWater = (floatYN == 1); |
3528 | } | 3531 | } |
3529 | 3532 | ||
3530 | public void SetForce(Vector3 force) | 3533 | public void SetForce(Vector3 force) |
3531 | { | 3534 | { |
3532 | Force = force; | 3535 | Force = force; |
3533 | /* | ||
3534 | if (PhysActor != null) | ||
3535 | { | ||
3536 | PhysActor.Force = force; | ||
3537 | } | ||
3538 | */ | ||
3539 | } | 3536 | } |
3540 | 3537 | ||
3541 | public SOPVehicle sopVehicle | 3538 | public SOPVehicle sopVehicle |
@@ -5066,33 +5063,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
5066 | } | 5063 | } |
5067 | 5064 | ||
5068 | PhysicsActor pa = PhysActor; | 5065 | PhysicsActor pa = PhysActor; |
5069 | 5066 | if (pa != null) | |
5070 | if ( | ||
5071 | ((AggregateScriptEvents & scriptEvents.collision) != 0) || | ||
5072 | ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || | ||
5073 | ((AggregateScriptEvents & scriptEvents.collision_start) != 0) || | ||
5074 | ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) || | ||
5075 | ((AggregateScriptEvents & scriptEvents.land_collision) != 0) || | ||
5076 | ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) || | ||
5077 | (CollisionSound != UUID.Zero) | ||
5078 | ) | ||
5079 | { | 5067 | { |
5080 | // subscribe to physics updates. | 5068 | const scriptEvents NeededSubsEvents = ( |
5081 | if (pa != null) | 5069 | scriptEvents.collision | scriptEvents.collision_start| scriptEvents.collision_end | |
5070 | scriptEvents.land_collision | scriptEvents.land_collision_start | scriptEvents.land_collision_end | ||
5071 | ); | ||
5072 | if ( | ||
5073 | // ((AggregateScriptEvents & scriptEvents.collision) != 0) || | ||
5074 | // ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || | ||
5075 | // ((AggregateScriptEvents & scriptEvents.collision_start) != 0) || | ||
5076 | // ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) || | ||
5077 | // ((AggregateScriptEvents & scriptEvents.land_collision) != 0) || | ||
5078 | // ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) || | ||
5079 | ((AggregateScriptEvents & NeededSubsEvents) != 0) || (CollisionSound != UUID.Zero) | ||
5080 | ) | ||
5082 | { | 5081 | { |
5082 | // subscribe to physics updates. | ||
5083 | pa.OnCollisionUpdate += PhysicsCollision; | 5083 | pa.OnCollisionUpdate += PhysicsCollision; |
5084 | pa.SubscribeEvents(1000); | 5084 | pa.SubscribeEvents(1000); |
5085 | } | 5085 | } |
5086 | } | 5086 | else |
5087 | else | ||
5088 | { | ||
5089 | if (pa != null) | ||
5090 | { | 5087 | { |
5091 | pa.UnSubscribeEvents(); | 5088 | pa.UnSubscribeEvents(); |
5092 | pa.OnCollisionUpdate -= PhysicsCollision; | 5089 | pa.OnCollisionUpdate -= PhysicsCollision; |
5093 | } | 5090 | } |
5094 | } | 5091 | } |
5095 | |||
5096 | //if ((GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0) | 5092 | //if ((GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0) |
5097 | //{ | 5093 | //{ |
5098 | // ParentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting; | 5094 | // ParentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting; |