llGetGeometricCenter...
parent
c7c0d5558b
commit
84b5b3e89b
|
@ -4024,13 +4024,25 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (nparts <= 1)
|
if (nparts <= 1)
|
||||||
return gc;
|
return gc;
|
||||||
|
|
||||||
|
Quaternion parentRot = RootPart.RotationOffset;
|
||||||
|
Vector3 pPos;
|
||||||
|
|
||||||
// average all parts positions
|
// average all parts positions
|
||||||
for (int i = 0; i < nparts; i++)
|
for (int i = 0; i < nparts; i++)
|
||||||
gc += parts[i].GetWorldPosition();
|
{
|
||||||
|
// do it directly
|
||||||
|
// gc += parts[i].GetWorldPosition();
|
||||||
|
if (parts[i] != RootPart)
|
||||||
|
{
|
||||||
|
pPos = parts[i].OffsetPosition;
|
||||||
|
gc += pPos;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
gc /= nparts;
|
gc /= nparts;
|
||||||
|
|
||||||
// relative to root:
|
// relative to root:
|
||||||
gc -= AbsolutePosition;
|
// gc -= AbsolutePosition;
|
||||||
return gc;
|
return gc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8527,7 +8527,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
public LSL_Vector llGetGeometricCenter()
|
public LSL_Vector llGetGeometricCenter()
|
||||||
{
|
{
|
||||||
return new LSL_Vector(m_host.GetGeometricCenter().X, m_host.GetGeometricCenter().Y, m_host.GetGeometricCenter().Z);
|
Vector3 tmp = m_host.GetGeometricCenter();
|
||||||
|
return new LSL_Vector(tmp.X, tmp.Y, tmp.Z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_List llGetPrimitiveParams(LSL_List rules)
|
public LSL_List llGetPrimitiveParams(LSL_List rules)
|
||||||
|
|
Loading…
Reference in New Issue