mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 09:16:28 +08:00
Have SOP and LSL_Api call the proper GetCenterOfMass and GetGeometricCenter
routines on the physics engine. Won't make a difference for any existing scripts since ODE always returned Vector3.Zero.
This commit is contained in:
@@ -1951,6 +1951,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
|
||||
|
||||
Reference in New Issue
Block a user