refactor: Use LSL_Vector(Vector3) constructor in llGetCenterOfMass()

0.7.4-extended
Justin Clark-Casey (justincc) 2013-03-14 22:14:32 +00:00
parent 6ed5561057
commit 078617cff4
2 changed files with 12 additions and 2 deletions

View File

@ -1949,6 +1949,16 @@ namespace OpenSim.Region.Framework.Scenes
{
PhysicsActor pa = PhysActor;
if (pa != null)
return new Vector3(pa.GeometricCenter.X, pa.GeometricCenter.Y, pa.GeometricCenter.Z);
else
return new Vector3(0, 0, 0);
}
public Vector3 GetCenterOfMass()
{
PhysicsActor pa = PhysActor;
if (pa != null)
return new Vector3(pa.CenterOfMass.X, pa.CenterOfMass.Y, pa.CenterOfMass.Z);
else

View File

@ -4939,8 +4939,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Vector llGetCenterOfMass()
{
m_host.AddScriptLPS(1);
Vector3 center = m_host.GetGeometricCenter();
return new LSL_Vector(center.X,center.Y,center.Z);
return new LSL_Vector(m_host.GetCenterOfMass());
}
public LSL_List llListSort(LSL_List src, int stride, int ascending)