BulletSim: add extended physics function physGetLinkType(linkNum). Add implementation of physChangeLinkParams() in BSLinksetConstraint.

This commit is contained in:
Robert Adams
2013-08-16 13:44:31 -07:00
parent 8755aeb348
commit e1120cb74d
4 changed files with 164 additions and 24 deletions

View File

@@ -64,6 +64,7 @@ public class ExtendedPhysics : INonSharedRegionModule
public const string PhysFunctSetLinksetType = "BulletSim.SetLinksetType";
public const string PhysFunctChangeLinkFixed = "BulletSim.ChangeLinkFixed";
public const string PhysFunctChangeLinkType = "BulletSim.ChangeLinkType";
public const string PhysFunctGetLinkType = "BulletSim.GetLinkType";
public const string PhysFunctChangeLinkParams = "BulletSim.ChangeLinkParams";
// =============================================================
@@ -320,6 +321,24 @@ public class ExtendedPhysics : INonSharedRegionModule
return ret;
}
// physGetLinkType(integer linkNum)
[ScriptInvocation]
public int physGetLinkType(UUID hostID, UUID scriptID, int linkNum, int typeCode)
{
int ret = -1;
if (!Enabled) return ret;
PhysicsActor rootPhysActor;
PhysicsActor childPhysActor;
if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor))
{
ret = MakeIntError(rootPhysActor.Extension(PhysFunctGetLinkType, childPhysActor));
}
return ret;
}
// physChangeLinkFixed(integer linkNum)
// Change the link between the root and the linkNum into a fixed, static physical connection.
[ScriptInvocation]