From 6758ecc40375fb046f142f5f45a19513a89b1f86 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sun, 28 Sep 2008 22:38:59 +0000 Subject: [PATCH] Implement the plumbing for llSetVehicleType from the LSL subroutine down through the physics modules through PhysActor and SceneObjectPart. No connection to the physics simulators. --- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 8 ++++++++ .../Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 6 ++++++ .../Region/Physics/BulletXPlugin/BulletXPlugin.cs | 6 ++++++ OpenSim/Region/Physics/Manager/PhysicsActor.cs | 7 +++++++ OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 6 ++++++ OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 6 ++++++ OpenSim/Region/Physics/POSPlugin/POSCharacter.cs | 6 ++++++ OpenSim/Region/Physics/POSPlugin/POSPrim.cs | 6 ++++++ OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs | 12 ++++++++++++ .../Shared/Api/Implementation/LSL_Api.cs | 8 +++++++- 10 files changed, 70 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 68df0e4634..17d678da05 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -2337,6 +2337,14 @@ namespace OpenSim.Region.Environment.Scenes } } + public void SetVehicleType(int type) + { + if (PhysActor != null) + { + PhysActor.VehicleType = type; + } + } + public void SetVehicleFloatParam(int param, float value) { if (PhysActor != null) diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index 96543dab3e..702f5f1ff5 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs @@ -335,6 +335,12 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin set { return; } } + public override int VehicleType + { + get { return 0; } + set { return; } + } + public override void VehicleFloatParam(int param, float value) { diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs index e62f96696e..9e7b459c89 100644 --- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs +++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs @@ -950,6 +950,12 @@ namespace OpenSim.Region.Physics.BulletXPlugin set { return; } } + public override int VehicleType + { + get { return 0; } + set { return; } + } + public override void VehicleFloatParam(int param, float value) { diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 44d4df7c88..5b512035a2 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs @@ -175,6 +175,7 @@ namespace OpenSim.Region.Physics.Manager public abstract float Mass { get; } public abstract PhysicsVector Force { get; set; } + public abstract int VehicleType { get; set; } public abstract void VehicleFloatParam(int param, float value); public abstract void VehicleVectorParam(int param, PhysicsVector value); public abstract void VehicleRotationParam(int param, Quaternion rotation); @@ -281,6 +282,12 @@ namespace OpenSim.Region.Physics.Manager set { return; } } + public override int VehicleType + { + get { return 0; } + set { return; } + } + public override void VehicleFloatParam(int param, float value) { diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 6af0781b00..2561fa5c80 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -537,6 +537,12 @@ namespace OpenSim.Region.Physics.OdePlugin set { return; } } + public override int VehicleType + { + get { return 0; } + set { return; } + } + public override void VehicleFloatParam(int param, float value) { diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 9db7e8bb9a..5d9b169dbd 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -1876,6 +1876,12 @@ namespace OpenSim.Region.Physics.OdePlugin set { m_force = value; } } + public override int VehicleType + { + get { return 0; } + set { return; } + } + public override void VehicleFloatParam(int param, float value) { diff --git a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs b/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs index 9719a05baa..a9ddf277b7 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs @@ -159,6 +159,12 @@ namespace OpenSim.Region.Physics.POSPlugin set { return; } } + public override int VehicleType + { + get { return 0; } + set { return; } + } + public override void VehicleFloatParam(int param, float value) { diff --git a/OpenSim/Region/Physics/POSPlugin/POSPrim.cs b/OpenSim/Region/Physics/POSPlugin/POSPrim.cs index 265e170e3b..873529e17c 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSPrim.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSPrim.cs @@ -121,6 +121,12 @@ namespace OpenSim.Region.Physics.POSPlugin set { return; } } + public override int VehicleType + { + get { return 0; } + set { return; } + } + public override void VehicleFloatParam(int param, float value) { diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs index c9d2c13cc0..2d35ff0bbb 100644 --- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs +++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs @@ -343,6 +343,12 @@ namespace OpenSim.Region.Physics.PhysXPlugin set { return; } } + public override int VehicleType + { + get { return 0; } + set { return; } + } + public override void VehicleFloatParam(int param, float value) { @@ -688,6 +694,12 @@ namespace OpenSim.Region.Physics.PhysXPlugin set { return; } } + public override int VehicleType + { + get { return 0; } + set { return; } + } + public override void VehicleFloatParam(int param, float value) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e560d522dc..540ff986d7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -5159,7 +5159,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetVehicleType(int type) { m_host.AddScriptLPS(1); - NotImplemented("llSetVehicleType"); + if (m_host.ParentGroup != null) + { + if (m_host.ParentGroup.RootPart != null) + { + m_host.ParentGroup.RootPart.SetVehicleType(type); + } + } } //CFK 9/28: Most, but not all of the underlying plumbing between here and the physics modules is in