• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: SVC-129
Type: New Feature New Feature
Status: Reopened Reopened
Priority: Normal Normal
Assignee: Unassigned
Reporter: Dirty McLean
Votes: 16
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
2. Second Life Service - SVC

Need PRIM_LOCAL_ROTATION and PRIM_LOCAL_POSITION to complement llGetLocalRot() and llGetLocalPos()

Created: 24/Apr/07 07:43 AM   Updated: 20/Sep/08 08:27 PM
Return to search
Component/s: Performance, Scripts
Affects Version/s: None
Fix Version/s: None

Environment: All
Issue Links:
Duplicate
 
Relates


 Description  « Hide
Please note the difference between llGet* and llSet* in the following explaination, to avoid confusion. Also as a foreword to people who have not used these functions, There is an llGetLocalPos and llGetLocalRot, but only an llSetLocalRot (and not llSetLocalPos) because llSetPos already affects child prims' local positions.

Currently, the only way to reliably use a local position (get only) and local rotation (both get and set) is to use separate llGetLocalRot + llGetLocalPos, or llSetLocalRot + llSetPos. There is no PRIM_LOCAL_POSITION or PRIM_LOCAL_ROTATION for use in llGetPrimitiveParams, nor is there PRIM_LOCAL_ROTATION for llSetPrimitiveParams. The two workarounds are as follows, neither of which being an acceptable solution:

1. Use two separate scripts; one for position, another for rotation. Have them trigger on the same link-message. This causes the object to move in close sync uder ideal sim conditions, but has unpredictable results under heavy sim load, and is quite excessive in itself.

2.) Use the position of the root object (llGetRootPosition and llGetRootRotation) to determine the offset of the child and calculate the new PRIM_ROTATION for use in llSetPrimitiveParams. This works only if the object is nonphysical and stationary, since the position the object was in when it calculates is not exactly where it will be when it executes a few milliseconds later.

Since child position/rotation are stored locally (in relation to the root prim) anyway, adding PRIM_LOCAL_ROTATION and PRIM_LOCAL_POSITION for use in llGetPrimitiveParams should not be a difficult addition. As for llSetPrimitiveParams, since PRIM_POSITION already reads global and sets local, PRIM_LOCAL_POSITION would function identically to PRIM_POSITION when used in llSetPrimitiveParams. PRIM_LOCAL_ROTATION, however, would affect it in the same wa as llSetLocalRot when used in llSetPrimitiveParams.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Lex Neva added a comment - 24/Apr/07 09:40 AM
I'm for this, although it's essentially a paraphrase of SVC-93 and SVC-102.

Strife Onizuka added a comment - 24/Apr/07 08:26 PM
I've been wanting a LOCAL_ROT flag for a long time, the design of the normal ROT flag is crazy. Unlike llSetRot, LL could fix PRIM_ROT by retiring the old flag value and giving PRIM_ROT a new value (which is what they did for PRIM_TYPE).

reminds Lex to vote for it


Lex Neva added a comment - 25/Apr/07 09:08 AM
(oops, thanks, voted)

Holy shit, that's a clever solution I didn't think of, Strife. The old scripts would continue to work with the old PRIM_ROTATION implementation because they still had the old constant value. Newer scripts would use the new method. One caveat: I could see this being HIGHLY confusing if someone recompiled an old script that used the old PRIM_ROTATION and ended up with a script that suddenly stopped working... any solutions to that?


Thraxis Epsilon added a comment - 24/Nov/07 12:08 AM
Same issue as SVC-93, item has appeared several times.