osgrid.org
https://forums.osgrid.org/

Script request nice Bouncing Balls Demo v0.2
https://forums.osgrid.org/viewtopic.php?f=5&t=6408
Page 1 of 1

Author:  Raelah Giel [ Thu Sep 05, 2019 8:15 am ]
Post subject:  Script request nice Bouncing Balls Demo v0.2

hello, can you please, the script for your video with instructions (how many prim must you have) make? thank you in advance! Greetings from salzburg, Tara

Author:  dj phil [ Thu Sep 05, 2019 10:06 am ]
Post subject:  Re: Script request nice Bouncing Balls Demo v0.2

Here is the basic script I used in the video.
{L_CODE}:
// Bouncing Ball v0.1 by djphil (CC-BY-NC-SA 4.0)

float buo = 0.5;
float vel = 5.0;

integer power;

bounce(rotation dir)
{
    llSetBuoyancy(buo);
    llSetVelocity(<0.0, 0.0, vel> * dir, FALSE);
}

default
{
    state_entry()
    {
        llCollisionSound("be582e5d-b123-41a2-a150-454c39e961c8", 1.0);
        llSetStatus(STATUS_BLOCK_GRAB_OBJECT, FALSE);
        llSetStatus(STATUS_DIE_AT_EDGE, TRUE);
        llSetBuoyancy(0.0);
    }

    touch_start(integer n)
    {
        llSetStatus(STATUS_PHYSICS, (power = !power));
    }

    land_collision(vector n) {bounce(llDetectedRot(0));}
    collision(integer n) {bounce(llDetectedRot(0));}
    on_rez(integer n) {llResetScript();}
}
The ball bounces on the ground and on objects. If you tilt the objects then the ball will bounce in the orientation of the object on which it bounced.
The Physics Engine is ubODE

Enjoy! :)

Author:  dj phil [ Thu Sep 05, 2019 10:27 am ]
Post subject:  Re: Script request nice Bouncing Balls Demo v0.2


Author:  Raelah Giel [ Sun Sep 08, 2019 4:54 am ]
Post subject:  Re: Script request nice Bouncing Balls Demo v0.2

I love you so much, I love you so much, I love you so much ♥ Thank you Thank you Thank you Thank you !!! hugs Tara from Salzburg

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/