From: chris yeoh <yeohc@au1.ibm.com>
The attached patch fixes mantis bug 2312 (llGetPos() returns incorrect values for child prims where the root prim is rotated). Regression tests still pass. Incidentally AbsolutePosition which was used before looks a little suspicious to me as its always going to return the wrong value if the root prim is rotated. GetWorldPosition does take the rotation into account, but AbsolutePosition is used in a lot of places. Though i don't understand why there is both GetWorldPosition as well as AbsolutePosition so I've left the latter alone. [i also cleaned up some indent problems, --- dr scofield]0.6.0-stable
parent
7d525843d0
commit
e5a50b6a3b
|
@ -1719,9 +1719,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
public LSL_Vector llGetPos()
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
return new LSL_Vector(m_host.AbsolutePosition.X,
|
||||
m_host.AbsolutePosition.Y,
|
||||
m_host.AbsolutePosition.Z);
|
||||
Vector3 pos = m_host.GetWorldPosition();
|
||||
return new LSL_Vector(pos.X, pos.Y, pos.Z);
|
||||
}
|
||||
|
||||
public LSL_Vector llGetLocalPos()
|
||||
|
@ -4856,10 +4855,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
new LSL_Vector(pos.X, pos.Y + 1, pos.Z)
|
||||
));
|
||||
|
||||
Vector3 v0 = new Vector3(
|
||||
p1.X - p0.X, p1.Y - p0.Y, p1.Z - p0.Z);
|
||||
Vector3 v1 = new Vector3(
|
||||
p2.X - p1.X, p2.Y - p1.Y, p2.Z - p1.Z);
|
||||
Vector3 v0 = new Vector3(p1.X - p0.X, p1.Y - p0.Y, p1.Z - p0.Z);
|
||||
Vector3 v1 = new Vector3(p2.X - p1.X, p2.Y - p1.Y, p2.Z - p1.Z);
|
||||
|
||||
v0.Normalize();
|
||||
v1.Normalize();
|
||||
|
|
Loading…
Reference in New Issue