Implements on IObjectPhysics:

* SetMomentum
* AddAngularForce
* AddForce
* FloatOnWater
* Force
* Acceleration
* Torque
* Velocity
* RotationalVelocity
* CenterOfMass
* GeometricCenter
* Buoyancy
* Mass (Partial)
* Density (Partial)
0.6.5-rc1
Adam Frisby 2009-04-04 23:32:37 +00:00
parent 746729b6ce
commit e120876bd0
1 changed files with 62 additions and 21 deletions

View File

@ -31,6 +31,7 @@ using OpenMetaverse;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object; using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object;
using OpenSim.Region.Physics.Manager;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
@ -414,79 +415,119 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
public double Density public double Density
{ {
get { throw new System.NotImplementedException(); } get { return (GetSOP().PhysActor.Mass/Scale.X*Scale.Y/Scale.Z); }
set { throw new System.NotImplementedException(); } set { throw new NotImplementedException(); }
} }
public double Mass public double Mass
{ {
get { throw new System.NotImplementedException(); } get { return GetSOP().PhysActor.Mass; }
set { throw new System.NotImplementedException(); } set { throw new NotImplementedException(); }
} }
public double Buoyancy public double Buoyancy
{ {
get { throw new System.NotImplementedException(); } get { return GetSOP().PhysActor.Buoyancy; }
set { throw new System.NotImplementedException(); } set { GetSOP().PhysActor.Buoyancy = (float)value; }
} }
public Vector3 GeometricCenter public Vector3 GeometricCenter
{ {
get { throw new System.NotImplementedException(); } get
{
PhysicsVector tmp = GetSOP().PhysActor.GeometricCenter;
return new Vector3(tmp.X, tmp.Y, tmp.Z);
}
} }
public Vector3 CenterOfMass public Vector3 CenterOfMass
{ {
get { throw new System.NotImplementedException(); } get
{
PhysicsVector tmp = GetSOP().PhysActor.CenterOfMass;
return new Vector3(tmp.X, tmp.Y, tmp.Z);
}
} }
public Vector3 RotationalVelocity public Vector3 RotationalVelocity
{ {
get { throw new System.NotImplementedException(); } get
set { throw new System.NotImplementedException(); } {
PhysicsVector tmp = GetSOP().PhysActor.RotationalVelocity;
return new Vector3(tmp.X, tmp.Y, tmp.Z);
}
set
{
GetSOP().PhysActor.RotationalVelocity = new PhysicsVector(value.X, value.Y, value.Z);
}
} }
public Vector3 Velocity public Vector3 Velocity
{ {
get { throw new System.NotImplementedException(); } get
set { throw new System.NotImplementedException(); } {
PhysicsVector tmp = GetSOP().PhysActor.Velocity;
return new Vector3(tmp.X, tmp.Y, tmp.Z);
}
set
{
GetSOP().PhysActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z);
}
} }
public Vector3 Torque public Vector3 Torque
{ {
get { throw new System.NotImplementedException(); } get
set { throw new System.NotImplementedException(); } {
PhysicsVector tmp = GetSOP().PhysActor.Torque;
return new Vector3(tmp.X, tmp.Y, tmp.Z);
}
set
{
GetSOP().PhysActor.Torque = new PhysicsVector(value.X, value.Y, value.Z);
}
} }
public Vector3 Acceleration public Vector3 Acceleration
{ {
get { throw new System.NotImplementedException(); } get
{
PhysicsVector tmp = GetSOP().PhysActor.Acceleration;
return new Vector3(tmp.X, tmp.Y, tmp.Z);
}
} }
public Vector3 Force public Vector3 Force
{ {
get { throw new System.NotImplementedException(); } get
set { throw new System.NotImplementedException(); } {
PhysicsVector tmp = GetSOP().PhysActor.Force;
return new Vector3(tmp.X, tmp.Y, tmp.Z);
}
set
{
GetSOP().PhysActor.Force = new PhysicsVector(value.X, value.Y, value.Z);
}
} }
public bool FloatOnWater public bool FloatOnWater
{ {
set { throw new System.NotImplementedException(); } set { GetSOP().PhysActor.FloatOnWater = value; }
} }
public void AddForce(Vector3 force, bool pushforce) public void AddForce(Vector3 force, bool pushforce)
{ {
throw new System.NotImplementedException(); GetSOP().PhysActor.AddForce(new PhysicsVector(force.X, force.Y, force.Z), pushforce);
} }
public void AddAngularForce(Vector3 force, bool pushforce) public void AddAngularForce(Vector3 force, bool pushforce)
{ {
throw new System.NotImplementedException(); GetSOP().PhysActor.AddAngularForce(new PhysicsVector(force.X, force.Y, force.Z), pushforce);
} }
public void SetMomentum(Vector3 momentum) public void SetMomentum(Vector3 momentum)
{ {
throw new System.NotImplementedException(); GetSOP().PhysActor.SetMomentum(new PhysicsVector(momentum.X, momentum.Y, momentum.Z));
} }
#endregion #endregion