From 6758ecc40375fb046f142f5f45a19513a89b1f86 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sun, 28 Sep 2008 22:38:59 +0000 Subject: 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 ++++++++ .../Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 6 ++++++ OpenSim/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 ++++++++++++ .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 +++++++- 10 files changed, 70 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 68df0e4..17d678d 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 96543da..702f5f1 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 e62f966..9e7b459 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 44d4df7..5b51203 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 6af0781..2561fa5 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 9db7e8b..5d9b169 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 9719a05..a9ddf27 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 265e170..873529e 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 c9d2c13..2d35ff0 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 e560d52..540ff98 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 -- cgit v1.1