LlSetRegionPos/ja

From Second Life Wiki
Jump to navigation Jump to search

要約

関数: integer llSetRegionPos( vector position );

Tries to move the entire object so that the root prim is within 0.1m of position.
boolean, TRUE if the object is successfully placed within 0.1 m of position, FALSE otherwise. See #Specification for details.を integer で返します。

• vector position position in region coordinates

Only if TRUE is returned does the object move, if FALSE is returned, the object does not change position.

仕様

The object with the script will move the root prim position to the given location. The position is any position within the region. If the position is below ground, it will be set to the ground level at that X,Y spot. The function has no delay or throttle.

  • Returns TRUE if the object is successfully placed within 0.1 m of position.
  • Returns FALSE and does not move the object if...
    • position is more than 10m off region or above 4096m.
      • The x & y components of position must be in the range [-10.0, 266.0].[1]
      • The z component must be in the range [0.0, 4096].
    • the object is dynamic (has physics enabled).
    • the object can not move to position due to parcel/region restrictions (object entry rules, prim limits, bans, etc).
    • the object is an avatar attachment.
  • Returns FALSE and moves the object if the z position is below the ground .

サンプル

default
{
    touch_start(integer num_detected)
    {
        vector currentPosition = llGetPos();

        // check whether the object has successfully been moved
        // to the center of the sim at the same height
        integer hasMoved = llSetRegionPos(<128.0, 128.0, currentPosition.z>);

        if (hasMoved)
        {
            llOwnerSay("My new position is now:\n"
                + "http://maps.secondlife.com/secondlife/" + llEscapeURL(llGetRegionName())
                + "/128/128/" + (string)llRound(currentPosition.z) + "/");
        }
        else if ( currentPosition.z < llGround(ZERO_VECTOR) )
        {
            llOwnerSay("My new position is now:\n"
                + "http://maps.secondlife.com/secondlife/" + llEscapeURL(llGetRegionName())
                + "/128/128/" + (string)llCeil(llGround(ZERO_VECTOR)) + "/");
        }
        else
            llOwnerSay("Move was not possible!");
    }
}

注意点

This function is intended to replace WarpPos.

関連項目

関数

•  llGetLocalPos Returns the prim's local position if it is attached or non-root (otherwise it returns the global position)
•  llGetRootPosition Gets the root prims position
•  llGetPos Returns the prim's global position, even if it is attached or non-root
•  llSetPos
•  llEdgeOfWorld

特記事項

経緯

  • New LSL function integer llSetRegionPos(vector position) in Second Life Server 12.01.24.248357
    The object with the script will move the root prim position to the given location. The position is any position within the region. If the position is below ground, it will be set to the ground level at that X,Y spot. The function has no delay or throttle.
    • Returns 1 if the object is successfully placed within 0.1 m of position.
    • Returns 0 and does not move the object if position is more than 10m off region or above 4096m.
    • Returns 0 and does not move the object if the object is dynamic (has physics enabled).
    • Returns 0 and does not move the object if the object can not move to position due to object entry rules, prim limits, bans, etc.
Search JIRA for related Issues

脚注

  1. ^ 記事中の範囲は、 実数空間 に記載されているものです。

Signature

function integer llSetRegionPos( vector position );
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。