change SitTarget calls from functions to properties
parent
de69ecfaae
commit
867d72c956
|
@ -932,18 +932,19 @@ namespace OpenSim.Data.MSSQL
|
|||
);
|
||||
try
|
||||
{
|
||||
prim.SetSitTargetLL(new LLVector3(
|
||||
Convert.ToSingle(row["SitTargetOffsetX"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetY"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetZ"])), new LLQuaternion(
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientX"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientY"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientZ"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientW"])));
|
||||
prim.SitTargetPositionLL = new LLVector3(
|
||||
Convert.ToSingle(row["SitTargetOffsetX"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetY"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetZ"]));
|
||||
prim.SitTargetOrientationLL = new LLQuaternion(
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientX"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientY"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientZ"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientW"]));
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
|
@ -1136,12 +1137,12 @@ namespace OpenSim.Data.MSSQL
|
|||
try
|
||||
{
|
||||
// Sit target
|
||||
LLVector3 sitTargetPos = prim.GetSitTargetPositionLL();
|
||||
LLVector3 sitTargetPos = prim.SitTargetPositionLL;
|
||||
row["SitTargetOffsetX"] = sitTargetPos.X;
|
||||
row["SitTargetOffsetY"] = sitTargetPos.Y;
|
||||
row["SitTargetOffsetZ"] = sitTargetPos.Z;
|
||||
|
||||
LLQuaternion sitTargetOrient = prim.GetSitTargetOrientationLL();
|
||||
LLQuaternion sitTargetOrient = prim.SitTargetOrientationLL;
|
||||
row["SitTargetOrientW"] = sitTargetOrient.W;
|
||||
row["SitTargetOrientX"] = sitTargetOrient.X;
|
||||
row["SitTargetOrientY"] = sitTargetOrient.Y;
|
||||
|
|
|
@ -1314,18 +1314,19 @@ namespace OpenSim.Data.MySQL
|
|||
);
|
||||
try
|
||||
{
|
||||
prim.SetSitTargetLL(new LLVector3(
|
||||
Convert.ToSingle(row["SitTargetOffsetX"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetY"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetZ"])), new LLQuaternion(
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientX"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientY"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientZ"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientW"])));
|
||||
prim.SitTargetPositionLL = new LLVector3(
|
||||
Convert.ToSingle(row["SitTargetOffsetX"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetY"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetZ"]));
|
||||
prim.SitTargetOrientationLL = new LLQuaternion(
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientX"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientY"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientZ"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientW"]));
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
|
@ -1584,12 +1585,12 @@ namespace OpenSim.Data.MySQL
|
|||
try
|
||||
{
|
||||
// Sit target
|
||||
LLVector3 sitTargetPos = prim.GetSitTargetPositionLL();
|
||||
LLVector3 sitTargetPos = prim.SitTargetPositionLL;
|
||||
row["SitTargetOffsetX"] = sitTargetPos.X;
|
||||
row["SitTargetOffsetY"] = sitTargetPos.Y;
|
||||
row["SitTargetOffsetZ"] = sitTargetPos.Z;
|
||||
|
||||
LLQuaternion sitTargetOrient = prim.GetSitTargetOrientationLL();
|
||||
LLQuaternion sitTargetOrient = prim.SitTargetOrientationLL;
|
||||
row["SitTargetOrientW"] = sitTargetOrient.W;
|
||||
row["SitTargetOrientX"] = sitTargetOrient.X;
|
||||
row["SitTargetOrientY"] = sitTargetOrient.Y;
|
||||
|
|
|
@ -992,18 +992,19 @@ namespace OpenSim.Data.SQLite
|
|||
|
||||
try
|
||||
{
|
||||
prim.SetSitTargetLL(new LLVector3(
|
||||
Convert.ToSingle(row["SitTargetOffsetX"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetY"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetZ"])), new LLQuaternion(
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientX"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientY"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientZ"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientW"])));
|
||||
prim.SitTargetPositionLL = new LLVector3(
|
||||
Convert.ToSingle(row["SitTargetOffsetX"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetY"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetZ"]));
|
||||
prim.SitTargetOrientationLL = new LLQuaternion(
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientX"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientY"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientZ"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientW"]));
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
|
@ -1334,12 +1335,12 @@ namespace OpenSim.Data.SQLite
|
|||
row["RotationW"] = prim.RotationOffset.W;
|
||||
|
||||
// Sit target
|
||||
LLVector3 sitTargetPos = prim.GetSitTargetPositionLL();
|
||||
LLVector3 sitTargetPos = prim.SitTargetPositionLL;
|
||||
row["SitTargetOffsetX"] = sitTargetPos.X;
|
||||
row["SitTargetOffsetY"] = sitTargetPos.Y;
|
||||
row["SitTargetOffsetZ"] = sitTargetPos.Z;
|
||||
|
||||
LLQuaternion sitTargetOrient = prim.GetSitTargetOrientationLL();
|
||||
LLQuaternion sitTargetOrient = prim.SitTargetOrientationLL;
|
||||
row["SitTargetOrientW"] = sitTargetOrient.W;
|
||||
row["SitTargetOrientX"] = sitTargetOrient.X;
|
||||
row["SitTargetOrientY"] = sitTargetOrient.Y;
|
||||
|
|
|
@ -1508,28 +1508,6 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
return LLUUID.Zero;
|
||||
}
|
||||
|
||||
public Quaternion GetSitTargetOrientation()
|
||||
{
|
||||
return m_sitTargetOrientation;
|
||||
}
|
||||
|
||||
public LLQuaternion GetSitTargetOrientationLL()
|
||||
{
|
||||
return
|
||||
new LLQuaternion(m_sitTargetOrientation.x, m_sitTargetOrientation.y, m_sitTargetOrientation.z,
|
||||
m_sitTargetOrientation.w);
|
||||
}
|
||||
|
||||
public Vector3 GetSitTargetPosition()
|
||||
{
|
||||
return m_sitTargetPosition;
|
||||
}
|
||||
|
||||
public LLVector3 GetSitTargetPositionLL()
|
||||
{
|
||||
return new LLVector3(m_sitTargetPosition.x, m_sitTargetPosition.y, m_sitTargetPosition.z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method for a prim to get it's world position from the group.
|
||||
/// Remember, the Group Position simply gives the position of the group itself
|
||||
|
@ -2382,23 +2360,23 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
aggregateScriptEvents();
|
||||
}
|
||||
|
||||
public void SetSitTarget(Vector3 offset, Quaternion orientation)
|
||||
{
|
||||
m_sitTargetPosition = offset;
|
||||
m_sitTargetOrientation = orientation;
|
||||
}
|
||||
// public void SetSitTarget(Vector3 offset, Quaternion orientation)
|
||||
// {
|
||||
// m_sitTargetPosition = offset;
|
||||
// m_sitTargetOrientation = orientation;
|
||||
// }
|
||||
|
||||
// Utility function so the databases don't have to reference axiom.math
|
||||
public void SetSitTargetLL(LLVector3 offset, LLQuaternion orientation)
|
||||
{
|
||||
if (
|
||||
!(offset.X == 0 && offset.Y == 0 && offset.Z == 0 && (orientation.W == 0 || orientation.W == 1) &&
|
||||
orientation.X == 0 && orientation.Y == 0 && orientation.Z == 0))
|
||||
{
|
||||
m_sitTargetPosition = new Vector3(offset.X, offset.Y, offset.Z);
|
||||
m_sitTargetOrientation = new Quaternion(orientation.W, orientation.X, orientation.Y, orientation.Z);
|
||||
}
|
||||
}
|
||||
// // Utility function so the databases don't have to reference axiom.math
|
||||
// public void SetSitTargetLL(LLVector3 offset, LLQuaternion orientation)
|
||||
// {
|
||||
// if (
|
||||
// !(offset.X == 0 && offset.Y == 0 && offset.Z == 0 && (orientation.W == 0 || orientation.W == 1) &&
|
||||
// orientation.X == 0 && orientation.Y == 0 && orientation.Z == 0))
|
||||
// {
|
||||
// m_sitTargetPosition = new Vector3(offset.X, offset.Y, offset.Z);
|
||||
// m_sitTargetOrientation = new Quaternion(orientation.W, orientation.X, orientation.Y, orientation.Z);
|
||||
// }
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Set the text displayed for this part.
|
||||
|
|
|
@ -1096,8 +1096,8 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
foreach (SceneObjectPart part in partArray)
|
||||
{
|
||||
// Is a sit target available?
|
||||
Vector3 avSitOffSet = part.GetSitTargetPosition();
|
||||
Quaternion avSitOrientation = part.GetSitTargetOrientation();
|
||||
Vector3 avSitOffSet = part.SitTargetPosition;
|
||||
Quaternion avSitOrientation = part.SitTargetOrientation;
|
||||
LLUUID avOnTargetAlready = part.GetAvatarOnSitTarget();
|
||||
|
||||
bool SitTargetUnOccupied = (!(avOnTargetAlready != LLUUID.Zero));
|
||||
|
@ -1130,8 +1130,8 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
// see http://wiki.secondlife.com/wiki/User:Andrew_Linden/Office_Hours/2007_11_06 for details on how LL does it
|
||||
|
||||
// Is a sit target available?
|
||||
Vector3 avSitOffSet = part.GetSitTargetPosition();
|
||||
Quaternion avSitOrientation = part.GetSitTargetOrientation();
|
||||
Vector3 avSitOffSet = part.SitTargetPosition;
|
||||
Quaternion avSitOrientation = part.SitTargetOrientation;
|
||||
LLUUID avOnTargetAlready = part.GetAvatarOnSitTarget();
|
||||
|
||||
bool SitTargetUnOccupied = (!(avOnTargetAlready != LLUUID.Zero));
|
||||
|
@ -1222,8 +1222,8 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
if (part.GetAvatarOnSitTarget() == UUID)
|
||||
{
|
||||
Vector3 sitTargetPos = part.GetSitTargetPosition();
|
||||
Quaternion sitTargetOrient = part.GetSitTargetOrientation();
|
||||
Vector3 sitTargetPos = part.SitTargetPosition;
|
||||
Quaternion sitTargetOrient = part.SitTargetOrientation;
|
||||
|
||||
//Quaternion vq = new Quaternion(sitTargetPos.x, sitTargetPos.y+0.2f, sitTargetPos.z+0.2f, 0);
|
||||
//Quaternion nq = new Quaternion(sitTargetOrient.w, -sitTargetOrient.x, -sitTargetOrient.y, -sitTargetOrient.z);
|
||||
|
|
|
@ -4494,7 +4494,8 @@ namespace OpenSim.Region.ScriptEngine.Common
|
|||
if (rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0)
|
||||
rot.z = 1; // ZERO_ROTATION = 0,0,0,1
|
||||
|
||||
m_host.SetSitTarget(new Vector3((float)offset.x, (float)offset.y, (float)offset.z), new Quaternion((float)rot.s, (float)rot.x, (float)rot.y, (float)rot.z));
|
||||
m_host.SitTargetPosition = new Vector3((float)offset.x, (float)offset.y, (float)offset.z);
|
||||
m_host.SitTargetOrientation = new Quaternion((float)rot.s, (float)rot.x, (float)rot.y, (float)rot.z);
|
||||
}
|
||||
|
||||
public string llAvatarOnSitTarget()
|
||||
|
|
|
@ -4369,7 +4369,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
if (rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0)
|
||||
rot.z = 1; // ZERO_ROTATION = 0,0,0,1
|
||||
|
||||
m_host.SetSitTarget(new Vector3((float)offset.x, (float)offset.y, (float)offset.z), new Quaternion((float)rot.s, (float)rot.x, (float)rot.y, (float)rot.z));
|
||||
m_host.SitTargetPosition = new Vector3((float)offset.x, (float)offset.y, (float)offset.z);
|
||||
m_host.SitTargetOrientation = new Quaternion((float)rot.s, (float)rot.x, (float)rot.y, (float)rot.z);
|
||||
}
|
||||
|
||||
public string llAvatarOnSitTarget()
|
||||
|
|
|
@ -557,18 +557,19 @@ namespace OpenSim.DataStore.MSSQL
|
|||
|
||||
try
|
||||
{
|
||||
prim.SetSitTargetLL(new LLVector3(
|
||||
Convert.ToSingle(row["SitTargetOffsetX"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetY"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetZ"])), new LLQuaternion(
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientX"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientY"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientZ"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientW"])));
|
||||
prim.SitTargetPositionLL = new LLVector3(
|
||||
Convert.ToSingle(row["SitTargetOffsetX"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetY"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetZ"]));
|
||||
prim.SitTargetOrientationLL = new LLQuaternion(
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientX"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientY"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientZ"]),
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientW"]));
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
|
@ -628,12 +629,12 @@ namespace OpenSim.DataStore.MSSQL
|
|||
try
|
||||
{
|
||||
// Sit target
|
||||
LLVector3 sitTargetPos = prim.GetSitTargetPositionLL();
|
||||
LLVector3 sitTargetPos = prim.SitTargetPositionLL;
|
||||
row["SitTargetOffsetX"] = sitTargetPos.X;
|
||||
row["SitTargetOffsetY"] = sitTargetPos.Y;
|
||||
row["SitTargetOffsetZ"] = sitTargetPos.Z;
|
||||
|
||||
LLQuaternion sitTargetOrient = prim.GetSitTargetOrientationLL();
|
||||
LLQuaternion sitTargetOrient = prim.SitTargetOrientationLL;
|
||||
row["SitTargetOrientW"] = sitTargetOrient.W;
|
||||
row["SitTargetOrientX"] = sitTargetOrient.X;
|
||||
row["SitTargetOrientY"] = sitTargetOrient.Y;
|
||||
|
|
Loading…
Reference in New Issue