llGetMass and llGetObjectMass (and push estimation) always use object mass as in current SL ( push is what makes sense or impulse will depend on what prim it is and not object). Added llGetMassMKS() that just returns 100 x llGetMass() as it seems to be in SL.
parent
ad544bdd3d
commit
87fdb2ed7e
|
@ -3176,15 +3176,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_host.IsRoot)
|
// new SL always returns object mass
|
||||||
{
|
// if (m_host.IsRoot)
|
||||||
|
// {
|
||||||
return m_host.ParentGroup.GetMass();
|
return m_host.ParentGroup.GetMass();
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// return m_host.GetMass();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public LSL_Float llGetMassMKS()
|
||||||
{
|
{
|
||||||
return m_host.GetMass();
|
return 100f * llGetMass();
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void llCollisionFilter(string name, string id, int accept)
|
public void llCollisionFilter(string name, string id, int accept)
|
||||||
|
@ -4959,7 +4966,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
float distance = (PusheePos - m_host.AbsolutePosition).Length();
|
float distance = (PusheePos - m_host.AbsolutePosition).Length();
|
||||||
float distance_term = distance * distance * distance; // Script Energy
|
float distance_term = distance * distance * distance; // Script Energy
|
||||||
float pusher_mass = m_host.GetMass();
|
// use total object mass and not part
|
||||||
|
float pusher_mass = m_host.ParentGroup.GetMass();
|
||||||
|
|
||||||
float PUSH_ATTENUATION_DISTANCE = 17f;
|
float PUSH_ATTENUATION_DISTANCE = 17f;
|
||||||
float PUSH_ATTENUATION_SCALE = 5f;
|
float PUSH_ATTENUATION_SCALE = 5f;
|
||||||
|
@ -9964,9 +9972,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
SceneObjectPart obj = World.GetSceneObjectPart(World.Entities[key].LocalId);
|
SceneObjectPart obj = World.GetSceneObjectPart(World.Entities[key].LocalId);
|
||||||
if (obj != null)
|
if (obj != null)
|
||||||
return (double)obj.GetMass();
|
return (double)obj.GetMass();
|
||||||
|
*/
|
||||||
|
// return total object mass
|
||||||
|
SceneObjectGroup obj = World.GetGroupByPrim(World.Entities[key].LocalId);
|
||||||
|
if (obj != null)
|
||||||
|
return (double)obj.GetMass();
|
||||||
|
|
||||||
// the object is null so the key is for an avatar
|
// the object is null so the key is for an avatar
|
||||||
ScenePresence avatar = World.GetScenePresence(key);
|
ScenePresence avatar = World.GetScenePresence(key);
|
||||||
if (avatar != null)
|
if (avatar != null)
|
||||||
|
|
|
@ -148,6 +148,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
LSL_Vector llGetLocalPos();
|
LSL_Vector llGetLocalPos();
|
||||||
LSL_Rotation llGetLocalRot();
|
LSL_Rotation llGetLocalRot();
|
||||||
LSL_Float llGetMass();
|
LSL_Float llGetMass();
|
||||||
|
LSL_Float llGetMassMKS();
|
||||||
void llGetNextEmail(string address, string subject);
|
void llGetNextEmail(string address, string subject);
|
||||||
LSL_String llGetNotecardLine(string name, int line);
|
LSL_String llGetNotecardLine(string name, int line);
|
||||||
LSL_Key llGetNumberOfNotecardLines(string name);
|
LSL_Key llGetNumberOfNotecardLines(string name);
|
||||||
|
|
|
@ -581,6 +581,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
return m_LSL_Functions.llGetMass();
|
return m_LSL_Functions.llGetMass();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LSL_Float llGetMassMKS()
|
||||||
|
{
|
||||||
|
return m_LSL_Functions.llGetMassMKS();
|
||||||
|
}
|
||||||
|
|
||||||
public void llGetNextEmail(string address, string subject)
|
public void llGetNextEmail(string address, string subject)
|
||||||
{
|
{
|
||||||
m_LSL_Functions.llGetNextEmail(address, subject);
|
m_LSL_Functions.llGetNextEmail(address, subject);
|
||||||
|
|
Loading…
Reference in New Issue