Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Physical prims questions

Kincade Spad
Registered User
Join date: 27 Jan 2008
Posts: 8
04-22-2008 09:21
Caution: newbie questions ahead lol

I'm trying to figure out how to "pin" a physical prim in the air, or is it even possible. Reason: to make a triangle prim rotate and turn another physical triangle prim when it hits it, kinda like 2 gears. When the first one turns, it rotates the second one (which doesn't have a rotate script). Can't find anything in the forums or Wiki about if this is possible.

And, when i create a ring in the air and then copy it, lower it down a bit and rotate it (like a chain link), make it physical, it actually "hangs" from the non-physical ring. Yea!! But, there is a space between the 2 rings where they don't meet, so it looks like the physical ring isn't actually hanging from the non-physical ring. Hope that makes sense. Is there any way to make the physical ring meet the non-physical ring??

Thanks for any help you can give me or site you can point me to.

-K
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
04-22-2008 09:27
Maybe shove a script in it with llSetHoverHeight

http://www.lslwiki.net/lslwiki/wakka.php?wakka=llSetHoverHeight


or llGroundRepel

http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGroundRepel

CODE

default
{
state_entry()
{
llSetPrimitiveParams([PRIM_PHYSICS, TRUE]);
llSetHoverHeight(5, TRUE, 0.1);
}
}


That should make the object physical and then force it to hover 5m above both land and water. (Should. I don't often script physics at all)

ETA:: (I know of no way to just make it hover without script..maybe there is one, if so, hopefully someone will come along and say it)
_____________________
Tutorials for Sculpties using Blender!
Http://www.youtube.com/user/BlenderSL
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
04-22-2008 09:29
The above answers one question, this the second.

No there is no way for it to naturally touch the non-physical, or even a second physical, ring. The gap you're seeing is caused by the physical bounding box of the object, which is not exactly equivalent to the visual dimensions. In short, the object is physically bigger than it looks.

Hope this helped!
_____________________
Tutorials for Sculpties using Blender!
Http://www.youtube.com/user/BlenderSL
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
04-22-2008 09:30
From: Kincade Spad
I'm trying to figure out how to "pin" a physical prim in the air, or is it even possible.

Not possible. When an object is physical, it is affected by gravity, since gravity is a physical force. Put a physical object in mid air, and it falls, just like it would with RL physics.

EDIT: OK, I didn't know about the hover height thing. Perhaps it is possible. I'll defer to Keira on that.

From: Kincade Spad
Reason: to make a triangle prim rotate and turn another physical triangle prim when it hits it, kinda like 2 gears. When the first one turns, it rotates the second one (which doesn't have a rotate script). Can't find anything in the forums or Wiki about if this is possible.

While machines of this type are possible, it's not recommended. The more collisions going on, the more you lag the sim, and the more potential there is for error.

From: Kincade Spad
And, when i create a ring in the air and then copy it, lower it down a bit and rotate it (like a chain link), make it physical, it actually "hangs" from the non-physical ring. Yea!! But, there is a space between the 2 rings where they don't meet, so it looks like the physical ring isn't actually hanging from the non-physical ring. Hope that makes sense. Is there any way to make the physical ring meet the non-physical ring??

Nope, not possible. The collision lattice of every object in SL is slightly larger than the object itself. The tolerance is 5 centimeters. This affects every physical collision in SL. Take a good look at your avatar's feet next time it's standing on a prim, for example. You'll see that it's actually standing slightly above the surface, not directly on it.

Thanks for any help you can give me or site you can point me to.

Also, it's not generally a good idea to make interlocking physical toruses. There are so many collisions in play, especially if the objects are small, you can pretty easily bring a sim to its knees. Performance in this regard should be better now than it was even a few weeks ago, since we have Havok 4 in place now, but still, it's not a good thing to do.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
04-22-2008 09:35
llMoveToTarget() is the easiest way to suspend a physical object in midair.
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
04-22-2008 09:39
From: Chosen Few

EDIT: OK, I didn't know about the hover height thing. Perhaps it is possible. I'll defer to Keira on that.

/me nods

I've never used either llHoverHeight or llRepelGround in-world, so I can't promise a constant height. It might fluctuate slightly, and for sure at least with hoverheight it will float differently based on the ground below it. (For my above script, 5 meters from the ground directly below it)

Also, in the above script the number 0.1 is how long it takes to get to that height. 1/10 of a second is fast, but not immediate, so it won't just immediately happen. I've no idea the limit to how fast you can make it happen, probably 0.01 of a second, but maybe less/more.

Also, with your idea of one phys object spinning another, I have to point out that with the two colliding like that, they will likely also push each other away, unless you have something keeping them in their spot. It just seems like it would happen to me, though I'm not sure.

ETA:: Yay for 2k! I wasn't sure if llMoveToTarget actually suspended it, so didn't wanna mention it.

ETA2:: Though 2k posted a better solution, I'm leaving everything I said about the hover height/ground repel since it's still maybe useful and/or stuff I wanna know personally =P
_____________________
Tutorials for Sculpties using Blender!
Http://www.youtube.com/user/BlenderSL
Kincade Spad
Registered User
Join date: 27 Jan 2008
Posts: 8
04-22-2008 09:46
Thank you for the very fast response. Actually you confirmed what I kinda thought was the situation, even 'tho I was hoping that there was a way to "pin" a prim in the air and close the gap between them.

And you brought up a very good point about lag. Hadn't thought about that. So even with Havok4, sounds like it's not a good idea yet to have physical prims doing RL things. The effect on the sim would be too great. Ummmmm, maybe Havok5????? ;=))))

