mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +08:00
* This is the fabled LibOMV update with all of the libOMV types from JHurliman
* This is a HUGE OMG update and will definitely have unknown side effects.. so this is really only for the strong hearted at this point. Regular people should let the dust settle. * This has been tested to work with most basic functions. However.. make sure you back up 'everything' before using this. It's that big! * Essentially we're back at square 1 in the testing phase.. so lets identify things that broke.
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using Axiom.Math;
|
||||
using OpenMetaverse;
|
||||
using Ode.NET;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
@@ -587,7 +587,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
//Matrix3 or = Orientation.ToRotationMatrix();
|
||||
//d.Matrix3 ord = new d.Matrix3(or.m00, or.m10, or.m20, or.m01, or.m11, or.m21, or.m02, or.m12, or.m22);
|
||||
//d.BodySetRotation(Body, ref ord);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using Axiom.Math;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using Ode.NET;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
@@ -294,10 +294,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
setMass();
|
||||
d.BodySetPosition(Body, _position.X, _position.Y, _position.Z);
|
||||
d.Quaternion myrot = new d.Quaternion();
|
||||
myrot.W = _orientation.w;
|
||||
myrot.X = _orientation.x;
|
||||
myrot.Y = _orientation.y;
|
||||
myrot.Z = _orientation.z;
|
||||
myrot.X = _orientation.X;
|
||||
myrot.Y = _orientation.Y;
|
||||
myrot.Z = _orientation.Z;
|
||||
myrot.W = _orientation.W;
|
||||
d.BodySetQuaternion(Body, ref myrot);
|
||||
d.GeomSetBody(prim_geom, Body);
|
||||
m_collisionCategories |= CollisionCategories.Body;
|
||||
@@ -1021,10 +1021,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
{
|
||||
d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
||||
d.Quaternion myrot = new d.Quaternion();
|
||||
myrot.W = _orientation.w;
|
||||
myrot.X = _orientation.x;
|
||||
myrot.Y = _orientation.y;
|
||||
myrot.Z = _orientation.z;
|
||||
myrot.X = _orientation.X;
|
||||
myrot.Y = _orientation.Y;
|
||||
myrot.Z = _orientation.Z;
|
||||
myrot.W = _orientation.W;
|
||||
d.GeomSetQuaternion(prim_geom, ref myrot);
|
||||
}
|
||||
|
||||
@@ -1220,10 +1220,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
public void rotate(float timestep)
|
||||
{
|
||||
d.Quaternion myrot = new d.Quaternion();
|
||||
myrot.W = _orientation.w;
|
||||
myrot.X = _orientation.x;
|
||||
myrot.Y = _orientation.y;
|
||||
myrot.Z = _orientation.z;
|
||||
myrot.X = _orientation.X;
|
||||
myrot.Y = _orientation.Y;
|
||||
myrot.Z = _orientation.Z;
|
||||
myrot.W = _orientation.W;
|
||||
d.GeomSetQuaternion(prim_geom, ref myrot);
|
||||
if (m_isphysical && Body != (IntPtr) 0)
|
||||
{
|
||||
@@ -1339,10 +1339,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
setMesh(_parent_scene, mesh);
|
||||
d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
||||
d.Quaternion myrot = new d.Quaternion();
|
||||
myrot.W = _orientation.w;
|
||||
myrot.X = _orientation.x;
|
||||
myrot.Y = _orientation.y;
|
||||
myrot.Z = _orientation.z;
|
||||
myrot.X = _orientation.X;
|
||||
myrot.Y = _orientation.Y;
|
||||
myrot.Z = _orientation.Z;
|
||||
myrot.W = _orientation.W;
|
||||
d.GeomSetQuaternion(prim_geom, ref myrot);
|
||||
|
||||
//d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z);
|
||||
@@ -1388,10 +1388,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
//prim_geom = d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z);
|
||||
d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
||||
d.Quaternion myrot = new d.Quaternion();
|
||||
myrot.W = _orientation.w;
|
||||
myrot.X = _orientation.x;
|
||||
myrot.Y = _orientation.y;
|
||||
myrot.Z = _orientation.z;
|
||||
myrot.X = _orientation.X;
|
||||
myrot.Y = _orientation.Y;
|
||||
myrot.Z = _orientation.Z;
|
||||
myrot.W = _orientation.W;
|
||||
d.GeomSetQuaternion(prim_geom, ref myrot);
|
||||
}
|
||||
}
|
||||
@@ -1452,9 +1452,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
// d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
||||
// d.Quaternion myrot = new d.Quaternion();
|
||||
// myrot.W = _orientation.w;
|
||||
// myrot.X = _orientation.x;
|
||||
// myrot.Y = _orientation.y;
|
||||
// myrot.Z = _orientation.z;
|
||||
// myrot.X = _orientation.X;
|
||||
// myrot.Y = _orientation.Y;
|
||||
// myrot.Z = _orientation.Z;
|
||||
// d.GeomSetQuaternion(prim_geom, ref myrot);
|
||||
|
||||
// //d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z);
|
||||
@@ -1512,9 +1512,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
// d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
||||
// d.Quaternion myrot = new d.Quaternion();
|
||||
// myrot.W = _orientation.w;
|
||||
// myrot.X = _orientation.x;
|
||||
// myrot.Y = _orientation.y;
|
||||
// myrot.Z = _orientation.z;
|
||||
// myrot.X = _orientation.X;
|
||||
// myrot.Y = _orientation.Y;
|
||||
// myrot.Z = _orientation.Z;
|
||||
// d.GeomSetQuaternion(prim_geom, ref myrot);
|
||||
// }
|
||||
// }
|
||||
@@ -1553,9 +1553,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
// d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
||||
// d.Quaternion myrot = new d.Quaternion();
|
||||
// myrot.W = _orientation.w;
|
||||
// myrot.X = _orientation.x;
|
||||
// myrot.Y = _orientation.y;
|
||||
// myrot.Z = _orientation.z;
|
||||
// myrot.X = _orientation.X;
|
||||
// myrot.Y = _orientation.Y;
|
||||
// myrot.Z = _orientation.Z;
|
||||
// d.GeomSetQuaternion(prim_geom, ref myrot);
|
||||
|
||||
// //d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z);
|
||||
@@ -1626,10 +1626,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
setMesh(_parent_scene, mesh);
|
||||
d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
||||
d.Quaternion myrot = new d.Quaternion();
|
||||
myrot.W = _orientation.w;
|
||||
myrot.X = _orientation.x;
|
||||
myrot.Y = _orientation.y;
|
||||
myrot.Z = _orientation.z;
|
||||
myrot.X = _orientation.X;
|
||||
myrot.Y = _orientation.Y;
|
||||
myrot.Z = _orientation.Z;
|
||||
myrot.W = _orientation.W;
|
||||
d.GeomSetQuaternion(prim_geom, ref myrot);
|
||||
|
||||
//d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z);
|
||||
@@ -1684,10 +1684,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
//prim_geom = d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z);
|
||||
d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
||||
d.Quaternion myrot = new d.Quaternion();
|
||||
myrot.W = _orientation.w;
|
||||
myrot.X = _orientation.x;
|
||||
myrot.Y = _orientation.y;
|
||||
myrot.Z = _orientation.z;
|
||||
myrot.X = _orientation.X;
|
||||
myrot.Y = _orientation.Y;
|
||||
myrot.Z = _orientation.Z;
|
||||
myrot.W = _orientation.W;
|
||||
d.GeomSetQuaternion(prim_geom, ref myrot);
|
||||
}
|
||||
}
|
||||
@@ -1726,9 +1726,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
// d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
||||
// d.Quaternion myrot = new d.Quaternion();
|
||||
// myrot.W = _orientation.w;
|
||||
// myrot.X = _orientation.x;
|
||||
// myrot.Y = _orientation.y;
|
||||
// myrot.Z = _orientation.z;
|
||||
// myrot.X = _orientation.X;
|
||||
// myrot.Y = _orientation.Y;
|
||||
// myrot.Z = _orientation.Z;
|
||||
// d.GeomSetQuaternion(prim_geom, ref myrot);
|
||||
|
||||
// //d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z);
|
||||
@@ -2106,9 +2106,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
_acceleration.Z = 0;
|
||||
|
||||
//_orientation.w = 0f;
|
||||
//_orientation.x = 0f;
|
||||
//_orientation.y = 0f;
|
||||
//_orientation.z = 0f;
|
||||
//_orientation.X = 0f;
|
||||
//_orientation.Y = 0f;
|
||||
//_orientation.Z = 0f;
|
||||
m_rotationalVelocity.X = 0;
|
||||
m_rotationalVelocity.Y = 0;
|
||||
m_rotationalVelocity.Z = 0;
|
||||
@@ -2154,10 +2154,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
}
|
||||
|
||||
//System.Console.WriteLine("ODE: " + m_rotationalVelocity.ToString());
|
||||
_orientation.w = ori.W;
|
||||
_orientation.x = ori.X;
|
||||
_orientation.y = ori.Y;
|
||||
_orientation.z = ori.Z;
|
||||
_orientation.X = ori.X;
|
||||
_orientation.Y = ori.Y;
|
||||
_orientation.Z = ori.Z;
|
||||
_orientation.W = ori.W;
|
||||
m_lastUpdateSent = false;
|
||||
if (!m_throttleUpdates || throttleCounter > _parent_scene.geomUpdatesPerThrottledUpdate)
|
||||
{
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using Axiom.Math;
|
||||
using Nini.Config;
|
||||
using NUnit.Framework;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
PrimitiveBaseShape newcube = PrimitiveBaseShape.CreateBox();
|
||||
PhysicsVector position = new PhysicsVector(128, 128, 128);
|
||||
PhysicsVector size = new PhysicsVector(0.5f, 0.5f, 0.5f);
|
||||
Quaternion rot = new Quaternion(1, 0, 0, 0);
|
||||
Quaternion rot = Quaternion.Identity;
|
||||
PhysicsActor prim = ps.AddPrimShape("CoolShape", newcube, position, size, rot, true);
|
||||
OdePrim oprim = (OdePrim)prim;
|
||||
OdeScene pscene = (OdeScene) ps;
|
||||
|
||||
@@ -31,13 +31,12 @@ using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.IO;
|
||||
using Axiom.Math;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using Ode.NET;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
using libsecondlife;
|
||||
using OpenMetaverse;
|
||||
|
||||
//using OpenSim.Region.Physics.OdePlugin.Meshing;
|
||||
|
||||
@@ -1129,11 +1128,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
siz.X = size.X;
|
||||
siz.Y = size.Y;
|
||||
siz.Z = size.Z;
|
||||
Quaternion rot = new Quaternion();
|
||||
rot.w = rotation.w;
|
||||
rot.x = rotation.x;
|
||||
rot.y = rotation.y;
|
||||
rot.z = rotation.z;
|
||||
Quaternion rot = rotation;
|
||||
|
||||
OdePrim newPrim;
|
||||
lock (OdeLock)
|
||||
@@ -1524,8 +1519,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
// but we still need to check for sculptie meshing being enabled so this is the most
|
||||
// convenient place to do it for now...
|
||||
|
||||
// //if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle && pbs.ProfileCurve == (byte)LLObject.ProfileCurve.Circle && pbs.PathScaleY <= 0.75f)
|
||||
// //Console.WriteLine("needsMeshing: " + " pathCurve: " + pbs.PathCurve.ToString() + " profileCurve: " + pbs.ProfileCurve.ToString() + " pathScaleY: " + LLObject.UnpackPathScale(pbs.PathScaleY).ToString());
|
||||
// //if (pbs.PathCurve == (byte)Primitive.PathCurve.Circle && pbs.ProfileCurve == (byte)Primitive.ProfileCurve.Circle && pbs.PathScaleY <= 0.75f)
|
||||
// //Console.WriteLine("needsMeshing: " + " pathCurve: " + pbs.PathCurve.ToString() + " profileCurve: " + pbs.ProfileCurve.ToString() + " pathScaleY: " + Primitive.UnpackPathScale(pbs.PathScaleY).ToString());
|
||||
if (pbs.SculptEntry && !meshSculptedPrim)
|
||||
{
|
||||
return false;
|
||||
@@ -1555,19 +1550,19 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
// return true;
|
||||
|
||||
// // test for torus
|
||||
// if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle
|
||||
// && (pbs.ProfileCurve & 0x07) == (byte)LLObject.ProfileCurve.Circle
|
||||
// && LLObject.UnpackPathScale(pbs.PathScaleY) <= 0.75f)
|
||||
// if (pbs.PathCurve == (byte)Primitive.PathCurve.Circle
|
||||
// && (pbs.ProfileCurve & 0x07) == (byte)Primitive.ProfileCurve.Circle
|
||||
// && Primitive.UnpackPathScale(pbs.PathScaleY) <= 0.75f)
|
||||
// return true;
|
||||
|
||||
// // test for tube
|
||||
// if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle
|
||||
// && (pbs.ProfileCurve & 0x07) == (byte)LLObject.ProfileCurve.EqualTriangle)
|
||||
// if (pbs.PathCurve == (byte)Primitive.PathCurve.Circle
|
||||
// && (pbs.ProfileCurve & 0x07) == (byte)Primitive.ProfileCurve.EqualTriangle)
|
||||
// return true;
|
||||
|
||||
// // test for ring
|
||||
// if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle
|
||||
// && (pbs.ProfileCurve & 0x07) == (byte)LLObject.ProfileCurve.EqualTriangle)
|
||||
// if (pbs.PathCurve == (byte)Primitive.PathCurve.Circle
|
||||
// && (pbs.ProfileCurve & 0x07) == (byte)Primitive.ProfileCurve.EqualTriangle)
|
||||
// return true;
|
||||
|
||||
// if (pbs.ProfileShape == ProfileShape.EquilateralTriangle)
|
||||
@@ -2132,17 +2127,17 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
d.Matrix3 R = new d.Matrix3();
|
||||
|
||||
Quaternion q1 = Quaternion.FromAngleAxis(1.5707f, new Vector3(1, 0, 0));
|
||||
Quaternion q2 = Quaternion.FromAngleAxis(1.5707f, new Vector3(0, 1, 0));
|
||||
Quaternion q1 = Quaternion.CreateFromAxisAngle(new Vector3(1, 0, 0), 1.5707f);
|
||||
Quaternion q2 = Quaternion.CreateFromAxisAngle(new Vector3(0, 1, 0), 1.5707f);
|
||||
//Axiom.Math.Quaternion q3 = Axiom.Math.Quaternion.FromAngleAxis(3.14f, new Axiom.Math.Vector3(0, 0, 1));
|
||||
|
||||
q1 = q1*q2;
|
||||
//q1 = q1 * q3;
|
||||
Vector3 v3 = new Vector3();
|
||||
float angle = 0;
|
||||
q1.ToAngleAxis(ref angle, ref v3);
|
||||
Vector3 v3;
|
||||
float angle;
|
||||
q1.GetAxisAngle(out v3, out angle);
|
||||
|
||||
d.RFromAxisAndAngle(out R, v3.x, v3.y, v3.z, angle);
|
||||
d.RFromAxisAndAngle(out R, v3.X, v3.Y, v3.Z, angle);
|
||||
d.GeomSetRotation(LandGeom, ref R);
|
||||
d.GeomSetPosition(LandGeom, 128, 128, 0);
|
||||
}
|
||||
@@ -2197,17 +2192,17 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
d.Matrix3 R = new d.Matrix3();
|
||||
|
||||
Quaternion q1 = Quaternion.FromAngleAxis(1.5707f, new Vector3(1, 0, 0));
|
||||
Quaternion q2 = Quaternion.FromAngleAxis(1.5707f, new Vector3(0, 1, 0));
|
||||
Quaternion q1 = Quaternion.CreateFromAxisAngle(new Vector3(1, 0, 0), 1.5707f);
|
||||
Quaternion q2 = Quaternion.CreateFromAxisAngle(new Vector3(0, 1, 0), 1.5707f);
|
||||
//Axiom.Math.Quaternion q3 = Axiom.Math.Quaternion.FromAngleAxis(3.14f, new Axiom.Math.Vector3(0, 0, 1));
|
||||
|
||||
q1 = q1 * q2;
|
||||
//q1 = q1 * q3;
|
||||
Vector3 v3 = new Vector3();
|
||||
float angle = 0;
|
||||
q1.ToAngleAxis(ref angle, ref v3);
|
||||
Vector3 v3;
|
||||
float angle;
|
||||
q1.GetAxisAngle(out v3, out angle);
|
||||
|
||||
d.RFromAxisAndAngle(out R, v3.x, v3.y, v3.z, angle);
|
||||
d.RFromAxisAndAngle(out R, v3.X, v3.Y, v3.Z, angle);
|
||||
d.GeomSetRotation(WaterGeom, ref R);
|
||||
d.GeomSetPosition(WaterGeom, 128, 128, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user