diff options
author | Robert Adams | 2015-10-02 18:35:02 -0700 |
---|---|---|
committer | Robert Adams | 2015-10-02 18:35:02 -0700 |
commit | e1ce04de428f856d92ac21912364320ebbda7b1a (patch) | |
tree | d0807de24a2f0267aa18a791b01eb2a6263247b1 /OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs | |
parent | reduce some diferences with master (diff) | |
download | opensim-SC-e1ce04de428f856d92ac21912364320ebbda7b1a.zip opensim-SC-e1ce04de428f856d92ac21912364320ebbda7b1a.tar.gz opensim-SC-e1ce04de428f856d92ac21912364320ebbda7b1a.tar.bz2 opensim-SC-e1ce04de428f856d92ac21912364320ebbda7b1a.tar.xz |
Implement an overridable implementation of PhysicsActor.SetVehicle()
that works for all physics engines.
BulletSim: implement an optimized version of SetVehicle() that still
uses the vehicle code to do bounds checking but does it in one taint
operation.
Diffstat (limited to 'OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs')
-rw-r--r-- | OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs index c8ac5c5..93e5e53 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs | |||
@@ -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); |