Thanks All!!
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
04-22-2008 09:51
From: Kincade Spad
Thank you for the very fast response. Actually you confirmed what I kinda thought was the situation, even 'tho I was hoping that there was a way to "pin" a prim in the air and close the gap between them.

And you brought up a very good point about lag. Hadn't thought about that. So even with Havok4, sounds like it's not a good idea yet to have physical prims doing RL things. The effect on the sim would be too great. Ummmmm, maybe Havok5????? ;=))))

Thanks All!!

Well you can go ahead and do it without too much lag, it's just that if you use too many physical based actions at once it will start to really bog it down.

Physical catapult with a physical 'rock' that makes it launch a person = minimal lag. (Tested)

10 of the above = starts to get a bit laggy (Tested)

100 of the above = HOLY CRAP LAGTASTIC You have been disconnected from Second Life (Not tested)

Havok4 is better. Havok4 can do many things. But moderation is always your friend.
_____________________
Tutorials for Sculpties using Blender!
Http://www.youtube.com/user/BlenderSL
Kincade Spad
Registered User
Join date: 27 Jan 2008
Posts: 8
04-22-2008 09:55
Keira said:
Also, with your idea of one phys object spinning another, I have to point out that with the two colliding like that, they will likely also push each other away, unless you have something keeping them in their spot. It just seems like it would happen to me, though I'm not sure.

- - - - - - - -

