diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/NHibernate/LLQuaternionUserType.cs | 15 |
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 | ||
28 | using System; | 28 | using System; |
29 | using System.Data; | 29 | using System.Data; |
30 | using libsecondlife; | 30 | using OpenMetaverse; |
31 | using NHibernate; | 31 | using NHibernate; |
32 | using NHibernate.SqlTypes; | 32 | using NHibernate.SqlTypes; |
33 | using NHibernate.UserTypes; | 33 | using NHibernate.UserTypes; |
@@ -35,7 +35,7 @@ using NHibernate.UserTypes; | |||
35 | namespace OpenSim.Data.NHibernate | 35 | namespace 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 |