These forums are CLOSED. Please visit the new forums HERE
Rez object based off AgentSize for position |
|
|
Jenn Yoshikawa
Registered User
Join date: 14 Nov 2007
Posts: 91
|
01-14-2009 14:47
I'm not sure if this can be done. But can you rez a object from based off a AgentSize. Rezing items from a collar like a post cage etc. My av is 2.175577m tall while some ones eles can chould shorter then mine. I'm trying to stop the items for going under ground or rezing to low pushing them out of the cage for one lol. A friend said it might be a math thing in lsl some thing I have not learned for lsl yet.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
01-14-2009 18:25
sounds like positional trouble not sze trouble yes? get the av's postion for the relative res height offset, and calculate your needs from there based on the object. might prefer using rezAtRoot to rez object too, since the later bases off of geometric center
_____________________
|
| . "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... | - |
|
Jenn Yoshikawa
Registered User
Join date: 14 Nov 2007
Posts: 91
|
01-14-2009 19:10
off set on the z is where I'm trying to set it.
|
|
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
|
01-15-2009 05:15
I don't know if this is any help, but I've found, when I need to rez things at an avatar's feet, calculating half the z vector of the av's detected size and offsetting that from their detected position gives pretty good -- though not perfect -- results most of the time.
Since you want the floor of the cage rather than its centre to rez at people's feet, you'll need to do a further offset based on half the hight of the cage, but this might be a way to proceed. |
|
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
|
01-15-2009 06:54
Would llGround() help in this instance?
_____________________
http://slurl.com/secondlife/Together
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
01-15-2009 07:27
take the agent height, and multiply by 1.1.. that's the measurable height of the avatar (plus shoes, minus hair).
so.. let's say that the float "agentheight" has been defined already. float footbottom = (agentheight * 1.1) / 2; // distance from agent center, to bottom of feet now we know where the bottom of the foot is in relation to the agent's center. Since an object will rez at the agent's center, we're at a good start. Now let's see.. let's assume that the platform is 0.100 thick. float rezoffset = footbottom + 0.05; // one half of the platform thickness. So, for a 2m tall agent... 2m * 1.1 = 2.2m / 2 = 1.1m + 0.05 = 1.15m Since we want the platform to rez BELOW the feet... let's make that negative. -1.15 so... llRezAtRoot("platform", llGetPos() + <0,0,-1.15>, <0,0,0>, llGetRot(), 0); Your mileage may vary, but "agent * 1.1" is a pretty well tried and true measurement to determine the avatar's height (minus hair). (measure with prims, you'll be surprised). You won't want to hardcode the offset,.. instead let the rezzer check the agent's height and do the math "on-demand".. remember also that your platform thickness is involved in the math as well. You may want to try this with, and without the 1.1.. because as I think about it, I seem to recall that while the avatar's height is relative to the agen't height by a factor of 1.1.. the agent usually sits on, or just embedded slightly into, the floor. Try rezzing one of my agent visualizers to see what I'm talking about. /54/c3/253812/1.html _____________________
![]() ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura |