diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index c9c9c2c..53be2e3 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |||
@@ -279,9 +279,12 @@ public sealed class BSPrim : BSPhysObject | |||
279 | } | 279 | } |
280 | public override OMV.Vector3 Position { | 280 | public override OMV.Vector3 Position { |
281 | get { | 281 | get { |
282 | /* NOTE: this refetch is not necessary. The simulator knows about linkset children | ||
283 | * and does not fetch this position info for children. Thus this is commented out. | ||
282 | // child prims move around based on their parent. Need to get the latest location | 284 | // child prims move around based on their parent. Need to get the latest location |
283 | if (!Linkset.IsRoot(this)) | 285 | if (!Linkset.IsRoot(this)) |
284 | _position = Linkset.Position(this); | 286 | _position = Linkset.PositionGet(this); |
287 | */ | ||
285 | 288 | ||
286 | // don't do the GetObjectPosition for root elements because this function is called a zillion times. | 289 | // don't do the GetObjectPosition for root elements because this function is called a zillion times. |
287 | // _position = BulletSimAPI.GetObjectPosition2(PhysicsScene.World.ptr, BSBody.ptr); | 290 | // _position = BulletSimAPI.GetObjectPosition2(PhysicsScene.World.ptr, BSBody.ptr); |
@@ -289,21 +292,18 @@ public sealed class BSPrim : BSPhysObject | |||
289 | } | 292 | } |
290 | set { | 293 | set { |
291 | // If the position must be forced into the physics engine, use ForcePosition. | 294 | // If the position must be forced into the physics engine, use ForcePosition. |
295 | // All positions are given in world positions. | ||
292 | if (_position == value) | 296 | if (_position == value) |
293 | { | 297 | { |
298 | DetailLog("{0},BSPrim.setPosition,taint,positionNotChanging,pos={1},orient={2}", LocalID, _position, _orientation); | ||
294 | return; | 299 | return; |
295 | } | 300 | } |
296 | _position = value; | 301 | _position = value; |
297 | // TODO: what does it mean to set the position of a child prim?? Rebuild the constraint? | ||
298 | PositionSanityCheck(false); | 302 | PositionSanityCheck(false); |
299 | PhysicsScene.TaintedObject("BSPrim.setPosition", delegate() | 303 | PhysicsScene.TaintedObject("BSPrim.setPosition", delegate() |
300 | { | 304 | { |
301 | // DetailLog("{0},BSPrim.SetPosition,taint,pos={1},orient={2}", LocalID, _position, _orientation); | 305 | DetailLog("{0},BSPrim.SetPosition,taint,pos={1},orient={2}", LocalID, _position, _orientation); |
302 | if (PhysBody.HasPhysicalBody) | 306 | ForcePosition = _position; |
303 | { | ||
304 | BulletSimAPI.SetTranslation2(PhysBody.ptr, _position, _orientation); | ||
305 | ActivateIfPhysical(false); | ||
306 | } | ||
307 | }); | 307 | }); |
308 | } | 308 | } |
309 | } | 309 | } |
@@ -314,9 +314,11 @@ public sealed class BSPrim : BSPhysObject | |||
314 | } | 314 | } |
315 | set { | 315 | set { |
316 | _position = value; | 316 | _position = value; |
317 | // PositionSanityCheck(); // Don't do this! Causes a loop and caller should know better. | 317 | if (PhysBody.HasPhysicalBody) |
318 | BulletSimAPI.SetTranslation2(PhysBody.ptr, _position, _orientation); | 318 | { |
319 | ActivateIfPhysical(false); | 319 | BulletSimAPI.SetTranslation2(PhysBody.ptr, _position, _orientation); |
320 | ActivateIfPhysical(false); | ||
321 | } | ||
320 | } | 322 | } |
321 | } | 323 | } |
322 | 324 | ||
@@ -551,11 +553,14 @@ public sealed class BSPrim : BSPhysObject | |||
551 | } | 553 | } |
552 | public override OMV.Quaternion Orientation { | 554 | public override OMV.Quaternion Orientation { |
553 | get { | 555 | get { |
556 | /* NOTE: this refetch is not necessary. The simulator knows about linkset children | ||
557 | * and does not fetch this position info for children. Thus this is commented out. | ||
554 | // Children move around because tied to parent. Get a fresh value. | 558 | // Children move around because tied to parent. Get a fresh value. |
555 | if (!Linkset.IsRoot(this)) | 559 | if (!Linkset.IsRoot(this)) |
556 | { | 560 | { |
557 | _orientation = Linkset.Orientation(this); | 561 | _orientation = Linkset.OrientationGet(this); |
558 | } | 562 | } |
563 | */ | ||
559 | return _orientation; | 564 | return _orientation; |
560 | } | 565 | } |
561 | set { | 566 | set { |