llSetPos() and terrain height
|
Laurie Stilman
Registered User
Join date: 11 Apr 2006
Posts: 45
|
02-03-2010 01:36
I've been scratching my head trying to figure out why the script I wrote to hide my TV will only sink it 3/4 of the way into the floor. I finally realised that llSetPos() (and llSetPrimitiveParams()) will not move the object center below ground height. I don't see any such limitation documented on the LSL wiki for either function. I can set the height to what I need using the edit tools just fine, of course. Note, the distance I'm trying to move the object is less than the 10m limit (just over 5m in fact), and the target position is positive in Z -- in fact, the entire bounding box is above Z=0 at the target position. Is this correct behaviour? If so, where is it documented and how do I get around it? I don't think llMoveToTarget() will work; I'd expect physical movement to respect terrain level, or things would fall through the ground  Am I missing another option? Thanks.
|
Twisted Pharaoh
if ("hello") {"hey hey";}
Join date: 24 Mar 2007
Posts: 315
|
02-03-2010 01:45
I don't think it's object center, it must be related to root prim, so if you change it you might be able to achieve what you are looking for.
|
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
|
02-03-2010 02:56
Try lowering it to 10 meters maybe?
_____________________
My tutes http://www.youtube.com/johanlaurasia
|
Laurie Stilman
Registered User
Join date: 11 Apr 2006
Posts: 45
|
02-03-2010 13:54
From: Twisted Pharaoh I don't think it's object center, it must be related to root prim, so if you change it you might be able to achieve what you are looking for. Object center and root prim center are in the same place -- it's just a hollowed cube filled in with another cube, stretched and flattened into flat-screen TV dimensions. I'll test with a single-prim object to be sure, but I don't think that's it... From: Johan Laurasia Try lowering it to 10 meters maybe? That would put the bottom of the bounding box below Z=0 and, more importantly, not leave the top of the TV poking up where I can touch it again to get it to unhide 
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
02-03-2010 14:25
Three options:
Link an invisible prim to the top of the TV and make it the new root.
Rotate the TV parallel to the ground as you move it down to get it closer to the ground and hopefully below your floor.
Dig a hole under the TV.
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-03-2010 16:38
:: wonders what wit thought that limiting all set position calls to the ground height was a good idea.... but has no issue with sending it offworld.  ::
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
Twisted Pharaoh
if ("hello") {"hey hey";}
Join date: 24 Mar 2007
Posts: 315
|
02-03-2010 17:16
Sim junkyard used to be at 0,0,0, I wonder if it is still the case.
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-03-2010 17:34
From: Twisted Pharaoh Sim junkyard used to be at 0,0,0, I wonder if it is still the case. I think they might have done away with it... I haven't teleported through it in a long time at least... or detected anything in it... could be why certain sim content started getting lost for awhile.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
Laurie Stilman
Registered User
Join date: 11 Apr 2006
Posts: 45
|
02-03-2010 20:44
From: Argent Stonecutter Three options:
Link an invisible prim to the top of the TV and make it the new root.
Rotate the TV parallel to the ground as you move it down to get it closer to the ground and hopefully below your floor.
Dig a hole under the TV. Thanks Argent, I hadn't considered the first of those options, which is definitely the best in this instance. Rotating the TV would be messy in this instance, due to the proximity of other furniture and such and I *really* didn't want to start digging holes (though that was my best plan before your suggestion :0 ) From: Void Singer :: wonders what wit thought that limiting all set position calls to the ground height was a good idea.... but has no issue with sending it offworld. :: Indeed...
|
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
|
02-03-2010 22:46
It's possible to send an object underground... Not easy but possible... Here is a little something.
float Distance = 2.0; // Going down 2 meters
integer isUNDER = FALSE; vector Over; vector Target;
default { state_entry() { llSetStatus(STATUS_PHYSICS, FALSE); llSetBuoyancy(1.0); Over = llGetPos(); } touch_start(integer total) { if (llDetectedKey(0) == llGetOwner()) { if (isUNDER) { llSetStatus(STATUS_PHYSICS, FALSE); llStopMoveToTarget(); llVolumeDetect(FALSE); llSetPos(Over); } else { Over = llGetPos(); llVolumeDetect(TRUE); llSetStatus(STATUS_PHYSICS, TRUE); Target = Over - <0.0, 0.0, Distance>; llMoveToTarget(Target, Distance); llSetTimerEvent(Distance + Distance); } isUNDER = !isUNDER; } } timer() { llSetTimerEvent(0.0); llSetStatus(STATUS_PHYSICS, FALSE); llStopMoveToTarget(); } }
Beware not to send your TV too much underground or it will be returned.
_____________________
It's hard to tell gender from names around here but if you care, Kaluura = he. And I exist elsewhere than in SL but who cares? 
|
Laurie Stilman
Registered User
Join date: 11 Apr 2006
Posts: 45
|
02-04-2010 00:02
Wait, so if I turn physical movement *on* I can make it go below ground where with non-physical movement I can't? I would expect llMoveToTarget() to be interrupted as soon as the bounding box collides with the terrain (and for the TV to go wonky if the terrain wasn't level  so I'll have to try this. If it works, all my expectations about the differences between physical and non-physical movement will need to be reassessed...
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-04-2010 02:09
huh, didn't think of trying physics (although I suppose you could use hover height and phantom with it to work too....)
I do know you used to be able to bury then via edit drag, but I didn't test that, as I figure that would be a little too manual of a solution. I know for certain you can do it by editing the z position so I expect that still works..
ETA: Whoops I skimmed, that's pretty much what Kaluura suggested...
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
02-04-2010 03:58
You can use physics if you're phantom (llVolumeDetect or phantom status) but you're prone to getting it returned for being off-world. Plus it's adding physics load to the sim.
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-04-2010 04:35
From: Argent Stonecutter You can use physics if you're phantom (llVolumeDetect or phantom status) but you're prone to getting it returned for being off-world. Plus it's adding physics load to the sim. shouldn't be much load if it's phantom... no collisions (volume detect however will trigger extra events for anyhing it passes through, pretty sure object that go through it's center count as well as object centers that pass through it, but I'd have to test the first case...)
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
02-04-2010 05:26
From: Void Singer shouldn't be much load if it's phantom... No, not much load, but some... and because it's phantom and dynamically supported by force or bouyancy it will never get optimized out the way physical objects at rest on a surface do. And it's an unnecessary load. Oh, while I think of it, there's also the option of leaving the TV where it is and just setting all faces to 100% alpha.
|
Laurie Stilman
Registered User
Join date: 11 Apr 2006
Posts: 45
|
02-04-2010 10:21
I'll certainly try out the physical movement options; Kaluura's suggestion seems the most promising if I don't want an extra prim in the mix. Some of the subsequent comments make me wonder if the TV will just 'pop up' again as soon as I turn physics off, but I'll have to test to find out I guess. Setting transparent textures wont work in this case since I didn't make the TV and thus don't have the textures to restore when it needs to be visible :-}
|
Pete Olihenge
Registered User
Join date: 9 Nov 2009
Posts: 315
|
02-04-2010 10:29
I think Argent is suggesting setting the transparency using llSetAlpha or llSetPrimitiveParams (and their link siblings) rather than using a transparent texture.
And maybe you could send it upwards with one of the WarpPos functions?
|
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
|
02-04-2010 10:31
Well, it's a fact, so it'd be good to document.
I've noticed this with MLP et. al -- a pose set that works fine on a mattress has some bad poses when put on a prim that's flat on the ground, because for those poses one or more of the balls would go below ground level. Instead they stay just above it.
|
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
|
02-04-2010 13:38
Come on! It doesn't register on the Statistic bar... And it stays physical only 2 seconds for each meter it has to go down. 2 meters, 4 seconds. After that, it's non-physical under ground. Zero lag. An avatar creates more lag when they walks.
_____________________
It's hard to tell gender from names around here but if you care, Kaluura = he. And I exist elsewhere than in SL but who cares? 
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
02-04-2010 13:43
From: Kaluura Boa It's hard to tell gender from names around here but if you care, Kaluura = he. And I exist elsewhere than in SL but who cares? LOL ..... Did you just change your signature, Kaluura, or have I not been paying attention? We're twins! 
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
02-04-2010 13:46
From: Kaluura Boa Come on! It doesn't register on the Statistic bar... And it stays physical only 2 seconds for each meter it has to go down. 2 meters, 4 seconds. After that, it's non-physical under ground. If it's non-physical underground it's going to go offworld and be returned.
|
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
|
02-04-2010 13:46
The best way to hide it is, as mentioned above, use llSetAlpha() to make it transparent. Then you can still easily click it to make it show. The main disadvantage is not being able to put something in the same space that's clickable.
|
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
|
02-04-2010 13:56
@Rolig: Yes, I copied your signature over a month ago...  Somebody said "she" about me. @Argent: No, it won't go off-world just because it's not physical underground. Just test my script and you'll see for yourself. You just have to be careful not to go too deep or else it will be returned... as I said under my script.
_____________________
It's hard to tell gender from names around here but if you care, Kaluura = he. And I exist elsewhere than in SL but who cares? 
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
02-04-2010 14:10
From: Kaluura Boa No, it won't go off-world just because it's not physical underground. Just test my script and you'll see for yourself. You just have to be careful not to go too deep or else it will be returned... as I said under my script. I wouldn't trust it to remain. It might be returned on a sim restart. It might be returned on a server update. You're poking around in "obscure borderline behavior", and nothing is ruled out.
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
02-04-2010 14:15
 I'm always having to dig out non-physical junk that people have buried below ground on our sims. I've found stuff that was created ages ago and has survived many sim restarts.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|