diff options
author | Robert Adams | 2012-12-12 16:29:03 -0800 |
---|---|---|
committer | Robert Adams | 2012-12-12 16:51:43 -0800 |
commit | e1814aa827c2d0af21d087bd34e3c7f4f7cf25bd (patch) | |
tree | 283bcee9a3320a93e9c252937f754c5962f9a19d /OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |
parent | BulletSim: non-functional commenting and reorganization of material attribute... (diff) | |
download | opensim-SC_OLD-e1814aa827c2d0af21d087bd34e3c7f4f7cf25bd.zip opensim-SC_OLD-e1814aa827c2d0af21d087bd34e3c7f4f7cf25bd.tar.gz opensim-SC_OLD-e1814aa827c2d0af21d087bd34e3c7f4f7cf25bd.tar.bz2 opensim-SC_OLD-e1814aa827c2d0af21d087bd34e3c7f4f7cf25bd.tar.xz |
BulletSim: fix problem of avatar's floating off the ground after unsitting. Reworked size/scale logic so physical scale is kept in Bullet and physObject scale is the preferred size -- usually same as size but avatars are computed differently.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 35d22c0..19c29cc 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |||
@@ -45,7 +45,6 @@ public sealed class BSPrim : BSPhysObject | |||
45 | private static readonly string LogHeader = "[BULLETS PRIM]"; | 45 | private static readonly string LogHeader = "[BULLETS PRIM]"; |
46 | 46 | ||
47 | // _size is what the user passed. Scale is what we pass to the physics engine with the mesh. | 47 | // _size is what the user passed. Scale is what we pass to the physics engine with the mesh. |
48 | // Often Scale is unity because the meshmerizer will apply _size when creating the mesh. | ||
49 | private OMV.Vector3 _size; // the multiplier for each mesh dimension as passed by the user | 48 | private OMV.Vector3 _size; // the multiplier for each mesh dimension as passed by the user |
50 | 49 | ||
51 | private bool _grabbed; | 50 | private bool _grabbed; |
@@ -93,7 +92,7 @@ public sealed class BSPrim : BSPhysObject | |||
93 | _physicsActorType = (int)ActorTypes.Prim; | 92 | _physicsActorType = (int)ActorTypes.Prim; |
94 | _position = pos; | 93 | _position = pos; |
95 | _size = size; | 94 | _size = size; |
96 | Scale = size; // the scale will be set by CreateGeom depending on object type | 95 | Scale = size; // prims are the size the user wants them to be (different for BSCharactes). |
97 | _orientation = rotation; | 96 | _orientation = rotation; |
98 | _buoyancy = 1f; | 97 | _buoyancy = 1f; |
99 | _velocity = OMV.Vector3.Zero; | 98 | _velocity = OMV.Vector3.Zero; |
@@ -159,12 +158,10 @@ public sealed class BSPrim : BSPhysObject | |||
159 | // We presume the scale and size are the same. If scale must be changed for | 158 | // We presume the scale and size are the same. If scale must be changed for |
160 | // the physical shape, that is done when the geometry is built. | 159 | // the physical shape, that is done when the geometry is built. |
161 | _size = value; | 160 | _size = value; |
161 | Scale = _size; | ||
162 | ForceBodyShapeRebuild(false); | 162 | ForceBodyShapeRebuild(false); |
163 | } | 163 | } |
164 | } | 164 | } |
165 | // Scale is what we set in the physics engine. It is different than 'size' in that | ||
166 | // 'size' can be encorporated into the mesh. In that case, the scale is <1,1,1>. | ||
167 | public override OMV.Vector3 Scale { get; set; } | ||
168 | 165 | ||
169 | public override PrimitiveBaseShape Shape { | 166 | public override PrimitiveBaseShape Shape { |
170 | set { | 167 | set { |
@@ -1369,7 +1366,6 @@ public sealed class BSPrim : BSPhysObject | |||
1369 | // Create the correct physical representation for this type of object. | 1366 | // Create the correct physical representation for this type of object. |
1370 | // Updates PhysBody and PhysShape with the new information. | 1367 | // Updates PhysBody and PhysShape with the new information. |
1371 | // Ignore 'forceRebuild'. This routine makes the right choices and changes of necessary. | 1368 | // Ignore 'forceRebuild'. This routine makes the right choices and changes of necessary. |
1372 | // Returns 'true' if either the body or the shape was changed. | ||
1373 | PhysicsScene.Shapes.GetBodyAndShape(false, PhysicsScene.World, this, null, delegate(BulletBody dBody) | 1369 | PhysicsScene.Shapes.GetBodyAndShape(false, PhysicsScene.World, this, null, delegate(BulletBody dBody) |
1374 | { | 1370 | { |
1375 | // Called if the current prim body is about to be destroyed. | 1371 | // Called if the current prim body is about to be destroyed. |