You're exactly right Keira. When i put 2 physical triangles on the ground and had one try to turn the other one, they wouldn't touch but the first one just pushed the second one out of the way. And, I had to build a very large and "heavy" box with a hole to hold them, or else they just moved all over. Just don't see a way to make one phy prim turn another one right now and stay exactly where I put them. Even the hover didn't "pin" them in place. :=( (Not to mention the lag issue)

-K
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
04-22-2008 09:56
From: Kincade Spad
Keira said:
Also, with your idea of one phys object spinning another, I have to point out that with the two colliding like that, they will likely also push each other away, unless you have something keeping them in their spot. It just seems like it would happen to me, though I'm not sure.

- - - - - - - -

You're exactly right Keira. When i put 2 physical triangles on the ground and had one try to turn the other one, they wouldn't touch but the first one just pushed the second one out of the way. And, I had to build a very large and "heavy" box with a hole to hold them, or else they just moved all over. Just don't see a way to make one phy prim turn another one right now and stay exactly where I put them. Even the hover didn't "pin" them in place. :=( (Not to mention the lag issue)

-K

If you set llMoveToTarget with X, Y, and Z coordinates it might stay in place completely, I don't know the limits of it, but it's worth a try.
_____________________
Tutorials for Sculpties using Blender!
Http://www.youtube.com/user/BlenderSL
Kincade Spad
Registered User
Join date: 27 Jan 2008
Posts: 8
04-22-2008 10:00
Thanks Keira, I'm going to give that a try a little later today. Maybe that would at least make it stay in one spot. :=))
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
04-22-2008 10:05
From: Keira Wells


ETA2:: Though 2k posted a better solution, I'm leaving everything I said about the hover height/ground repel since it's still maybe useful and/or stuff I wanna know personally =P


The hover height suggestion is still good though!. :)

llMoveToTarget() wont really work with very large objects because its an energy dependent function.
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
04-22-2008 10:07
This thread has inspired me to mess with physics when I get home and can log in.

Gonna try to make a sim-wide marbles run... see what H4 can handle =P

From: 2k
Whatever he said in his last post, this is me trying to remember it...


Just wondering, is there a way to give energy to an object, or is it purely done by mass and all that?
_____________________
Tutorials for Sculpties using Blender!
Http://www.youtube.com/user/BlenderSL
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
04-22-2008 10:08
From: Keira Wells
This thread has inspired me to mess with physics when I get home and can log in.

Gonna try to make a sim-wide marbles run... see what H4 can handle =P


Careful you don't lose 'em!.
Lethe Obscure
Registered User
Join date: 26 Jan 2007
Posts: 11
04-22-2008 10:13
I haven't played with physics too much, but I think you would be able to use a circular hollow on your prism prim to mount it on a non-physical cylinder (axle). The hollow would have to be of sufficient size to allow the physics collision boundary distance, and you could then 'hide' that gap with a phantom prim somewhat like a washer. The non-physical axle should stay where you put it and hold the physical prism at its location.
Kincade Spad
Registered User
Join date: 27 Jan 2008
Posts: 8
04-22-2008 10:23
Lethe: I haven't played with physics too much, but I think you would be able to use a circular hollow on your prism prim to mount it on a non-physical cylinder (axle). The hollow would have to be of sufficient size to allow the physics collision boundary distance, and you could then 'hide' that gap with a phantom prim somewhat like a washer. The non-physical axle should stay where you put it and hold the physical prism at its location.

- - - - - - -
Ummmmmmmm. I tried this once and it didn't work. BUT, i didn't look to see how large the hole was in the physical prim and maybe i didn't even make a hole. Maybe this is the issue and why it just didn't "attach" to the non=phy prim. I'm going to try making a hole in the phy prim, making it different sizes, and see if this works. Good Idea Lethe!
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
04-22-2008 10:27
From: Kincade Spad
And, when i create a ring in the air and then copy it, lower it down a bit and rotate it (like a chain link), make it physical, it actually "hangs" from the non-physical ring. Yea!! But, there is a space between the 2 rings where they don't meet, so it looks like the physical ring isn't actually hanging from the non-physical ring. Hope that makes sense. Is there any way to make the physical ring meet the non-physical ring?
Things don't necessarily have to be what they seem. You could replace your one non-physical ring with two -- a phantom ring that generates the appearance and a different non-phantom, but invisible, prim that supports the physical prim in the way you want.
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
04-22-2008 10:30
From: Keira Wells

Just wondering, is there a way to give energy to an object, or is it purely done by mass and all that?


You can't give energy to an object. But if you want to get away from all the energy related limitations with physical objects then you can make your object a vehicle.
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
04-22-2008 10:33
From: Omei Turnbull
Things don't necessarily have to be what they seem. You could replace your one non-physical ring with two -- a phantom ring that generates the appearance and a different non-phantom, but invisible, prim that supports the physical prim in the way you want.


As far as I know, you can't link a phantom and a non-phantom prim together.

Maybe that's been changed in Havoc 4?. I dunno, I've totally lost touch with scripting. Too unreliable for me.
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
04-22-2008 10:34
From: 2k Suisei
You can't give energy to an object. But if you want to get away from all the energy related limitations with physical objects then you can make your object a vehicle.

oh ick.. I don't even want to attempt vehicles yet.. I'll just stick with not doing things to big stuff
_____________________
Tutorials for Sculpties using Blender!
Http://www.youtube.com/user/BlenderSL
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
04-22-2008 10:34
From: 2k Suisei
As far as I know, you can't link a phantom and a non-phantom prim together.

Maybe that's been changed in Havoc 4?. I dunno, I've totally lost touch with scripting. Too unreliable for me.

That's still true, but if you don't need it linked you can still have a coalesced object in inventory.

Far as I know you also can't link a phys and non-phys.
_____________________
Tutorials for Sculpties using Blender!
Http://www.youtube.com/user/BlenderSL