From 67bbed820290b0307f09f29343e5fc96bdfc669a Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Fri, 28 Dec 2007 05:25:21 +0000 Subject: * Added ability to create new prim on existing prim (rezzing prim from inventory on other prim coming soon). No more new prim buried in the ground by accident. * The prim are at the absolute position of the prim you rezzed it on top of + (0,0,0.5) for now. --- OpenSim/Framework/IClientAPI.cs | 2 +- OpenSim/Framework/Util.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 8ef5576..9072035 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -332,7 +332,7 @@ namespace OpenSim.Framework public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client); - public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape); + public delegate void AddNewPrim(LLUUID ownerID, LLVector3 RayEnd, LLQuaternion rot, PrimitiveBaseShape shape, byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID, byte RayEndIsIntersection); public delegate void RequestGodlikePowers(LLUUID AgentID, LLUUID SessionID, LLUUID token, IClientAPI remote_client); diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 3654a7d..e6512c2 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -46,6 +46,8 @@ namespace OpenSim.Framework private static object XferLock = new object(); private static Dictionary capsURLS = new Dictionary(); + #region Vector Equasions + public static double GetDistanceTo(LLVector3 a, LLVector3 b) { float dx = a.X - b.X; @@ -53,6 +55,16 @@ namespace OpenSim.Framework float dz = a.Z - b.Z; return Math.Sqrt(dx*dx + dy*dy + dz*dz); } + public static double GetMagnitude(LLVector3 a) { + return Math.Sqrt((a.X * a.X) + (a.Y * a.Y) + (a.Z * a.Z)); + } + public static LLVector3 GetNormal(LLVector3 a) + { + float Mag = (float)GetMagnitude(a); + return new LLVector3(a.X / Mag, a.Y / Mag, a.Z / Mag); + + } + # endregion public static ulong UIntsToLong(uint X, uint Y) { -- cgit v1.1