aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/NHibernate/LLQuaternionUserType.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-09-06 07:52:41 +0000
committerTeravus Ovares2008-09-06 07:52:41 +0000
commit7d89e122930be39e84a6d174548fa2d12ac0484a (patch)
treee5aa5752f988a9aba2a969f49e5e208985eda80c /OpenSim/Data/NHibernate/LLQuaternionUserType.cs
parent* minor: speculatively try a change to bamboo.build to see if this generates ... (diff)
downloadopensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.zip
opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.gz
opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.bz2
opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.xz
* 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.
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/NHibernate/LLQuaternionUserType.cs15
1 files changed, 7 insertions, 8 deletions
diff --git a/OpenSim/Data/NHibernate/LLQuaternionUserType.cs b/OpenSim/Data/NHibernate/LLQuaternionUserType.cs
index 80fb9ff..7431433 100644
--- a/OpenSim/Data/NHibernate/LLQuaternionUserType.cs
+++ b/OpenSim/Data/NHibernate/LLQuaternionUserType.cs
@@ -27,7 +27,7 @@
27 27
28using System; 28using System;
29using System.Data; 29using System.Data;
30using libsecondlife; 30using OpenMetaverse;
31using NHibernate; 31using NHibernate;
32using NHibernate.SqlTypes; 32using NHibernate.SqlTypes;
33using NHibernate.UserTypes; 33using NHibernate.UserTypes;
@@ -35,7 +35,7 @@ using NHibernate.UserTypes;
35namespace OpenSim.Data.NHibernate 35namespace OpenSim.Data.NHibernate
36{ 36{
37 [Serializable] 37 [Serializable]
38 public class LLQuaternionUserType: IUserType 38 public class QuaternionUserType: IUserType
39 { 39 {
40 public object Assemble(object cached, object owner) 40 public object Assemble(object cached, object owner)
41 { 41 {
@@ -49,9 +49,8 @@ namespace OpenSim.Data.NHibernate
49 49
50 public object DeepCopy(object quat) 50 public object DeepCopy(object quat)
51 { 51 {
52 // silly libsecondlife having no copy constructor 52 Quaternion q = (Quaternion)quat;
53 LLQuaternion q = (LLQuaternion) quat; 53 return new Quaternion(q);
54 return new LLQuaternion(q.X, q.Y, q.Z, q.W);
55 } 54 }
56 55
57 public object Disassemble(object quat) 56 public object Disassemble(object quat)
@@ -79,14 +78,14 @@ namespace OpenSim.Data.NHibernate
79 int w = rs.GetOrdinal(names[3]); 78 int w = rs.GetOrdinal(names[3]);
80 if (!rs.IsDBNull(x)) 79 if (!rs.IsDBNull(x))
81 { 80 {
82 quat = new LLQuaternion((Single)rs[x], (Single)rs[y], (Single)rs[z], (Single)rs[w]); 81 quat = new Quaternion((Single)rs[x], (Single)rs[y], (Single)rs[z], (Single)rs[w]);
83 } 82 }
84 return quat; 83 return quat;
85 } 84 }
86 85
87 public void NullSafeSet(IDbCommand cmd, object obj, int index) 86 public void NullSafeSet(IDbCommand cmd, object obj, int index)
88 { 87 {
89 LLQuaternion quat = (LLQuaternion)obj; 88 Quaternion quat = (Quaternion)obj;
90 ((IDataParameter)cmd.Parameters[index]).Value = quat.X; 89 ((IDataParameter)cmd.Parameters[index]).Value = quat.X;
91 ((IDataParameter)cmd.Parameters[index + 1]).Value = quat.Y; 90 ((IDataParameter)cmd.Parameters[index + 1]).Value = quat.Y;
92 ((IDataParameter)cmd.Parameters[index + 2]).Value = quat.Z; 91 ((IDataParameter)cmd.Parameters[index + 2]).Value = quat.Z;
@@ -100,7 +99,7 @@ namespace OpenSim.Data.NHibernate
100 99
101 public Type ReturnedType 100 public Type ReturnedType
102 { 101 {
103 get { return typeof(LLQuaternion); } 102 get { return typeof(Quaternion); }
104 } 103 }
105 104
106 public SqlType[] SqlTypes 105 public SqlType[] SqlTypes