mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 01:35:46 +08:00
* Added specialization of DatabaseMapper, DataReader and ObjectFieldMapper to support LLVector3, LLQuaternion and LLUUID
* Added PrimitiveBaseShapeTableMapper to show how it's done NOTE: Nothing actually works yet - this code should be considered more of educational value until it's all wired together
This commit is contained in:
39
OpenSim/Framework/Data/OpenSimDataReader.cs
Normal file
39
OpenSim/Framework/Data/OpenSimDataReader.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using libsecondlife;
|
||||
using TribalMedia.Framework.Data;
|
||||
|
||||
namespace OpenSim.Framework.Data
|
||||
{
|
||||
public class OpenSimDataReader : DataReader
|
||||
{
|
||||
public OpenSimDataReader(IDataReader source) : base(source)
|
||||
{
|
||||
}
|
||||
|
||||
public LLVector3 GetVector(string s)
|
||||
{
|
||||
float x = GetFloat(s + "X");
|
||||
float y = GetFloat(s + "Y");
|
||||
float z = GetFloat(s + "Z");
|
||||
|
||||
LLVector3 vector = new LLVector3(x, y, z);
|
||||
|
||||
return vector;
|
||||
}
|
||||
|
||||
public LLQuaternion GetQuaternion(string s)
|
||||
{
|
||||
float x = GetFloat(s + "X");
|
||||
float y = GetFloat(s + "Y");
|
||||
float z = GetFloat(s + "Z");
|
||||
float w = GetFloat(s + "W");
|
||||
|
||||
LLQuaternion quaternion = new LLQuaternion(x, y, z, w);
|
||||
|
||||
return quaternion;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user