mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
Add a OS_NPC_LAND_AT_TARGET option to osMoveToTarget()
Default for this function is now not to automatically land. This allows better control by scripts when an avatar is going to be landing on a prim rather than the ground. Stopping the avatar involves faking a collision, to avoid the pid controller making it overshoot. A better approach would be to gradually slow the avatar as we near the target
This commit is contained in:
@@ -113,7 +113,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
||||
Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos));
|
||||
|
||||
Vector3 targetPos = startPos + new Vector3(0, 0, 10);
|
||||
npcModule.MoveToTarget(npc.UUID, scene, targetPos, false);
|
||||
npcModule.MoveToTarget(npc.UUID, scene, targetPos, false, false);
|
||||
|
||||
Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos));
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
||||
// Try a second movement
|
||||
startPos = npc.AbsolutePosition;
|
||||
targetPos = startPos + new Vector3(10, 0, 0);
|
||||
npcModule.MoveToTarget(npc.UUID, scene, targetPos, false);
|
||||
npcModule.MoveToTarget(npc.UUID, scene, targetPos, false, false);
|
||||
|
||||
scene.Update();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user