mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
fix llGetCenterOfMass ( checked with ubitODE only)
This commit is contained in:
@@ -1865,7 +1865,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
if ((!isPhantom || isPhysical || _VolumeDetectActive) && !ParentGroup.IsAttachment
|
||||
&& !(Shape.PathCurve == (byte)Extrusion.Flexible))
|
||||
AddToPhysics(isPhysical, isPhantom, building, true);
|
||||
AddToPhysics(isPhysical, isPhantom, building, isPhysical);
|
||||
else
|
||||
PhysActor = null; // just to be sure
|
||||
}
|
||||
@@ -2308,7 +2308,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
*/
|
||||
}
|
||||
|
||||
public float GetMass()
|
||||
public float GetMass()
|
||||
{
|
||||
PhysicsActor pa = PhysActor;
|
||||
|
||||
@@ -2318,6 +2318,40 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Vector3 GetCenterOfMass()
|
||||
{
|
||||
if (ParentGroup.RootPart == this)
|
||||
{
|
||||
if (ParentGroup.IsDeleted)
|
||||
return AbsolutePosition;
|
||||
return ParentGroup.GetCenterOfMass();
|
||||
}
|
||||
|
||||
PhysicsActor pa = PhysActor;
|
||||
|
||||
if (pa != null)
|
||||
{
|
||||
Vector3 tmp = pa.CenterOfMass;
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
return AbsolutePosition;
|
||||
}
|
||||
|
||||
public Vector3 GetPartCenterOfMass()
|
||||
{
|
||||
PhysicsActor pa = PhysActor;
|
||||
|
||||
if (pa != null)
|
||||
{
|
||||
Vector3 tmp = pa.CenterOfMass;
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
return AbsolutePosition;
|
||||
}
|
||||
|
||||
|
||||
public Vector3 GetForce()
|
||||
{
|
||||
return Force;
|
||||
@@ -4802,7 +4836,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
Velocity = velocity;
|
||||
AngularVelocity = rotationalVelocity;
|
||||
pa.Velocity = velocity;
|
||||
// pa.Velocity = velocity;
|
||||
pa.RotationalVelocity = rotationalVelocity;
|
||||
|
||||
// if not vehicle and root part apply force and torque
|
||||
|
||||
Reference in New Issue
Block a user