|
Lemieux Primeau
Registered User
Join date: 25 Oct 2006
Posts: 49
|
09-09-2007 09:04
I am rezzing a cylinder (flattened, like a disk) about a meter or so off the ground and then, in the on_rez event of the disk, I set it to physical so that it will fall to the ground.
All this works well, except that it won't actually lay on the ground. Instead, it floats above the ground about 0.075 meters. Also, if I rez more disks above the first one, they all fall but instead of laying on each other, they all maintain a 0.075 distance between them. It is like some kind of repellent force field.
Right after the llSetStatus(STATUS_PHYSICS, TRUE);, I have tried:
llSetBuoyancy(0.0); and llGroundRepel(0.0, FALSE, 0.0); and llSetHoverHeight(0.0, FALSE, 0.0);
But nothing works. I've looked through all the lsl functions that seem related and searched the forums. It is probably something simple but I am just missing it. Does anyone know how to turn this repellent thing off?
|
|
Abba Thiebaud
PerPetUal NoOb
Join date: 20 Aug 2006
Posts: 563
|
09-09-2007 12:59
Setting physical on objects is more of a building question, even if you're using scripts to rez the objects.
The problem you're encountering is the SL physics engine, which has a collision point that's not a true collision. Imagine, if you will, the hair on your arms being the gap between you and the outside world. Nothing would be able to touch your skin because of that gap. Showers would only get your hair wet, not your skin. Skeeters wouldn't be able to bite (that would be a plus!!) But in SL, it's the way physics is.
This is what the physics engine is doing. There's no work around (building wise), but if you script the objects to move, you can have a more natural collision. Would take tons of time (for me anyway) and wouldn't be worth my efforts. I'd live with the collision settings SL has.
I'm not the bestest person to answer this, but with no replies so far, I thought I might point you in the right direction. Chosen and Ceera, over in the building forum, would better be able to explain it.
A
_____________________
http://www.ponystars.com/abbathiebaud Pony Up.
|
|
Lemieux Primeau
Registered User
Join date: 25 Oct 2006
Posts: 49
|
09-09-2007 16:59
Thanks, Abba.
Yea, I just want it to sit on the ground, basically - not float above it, lol.
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
09-09-2007 18:38
Just double checked and a 0.1 meter separation is normal.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
InuYasha Meiji
Half Demon
Join date: 14 Mar 2005
Posts: 127
|
I made a script for myself that covers that.
09-17-2007 01:35
I tried to add comments to explain the script but here is what I did. I made a randme multi flower generator for my land. I had the same problem. Cause I didn't want to use Alpha channeled images like most generators do. Cause (choke cough) you know how great SL handles alpha channel textures too. So I made some low prim flowers with a small chunk of earth attached to the roots. I added this scrupt to the bottom prim, which is in fact the root prim. It finds true ground level, and moves the flower to that level and turns off phiics, so it don't spring back up when done. From: someone Code:
// I did this script for a multi prim flower rezzer. // I placed the flowers already set to temp on rez within a rezzer. // The rezzer would choose a random X,Y then rez the already, saved // as invisible, flower in the air with this script inside the root base.
// PS, this script for detection of ground, not for landing on other prims.
float time = .1; vector flowerpos;
default {
on_rez(integer start_param) { llSetStatus(STATUS_ROTATE_X, FALSE); llSetStatus(STATUS_ROTATE_Y, FALSE); // the above two lines keep the object steady so // it falls straight down and don't turn on it's side. llSetLinkAlpha(LINK_SET, 0.0, ALL_SIDES); // Set entire prim 100% invisible. // just so others don't see it drop from the sky. } state_entry() { llSetStatus(STATUS_ROTATE_X, FALSE); llSetStatus(STATUS_ROTATE_Y, FALSE); }
land_collision_start(vector pos) { // llSay(0, "Hit the ground at " + (string)pos); // The routine here is commented out, I used it for debugging } land_collision(vector pos) { flowerpos = pos; flowerpos.z = flowerpos.z - 0.500; llSetPos(flowerpos); llSetStatus(STATUS_PHYSICS, FALSE); // If I leave Physics on the flower will jump back up. llSetPos(flowerpos); // Replant flower on ground.
// routine to rotate object to a randome rotation starts here... // I didn't want all my flowers facing the same direction. integer randomRot = llFloor(llFrand(361.0)); vector eul = <0, 0, randomRot>; //360 degrees around the z-axis, in Euler form eul *= DEG_TO_RAD; //convert to radians rotation rotation quat = llEuler2Rot( eul ); //convert to quaternion llSetRot( quat ); //rotate the object routine END. llSetLinkAlpha(LINK_SET, 1.0, ALL_SIDES); // set entire prim 100% visible. // So it reappears a if it hit the ground in the first place.
}
}
I added the comments and didn't recompile the script to test it again. Let me know if it still works. If not I'll give it a look later on. It is 4:34am my time and bed is calling. Good night and good luck. InuYasha Meiji
|
|
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
|
09-17-2007 02:47
For each prim type exists a collision model which is used by the physics engine.
This model is *always* slightly bigger than the prim.
Thus, physics effects like collisions on tiny prims for example, will not be all too accurate when being viewed by players.
On bigger objects on the other hand, you will not really notice much of that "gap".
|