From 746729b6cefce7093d346e21909b35440dd88569 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 4 Apr 2009 23:23:24 +0000 Subject: * Implements IObjectPhysics on SOPObject partially. * Eg, IObject.Physics.* is now valid syntax and compiles (but will throw NotSupported at runtime) --- .../Scripting/Minimodule/IObject.cs | 5 +- .../Scripting/Minimodule/Object/IObjectPhysics.cs | 12 ++- .../Scripting/Minimodule/SOPObject.cs | 106 ++++++++++++++++++++- 3 files changed, 116 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Scripting') diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IObject.cs index 0b8fc37..36d016e 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IObject.cs @@ -28,6 +28,7 @@ using System; using System.Drawing; using OpenMetaverse; +using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { @@ -140,7 +141,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule /// String Text { get; set; } - bool IsPhysical { get; set; } // SetStatus(PHYSICS) bool IsPhantom { get; set; } // SetStatus(PHANTOM) bool IsRotationLockedX { get; set; } // SetStatus(!ROTATE_X) bool IsRotationLockedY { get; set; } // SetStatus(!ROTATE_Y) @@ -162,6 +162,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule PhysicsMaterial PhysicsMaterial { get; set; } + IObjectPhysics Physics { get; } + + /// /// Causes the object to speak to its surroundings, /// equivilent to LSL/OSSL llSay diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectPhysics.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectPhysics.cs index aaa95e5..9035db9 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectPhysics.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Object/IObjectPhysics.cs @@ -5,25 +5,27 @@ using OpenMetaverse; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object { - interface IObjectPhysics + public interface IObjectPhysics { bool Enabled { get; set; } + bool Phantom { get; set; } bool PhantomCollisions { get; set; } double Density { get; set; } double Mass { get; set; } - double Buoyancy { get; set; } Vector3 GeometricCenter { get; } Vector3 CenterOfMass { get; } + + Vector3 RotationalVelocity { get; set; } Vector3 Velocity { get; set; } Vector3 Torque { get; set; } - Vector3 Acceleration { get; } - Quaternion Orientation { get; set; } - Vector3 RotationalVelocity { get; set; } + Vector3 Force { get; set; } + + bool FloatOnWater { set; } void AddForce(Vector3 force, bool pushforce); void AddAngularForce(Vector3 force, bool pushforce); diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index c0a838b..2e93673 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs @@ -30,10 +30,11 @@ using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - class SOPObject : MarshalByRefObject, IObject + class SOPObject : MarshalByRefObject, IObject, IObjectPhysics { private readonly Scene m_rootScene; private readonly uint m_localID; @@ -254,6 +255,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule set { throw new System.NotImplementedException(); } } + public IObjectPhysics Physics + { + get { return this; } + } + #region Public Functions public void Say(string msg) @@ -386,5 +392,103 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule #endregion + #region IObjectPhysics + + public bool Enabled + { + get { throw new System.NotImplementedException(); } + set { throw new System.NotImplementedException(); } + } + + public bool Phantom + { + get { throw new System.NotImplementedException(); } + set { throw new System.NotImplementedException(); } + } + + public bool PhantomCollisions + { + get { throw new System.NotImplementedException(); } + set { throw new System.NotImplementedException(); } + } + + public double Density + { + get { throw new System.NotImplementedException(); } + set { throw new System.NotImplementedException(); } + } + + public double Mass + { + get { throw new System.NotImplementedException(); } + set { throw new System.NotImplementedException(); } + } + + public double Buoyancy + { + get { throw new System.NotImplementedException(); } + set { throw new System.NotImplementedException(); } + } + + public Vector3 GeometricCenter + { + get { throw new System.NotImplementedException(); } + } + + public Vector3 CenterOfMass + { + get { throw new System.NotImplementedException(); } + } + + public Vector3 RotationalVelocity + { + get { throw new System.NotImplementedException(); } + set { throw new System.NotImplementedException(); } + } + + public Vector3 Velocity + { + get { throw new System.NotImplementedException(); } + set { throw new System.NotImplementedException(); } + } + + public Vector3 Torque + { + get { throw new System.NotImplementedException(); } + set { throw new System.NotImplementedException(); } + } + + public Vector3 Acceleration + { + get { throw new System.NotImplementedException(); } + } + + public Vector3 Force + { + get { throw new System.NotImplementedException(); } + set { throw new System.NotImplementedException(); } + } + + public bool FloatOnWater + { + set { throw new System.NotImplementedException(); } + } + + public void AddForce(Vector3 force, bool pushforce) + { + throw new System.NotImplementedException(); + } + + public void AddAngularForce(Vector3 force, bool pushforce) + { + throw new System.NotImplementedException(); + } + + public void SetMomentum(Vector3 momentum) + { + throw new System.NotImplementedException(); + } + + #endregion } } -- cgit v1.1