Anonymous | Login | Signup for a new account | 2021-01-28 05:04 PST | ![]() |
Main | My View | View Issues | Change Log | Roadmap | Summary | My Account |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||
0005947 | opensim | [REGION] Script Functions | public | 2012-03-27 18:06 | 2012-04-06 12:36 | |||||
Reporter | kevinbuckley70 | |||||||||
Assigned To | ||||||||||
Priority | high | Severity | major | Reproducibility | always | |||||
Status | new | Resolution | open | |||||||
Platform | Operating System | Operating System Version | ||||||||
Product Version | ||||||||||
Target Version | Fixed in Version | |||||||||
Summary | 0005947: llMoveToTarget() or llTarget() misbehave when linked to other prims | |||||||||
Description | If you use llMoveToTarget() to move a physical object up & down, & use llTarget to know when it's there, this stops working when you link an additional prim. Either llMoveToTarget uses the wrong linkset vector OR llTarget does (or the physics just doesn't have enough energy to get there!) - in any case, in the upwards direction, the linkset falls short of the scripted target & at_target() event never triggers. | |||||||||
Steps To Reproduce | Create a prim (size 4x4x0.5) & put the below script into it. Watch it successfully move up & down every 5 seconds. Create another prim (size 2x2x2) & link it 1m above the centre of the previous prim so the previous prim is root. Now, the linkset never reaches the vector specified in llMoveToTarget(). It CAN be triggered by editing the linkset & manually nudging it. Script for test: float atTargetDelta = 0.1; vector initialPosition; rotation initialRotation; integer targetHandle; integer down; default { on_rez(integer channel) { llResetScript(); } state_entry() { llSetStatus(STATUS_PHYSICS, FALSE); initialPosition = llGetPos(); initialRotation = llGetRot(); down = TRUE; state waiting; } } state waiting { on_rez(integer channel) { llResetScript(); } state_entry() { llSetTimerEvent(5.0); } timer() { llSetTimerEvent(0.0); if (down) { state goUpPhysical; } else { state goDownPhysical; } } } state goUpPhysical { on_rez(integer channel) { llResetScript(); } state_entry() { llOwnerSay("Target position = " + (string)(initialPosition + <0.0, 0.0, 10.0>)); llSetTimerEvent(0.5); targetHandle = llTarget(initialPosition + <0.0, 0.0, 10.0>, atTargetDelta); llSetStatus(STATUS_PHYSICS, TRUE); llSetStatus(STATUS_ROTATE_X| STATUS_ROTATE_Y| STATUS_ROTATE_Z, FALSE);// Stop it tilting (doesnt work btw!!) llMoveToTarget(initialPosition + <0.0, 0.0, 10.0>, 0.2); } timer() { llOwnerSay("Current position = " + (string)llGetPos()); } at_target(integer tnum, vector targetpos, vector ourpos) { llTargetRemove(tnum);// Ensure the correct handle is cleared!! llStopMoveToTarget(); llSetTimerEvent(0.0); llSetStatus(STATUS_PHYSICS, FALSE); llOwnerSay("At target (up)"); llSetPos(initialPosition + <0.0, 0.0, 10.0>); llSetRot(initialRotation); down = FALSE; state waiting; } } state goDownPhysical { on_rez(integer channel) { llResetScript(); } state_entry() { llOwnerSay("Target position = " + (string)(initialPosition)); llSetTimerEvent(0.5); targetHandle = llTarget(initialPosition, atTargetDelta); llSetStatus(STATUS_PHYSICS, TRUE); llSetStatus(STATUS_ROTATE_X| STATUS_ROTATE_Y| STATUS_ROTATE_Z, FALSE);// Stop it tilting (doesnt work btw!!) llMoveToTarget(initialPosition, 0.2); } timer() { llOwnerSay("Current position = " + (string)llGetPos()); } at_target(integer tnum, vector targetpos, vector ourpos) { llTargetRemove(tnum);// Ensure the correct handle is cleared!! llStopMoveToTarget(); llSetTimerEvent(0.0); llSetStatus(STATUS_PHYSICS, FALSE); llOwnerSay("At target (down)"); llSetPos(initialPosition); llSetRot(initialRotation); down = TRUE; state waiting; } } | |||||||||
Tags | No tags attached. | |||||||||
Git Revision or version number | 0.7.2 release | |||||||||
Run Mode | Standalone (Multiple Regions) | |||||||||
Physics Engine | ODE | |||||||||
Script Engine | ||||||||||
Environment | Mono / Windows | |||||||||
Mono Version | None | |||||||||
Viewer | Imprudence | |||||||||
Attached Files | ||||||||||
![]() |
|||
Date Modified | Username | Field | Change |
2012-03-27 18:06 | kevinbuckley70 | New Issue | |
2012-04-06 12:36 | justincc | Relationship added | related to 0005954 |
2012-04-06 12:37 | justincc | Relationship deleted | related to 0005954 |
Copyright © 2000 - 2012 MantisBT Group |