Bouncing?
|
|
Marianne McCann
Feted Inner Child
Join date: 23 Feb 2006
Posts: 7,145
|
04-22-2008 21:19
So I'm trying to work out a bouncing ball. I did the usual sphere, made it rubber, turned it physical.... and it rolls just fine, if a little slow. It does not, however, bounce.
Is there anything at all in LSL that might make my poor ball actually bounce like a rubber ball should?
Mari
_____________________
  "There's nothing objectionable nor illegal in having a child-like avatar in itself and we must assume innocence until proof of the contrary." - Lewis PR Linden "If you find children offensive, you're gonna have trouble in this world  " - Prospero Linden
|
|
Crunch Underwood
Mr. Grown up, Go away sir
Join date: 25 Sep 2007
Posts: 624
|
04-22-2008 21:48
there's a script in the scripting library i'v used befor that makes an object bounce and move towards the closest avatar. pretty cute. might be good for your ball
-Crunch
_____________________
---------------------------------------------- So your final Nimbus Score is 8.15, a quite remarkable achievement for a biped. Congratulations Crunch, you should be very proud. 
|
|
Marianne McCann
Feted Inner Child
Join date: 23 Feb 2006
Posts: 7,145
|
04-22-2008 22:11
From: Crunch Underwood there's a script in the scripting library i'v used befor that makes an object bounce and move towards the closest avatar. pretty cute. might be good for your ball Hmn... that might work, or at least give a starting point. I would just like to see if have some lift to it, rather than, well, being dropped and watching it sit there.
_____________________
  "There's nothing objectionable nor illegal in having a child-like avatar in itself and we must assume innocence until proof of the contrary." - Lewis PR Linden "If you find children offensive, you're gonna have trouble in this world  " - Prospero Linden
|
|
Marianne McCann
Feted Inner Child
Join date: 23 Feb 2006
Posts: 7,145
|
04-23-2008 05:19
Hmn... only bounce script I found there seems to be H4 borked :-/
_____________________
  "There's nothing objectionable nor illegal in having a child-like avatar in itself and we must assume innocence until proof of the contrary." - Lewis PR Linden "If you find children offensive, you're gonna have trouble in this world  " - Prospero Linden
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
04-23-2008 05:37
Try to apply llSetBuoyancy(float buoyancy); http://www.lslwiki.net/lslwiki/wakka.php?wakka=llSetBuoyancyYou must throw or kick it of course as in the real world happy scripting
_____________________
From Studio Dora
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
04-23-2008 06:23
OOOOOH I gots an idea.
on ground collission, apply upward push to the object, each time, diminishing the amount of push.(perhaps based on halving the speed of the collission)
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
04-23-2008 06:42
Howszabout this? float speed() { vector curVel = llGetVel(); return curVel.z; }
default { state_entry() { llCollisionSound("bc8c684d-d3a8-448b-91ae-0286255e6cea", 0.0); llSetBuoyancy(0); }
collision(integer numdetected) { llApplyImpulse(<0,0,speed() * .5>, FALSE); } }
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
|
Virrginia Tombola
Equestrienne
Join date: 10 Nov 2006
Posts: 938
|
04-23-2008 07:18
Oh cute  Perhaps toss in a llGetMass in there?
llApplyImpulse(<0,0,.5*speed()* llGetMass()>, FALSE);
Silly question, does the collision event encompass land_collision events as well? If not, I suppose one could add this at the end: land_collision_start(vector pos) { llTriggerSound("bc8c684d-d3a8-448b-91ae-0286255e6cea", 0.5); llApplyImpulse(<0,0,.5*speed()* llGetMass()>, FALSE); }
_____________________
Horses, Carriages, Modern and Historical Riding apparel. Ride a demo horse, play whist, or just loiter. I'm fair used to loiterers. http://slurl.com/secondlife/Caledon%20Eyre/48%20/183/23/
|
|
Marianne McCann
Feted Inner Child
Join date: 23 Feb 2006
Posts: 7,145
|
04-23-2008 07:24
Very cool. I'll tinker with this a bit when I get back inworld 
_____________________
  "There's nothing objectionable nor illegal in having a child-like avatar in itself and we must assume innocence until proof of the contrary." - Lewis PR Linden "If you find children offensive, you're gonna have trouble in this world  " - Prospero Linden
|
|
Marianne McCann
Feted Inner Child
Join date: 23 Feb 2006
Posts: 7,145
|
04-24-2008 22:43
Very cool. Seems to work pretty good, though the movement (not the bounce so much as th erolling of the ball when "kicked"  seems a little rigid -- but that's SL 
_____________________
  "There's nothing objectionable nor illegal in having a child-like avatar in itself and we must assume innocence until proof of the contrary." - Lewis PR Linden "If you find children offensive, you're gonna have trouble in this world  " - Prospero Linden
|
|
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
|
04-25-2008 13:17
i made one of those a wile back xD sit on a chair it launches you up and *bounce bounce bounce bounce* off the side of a cliff lol
|