* Implements IObjectPhysics on SOPObject partially.

* Eg, IObject.Physics.* is now valid syntax and compiles (but will throw NotSupported at runtime)
0.6.5-rc1
Adam Frisby 2009-04-04 23:23:24 +00:00
parent 39c3ccb93a
commit 746729b6ce
3 changed files with 116 additions and 7 deletions

View File

@ -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
/// </summary>
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; }
/// <summary>
/// Causes the object to speak to its surroundings,
/// equivilent to LSL/OSSL llSay

View File

@ -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);

View File

@ -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
}
}