refactor: Use LSL_Vector(Vector3) constructor in llGetCenterOfMass()
parent
6ed5561057
commit
078617cff4
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue