diff options
Diffstat (limited to 'OpenSim/Region/PhysicsModules/BulletS')
7 files changed, 76 insertions, 17 deletions
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs index 83fc3a6..989b339 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs | |||
@@ -300,7 +300,7 @@ public sealed class BSCharacter : BSPhysObject | |||
300 | } | 300 | } |
301 | 301 | ||
302 | 302 | ||
303 | public override void LockAngularMotion(OMV.Vector3 axis) { return; } | 303 | public override void LockAngularMotion(byte axislocks) { return; } |
304 | 304 | ||
305 | public override OMV.Vector3 Position { | 305 | public override OMV.Vector3 Position { |
306 | get { | 306 | get { |
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs index da3fc18..c3eb776 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs | |||
@@ -268,7 +268,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
268 | public float MoveToTargetTau { get; set; } | 268 | public float MoveToTargetTau { get; set; } |
269 | 269 | ||
270 | // Used for llSetHoverHeight and maybe vehicle height. Hover Height will override MoveTo target's Z | 270 | // Used for llSetHoverHeight and maybe vehicle height. Hover Height will override MoveTo target's Z |
271 | public override bool PIDHoverActive { set { HoverActive = value; } } | 271 | public override bool PIDHoverActive {get {return HoverActive;} set { HoverActive = value; } } |
272 | public override float PIDHoverHeight { set { HoverHeight = value; } } | 272 | public override float PIDHoverHeight { set { HoverHeight = value; } } |
273 | public override PIDHoverType PIDHoverType { set { HoverType = value; } } | 273 | public override PIDHoverType PIDHoverType { set { HoverType = value; } } |
274 | public override float PIDHoverTau { set { HoverTau = value; } } | 274 | public override float PIDHoverTau { set { HoverTau = value; } } |
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs index 6f27ac7..1d552eb 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs | |||
@@ -33,7 +33,7 @@ using log4net; | |||
33 | using OMV = OpenMetaverse; | 33 | using OMV = OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Region.PhysicsModules.SharedBase; | 35 | using OpenSim.Region.PhysicsModules.SharedBase; |
36 | using OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet; | 36 | using OpenSim.Region.PhysicsModules.ConvexDecompositionDotNet; |
37 | 37 | ||
38 | namespace OpenSim.Region.PhysicsModule.BulletS | 38 | namespace OpenSim.Region.PhysicsModule.BulletS |
39 | { | 39 | { |
@@ -280,20 +280,20 @@ public class BSPrim : BSPhysObject | |||
280 | }); | 280 | }); |
281 | } | 281 | } |
282 | 282 | ||
283 | public override void LockAngularMotion(OMV.Vector3 axis) | 283 | public override void LockAngularMotion(byte axislocks) |
284 | { | 284 | { |
285 | DetailLog("{0},BSPrim.LockAngularMotion,call,axis={1}", LocalID, axis); | 285 | DetailLog("{0},BSPrim.LockAngularMotion,call,axis={1}", LocalID, axislocks); |
286 | 286 | ||
287 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR, 0f, 0f); | 287 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR, 0f, 0f); |
288 | if (axis.X != 1) | 288 | if ((axislocks & 0x02) != 0) |
289 | { | 289 | { |
290 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_X, 0f, 0f); | 290 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_X, 0f, 0f); |
291 | } | 291 | } |
292 | if (axis.Y != 1) | 292 | if ((axislocks & 0x04) != 0) |
293 | { | 293 | { |
294 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Y, 0f, 0f); | 294 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Y, 0f, 0f); |
295 | } | 295 | } |
296 | if (axis.Z != 1) | 296 | if ((axislocks & 0x08) != 0) |
297 | { | 297 | { |
298 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Z, 0f, 0f); | 298 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Z, 0f, 0f); |
299 | } | 299 | } |
@@ -647,6 +647,59 @@ public class BSPrim : BSPhysObject | |||
647 | }); | 647 | }); |
648 | } | 648 | } |
649 | 649 | ||
650 | public override void SetVehicle(object pvdata) | ||
651 | { | ||
652 | PhysScene.TaintedObject(LocalID, "BSPrim.SetVehicle", delegate () | ||
653 | { | ||
654 | BSDynamics vehicleActor = GetVehicleActor(true /* createIfNone */); | ||
655 | if (vehicleActor != null && (pvdata is VehicleData) ) | ||
656 | { | ||
657 | VehicleData vdata = (VehicleData)pvdata; | ||
658 | // vehicleActor.ProcessSetVehicle((VehicleData)vdata); | ||
659 | |||
660 | vehicleActor.ProcessTypeChange(vdata.m_type); | ||
661 | vehicleActor.ProcessVehicleFlags(-1, false); | ||
662 | vehicleActor.ProcessVehicleFlags((int)vdata.m_flags, false); | ||
663 | |||
664 | // Linear properties | ||
665 | vehicleActor.ProcessVectorVehicleParam(Vehicle.LINEAR_MOTOR_DIRECTION, vdata.m_linearMotorDirection); | ||
666 | vehicleActor.ProcessVectorVehicleParam(Vehicle.LINEAR_FRICTION_TIMESCALE, vdata.m_linearFrictionTimescale); | ||
667 | vehicleActor.ProcessFloatVehicleParam(Vehicle.LINEAR_MOTOR_DECAY_TIMESCALE, vdata.m_linearMotorDecayTimescale); | ||
668 | vehicleActor.ProcessFloatVehicleParam(Vehicle.LINEAR_MOTOR_TIMESCALE, vdata.m_linearMotorTimescale); | ||
669 | vehicleActor.ProcessVectorVehicleParam(Vehicle.LINEAR_MOTOR_OFFSET, vdata.m_linearMotorOffset); | ||
670 | |||
671 | //Angular properties | ||
672 | vehicleActor.ProcessVectorVehicleParam(Vehicle.ANGULAR_MOTOR_DIRECTION, vdata.m_angularMotorDirection); | ||
673 | vehicleActor.ProcessFloatVehicleParam(Vehicle.ANGULAR_MOTOR_TIMESCALE, vdata.m_angularMotorTimescale); | ||
674 | vehicleActor.ProcessFloatVehicleParam(Vehicle.ANGULAR_MOTOR_DECAY_TIMESCALE, vdata.m_angularMotorDecayTimescale); | ||
675 | vehicleActor.ProcessVectorVehicleParam(Vehicle.ANGULAR_FRICTION_TIMESCALE, vdata.m_angularFrictionTimescale); | ||
676 | |||
677 | //Deflection properties | ||
678 | vehicleActor.ProcessFloatVehicleParam(Vehicle.ANGULAR_DEFLECTION_EFFICIENCY, vdata.m_angularDeflectionEfficiency); | ||
679 | vehicleActor.ProcessFloatVehicleParam(Vehicle.ANGULAR_DEFLECTION_TIMESCALE, vdata.m_angularDeflectionTimescale); | ||
680 | vehicleActor.ProcessFloatVehicleParam(Vehicle.LINEAR_DEFLECTION_EFFICIENCY, vdata.m_linearDeflectionEfficiency); | ||
681 | vehicleActor.ProcessFloatVehicleParam(Vehicle.LINEAR_DEFLECTION_TIMESCALE, vdata.m_linearDeflectionTimescale); | ||
682 | |||
683 | //Banking properties | ||
684 | vehicleActor.ProcessFloatVehicleParam(Vehicle.BANKING_EFFICIENCY, vdata.m_bankingEfficiency); | ||
685 | vehicleActor.ProcessFloatVehicleParam(Vehicle.BANKING_MIX, vdata.m_bankingMix); | ||
686 | vehicleActor.ProcessFloatVehicleParam(Vehicle.BANKING_TIMESCALE, vdata.m_bankingTimescale); | ||
687 | |||
688 | //Hover and Buoyancy properties | ||
689 | vehicleActor.ProcessFloatVehicleParam(Vehicle.HOVER_HEIGHT, vdata.m_VhoverHeight); | ||
690 | vehicleActor.ProcessFloatVehicleParam(Vehicle.HOVER_EFFICIENCY, vdata.m_VhoverEfficiency); | ||
691 | vehicleActor.ProcessFloatVehicleParam(Vehicle.HOVER_TIMESCALE, vdata.m_VhoverTimescale); | ||
692 | vehicleActor.ProcessFloatVehicleParam(Vehicle.BUOYANCY, vdata.m_VehicleBuoyancy); | ||
693 | |||
694 | //Attractor properties | ||
695 | vehicleActor.ProcessFloatVehicleParam(Vehicle.VERTICAL_ATTRACTION_EFFICIENCY, vdata.m_verticalAttractionEfficiency); | ||
696 | vehicleActor.ProcessFloatVehicleParam(Vehicle.VERTICAL_ATTRACTION_TIMESCALE, vdata.m_verticalAttractionTimescale); | ||
697 | |||
698 | vehicleActor.ProcessRotationVehicleParam(Vehicle.REFERENCE_FRAME, vdata.m_referenceFrame); | ||
699 | } | ||
700 | }); | ||
701 | } | ||
702 | |||
650 | // Allows the detection of collisions with inherently non-physical prims. see llVolumeDetect for more | 703 | // Allows the detection of collisions with inherently non-physical prims. see llVolumeDetect for more |
651 | public override void SetVolumeDetect(int param) { | 704 | public override void SetVolumeDetect(int param) { |
652 | bool newValue = (param != 0); | 705 | bool newValue = (param != 0); |
@@ -1173,6 +1226,10 @@ public class BSPrim : BSPhysObject | |||
1173 | // Used for llSetHoverHeight and maybe vehicle height | 1226 | // Used for llSetHoverHeight and maybe vehicle height |
1174 | // Hover Height will override MoveTo target's Z | 1227 | // Hover Height will override MoveTo target's Z |
1175 | public override bool PIDHoverActive { | 1228 | public override bool PIDHoverActive { |
1229 | get | ||
1230 | { | ||
1231 | return base.HoverActive; | ||
1232 | } | ||
1176 | set { | 1233 | set { |
1177 | base.HoverActive = value; | 1234 | base.HoverActive = value; |
1178 | EnableActor(HoverActive, HoverActorName, delegate() | 1235 | EnableActor(HoverActive, HoverActorName, delegate() |
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs b/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs index 452ce55..b2d5e47 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs | |||
@@ -762,7 +762,8 @@ namespace OpenSim.Region.PhysicsModule.BulletS | |||
762 | // The physics engine returns the number of milliseconds it simulated this call. | 762 | // The physics engine returns the number of milliseconds it simulated this call. |
763 | // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. | 763 | // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. |
764 | // Multiply by a fixed nominal frame rate to give a rate similar to the simulator (usually 55). | 764 | // Multiply by a fixed nominal frame rate to give a rate similar to the simulator (usually 55). |
765 | m_simulatedTime += (float)numSubSteps * m_fixedTimeStep * 1000f * NominalFrameRate; | 765 | // m_simulatedTime += (float)numSubSteps * m_fixedTimeStep * 1000f * NominalFrameRate; |
766 | m_simulatedTime += (float)numSubSteps * m_fixedTimeStep; | ||
766 | } | 767 | } |
767 | 768 | ||
768 | // Called by a BSPhysObject to note that it has changed properties and this information | 769 | // Called by a BSPhysObject to note that it has changed properties and this information |
@@ -849,7 +850,7 @@ namespace OpenSim.Region.PhysicsModule.BulletS | |||
849 | 850 | ||
850 | // Return the framerate simulated to give the above returned results. | 851 | // Return the framerate simulated to give the above returned results. |
851 | // (Race condition here but this is just bookkeeping so rare mistakes do not merit a lock). | 852 | // (Race condition here but this is just bookkeeping so rare mistakes do not merit a lock). |
852 | float simTime = m_simulatedTime; | 853 | float simTime = m_simulatedTime / timeStep; |
853 | m_simulatedTime = 0f; | 854 | m_simulatedTime = 0f; |
854 | return simTime; | 855 | return simTime; |
855 | } | 856 | } |
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSShapeCollection.cs b/OpenSim/Region/PhysicsModules/BulletS/BSShapeCollection.cs index b100273..4ec6f51 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSShapeCollection.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSShapeCollection.cs | |||
@@ -30,7 +30,6 @@ using System.Text; | |||
30 | using OMV = OpenMetaverse; | 30 | using OMV = OpenMetaverse; |
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Region.PhysicsModules.SharedBase; | 32 | using OpenSim.Region.PhysicsModules.SharedBase; |
33 | using OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet; | ||
34 | 33 | ||
35 | namespace OpenSim.Region.PhysicsModule.BulletS | 34 | namespace OpenSim.Region.PhysicsModule.BulletS |
36 | { | 35 | { |
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSShapes.cs b/OpenSim/Region/PhysicsModules/BulletS/BSShapes.cs index 086a412..e791b27 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSShapes.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSShapes.cs | |||
@@ -31,8 +31,8 @@ using System.Text; | |||
31 | 31 | ||
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Region.PhysicsModules.SharedBase; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | using OpenSim.Region.PhysicsModules.Meshing; | 34 | using OpenSim.Region.PhysicsModule.Meshing; |
35 | using OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet; | 35 | using OpenSim.Region.PhysicsModules.ConvexDecompositionDotNet; |
36 | 36 | ||
37 | using OMV = OpenMetaverse; | 37 | using OMV = OpenMetaverse; |
38 | 38 | ||
@@ -555,7 +555,9 @@ public class BSShapeMesh : BSShape | |||
555 | { | 555 | { |
556 | meshData = physicsScene.mesher.CreateMesh(prim.PhysObjectName, pbs, size, lod, | 556 | meshData = physicsScene.mesher.CreateMesh(prim.PhysObjectName, pbs, size, lod, |
557 | false, // say it is not physical so a bounding box is not built | 557 | false, // say it is not physical so a bounding box is not built |
558 | false // do not cache the mesh and do not use previously built versions | 558 | false, // do not cache the mesh and do not use previously built versions |
559 | false, | ||
560 | false | ||
559 | ); | 561 | ); |
560 | } | 562 | } |
561 | 563 | ||
@@ -712,7 +714,7 @@ public class BSShapeHull : BSShape | |||
712 | lock (physicsScene.mesher) | 714 | lock (physicsScene.mesher) |
713 | { | 715 | { |
714 | // Pass true for physicalness as this prevents the creation of bounding box which is not needed | 716 | // Pass true for physicalness as this prevents the creation of bounding box which is not needed |
715 | meshData = physicsScene.mesher.CreateMesh(prim.PhysObjectName, pbs, size, lod, true /* isPhysical */, false /* shouldCache */); | 717 | meshData = physicsScene.mesher.CreateMesh(prim.PhysObjectName, pbs, size, lod, true /* isPhysical */, false /* shouldCache */, false, false); |
716 | 718 | ||
717 | // If we should use the asset's hull info, fetch it out of the locked mesher | 719 | // If we should use the asset's hull info, fetch it out of the locked mesher |
718 | if (meshData != null && BSParam.ShouldUseAssetHulls) | 720 | if (meshData != null && BSParam.ShouldUseAssetHulls) |
diff --git a/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTestsUtil.cs b/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTestsUtil.cs index 4eeea4d..109e19c 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTestsUtil.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTestsUtil.cs | |||
@@ -34,7 +34,7 @@ using Nini.Config; | |||
34 | 34 | ||
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Region.PhysicsModules.SharedBase; | 36 | using OpenSim.Region.PhysicsModules.SharedBase; |
37 | using OpenSim.Region.PhysicsModules.Meshing; | 37 | using OpenSim.Region.PhysicsModule.Meshing; |
38 | using OpenSim.Region.Framework.Interfaces; | 38 | using OpenSim.Region.Framework.Interfaces; |
39 | 39 | ||
40 | using OpenMetaverse; | 40 | using OpenMetaverse; |
@@ -86,7 +86,7 @@ public static class BulletSimTestsUtil | |||
86 | info.RegionSizeX = info.RegionSizeY = info.RegionSizeZ = Constants.RegionSize; | 86 | info.RegionSizeX = info.RegionSizeY = info.RegionSizeZ = Constants.RegionSize; |
87 | OpenSim.Region.Framework.Scenes.Scene scene = new OpenSim.Region.Framework.Scenes.Scene(info); | 87 | OpenSim.Region.Framework.Scenes.Scene scene = new OpenSim.Region.Framework.Scenes.Scene(info); |
88 | 88 | ||
89 | IMesher mesher = new OpenSim.Region.PhysicsModules.Meshing.Meshmerizer(); | 89 | IMesher mesher = new OpenSim.Region.PhysicsModule.Meshing.Meshmerizer(); |
90 | INonSharedRegionModule mod = mesher as INonSharedRegionModule; | 90 | INonSharedRegionModule mod = mesher as INonSharedRegionModule; |
91 | mod.Initialise(openSimINI); | 91 | mod.Initialise(openSimINI); |
92 | mod.AddRegion(scene); | 92 | mod.AddRegion(scene); |