mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
Add physDisableDeactivation() LSL function to ExtendedPhysics.
Add implementation of physDisableDeactivation to BulletSim.
This commit is contained in:
@@ -67,6 +67,8 @@ namespace OpenSim.Region.PhysicsModule.BulletS
|
||||
public const string PhysFunctChangeLinkParams = "BulletSim.ChangeLinkParams";
|
||||
public const string PhysFunctAxisLockLimits = "BulletSim.AxisLockLimits";
|
||||
|
||||
public const string PhysFunctDisableDeactivation = "BulletSim.DisableDeactivation";
|
||||
|
||||
// =============================================================
|
||||
|
||||
private IConfig Configuration { get; set; }
|
||||
@@ -138,6 +140,9 @@ namespace OpenSim.Region.PhysicsModule.BulletS
|
||||
}
|
||||
|
||||
// Register as LSL functions all the [ScriptInvocation] marked methods.
|
||||
// NOTE: YEngine keeps functions as region specific but constants are global static
|
||||
// so if this is used in multiple regions on a simulator, the constants will
|
||||
// show up as being redefined.
|
||||
Comms.RegisterScriptInvocations(this);
|
||||
Comms.RegisterConstants(this);
|
||||
|
||||
@@ -176,6 +181,26 @@ namespace OpenSim.Region.PhysicsModule.BulletS
|
||||
return ret;
|
||||
}
|
||||
|
||||
[ScriptInvocation]
|
||||
public float physDisableDeactivation(UUID hostId, UUID scriptId, int disable)
|
||||
{
|
||||
int ret = -1;
|
||||
if (!Enabled) return ret;
|
||||
|
||||
if (BaseScene.PhysicsScene != null)
|
||||
{
|
||||
if (GetRootPhysActor(hostId, out PhysicsActor rootPhysActor))
|
||||
{
|
||||
m_log.DebugFormat("{0} physDisableDeactivation: hostId={1}, scriptId={2}, val={3}", LogHeader, hostId, scriptId, disable);
|
||||
object[] parms2 = { rootPhysActor, null, disable };
|
||||
ret = MakeIntError(rootPhysActor.Extension(PhysFunctDisableDeactivation, parms2));
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
// Code for specifying params.
|
||||
// The choice if 14700 is arbitrary and only serves to catch parameter code misuse.
|
||||
[ScriptConstant]
|
||||
|
||||
Reference in New Issue
Block a user