Physion

  • Increase font size
  • Default font size
  • Decrease font size
Welcome, Guest
Username Password: Remember me

Scripting Examples
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: Scripting Examples

Re: Scripting Examples 6 years, 3 months ago #606

  • Lynxx
  • OFFLINE
  • Moderator
  • Java/C#-Developer
  • Posts: 223
This behaviour is already posted as a bug [crash] undo world.removeBody.

You could alternatily do the following:
In the the OnContact do other.Opacity=0 and move the ball outside the table, for example: "other.Y += 20", then you can undo the action, or implement a function (with Keypress for example) which "Resets" the Table by moving the balls back to their original position.

Another alternative method, set other.Opacity=0 and other.FilterMasks="C" for the First Ball, "D" for the next one and so on, this way the balls wont interact with the remaning balls on the table.
Infinity is vast, especially near end.
bye, Lynxx

Re: Scripting Examples 6 years, 3 months ago #610

  • DonDon6
  • OFFLINE
  • Junior Boarder
  • Posts: 30
Okay, Now that I have the pool pockets working properly I would like to have the pool balls slow down in a reasonable time. Now they coast on for many seconds. Any suggestions.

Also, is there a list of keyboard shortcuts. For example, I see in some of the tutorials that you can shift the screen with some type of key conbination.

Don

Re: Scripting Examples 6 years, 3 months ago #613

Hi again, DonDon6.
Sorry about the "removing the balls" issue. I forgot about that temp bug with 'Undo'.

Re: Balls slowing down....
I've been looking at, (and playing around with), your scene, out of personal interest.
Naturally, by simulating a table-top like that, you need zero gravity, which you have
done, but different things control how they come to rest.
Properties like 'Friction', have a range from 0 to 1. This only comes into play while
an object is against another, not "in free air". Simillarly, 'Restitution', also 0 to 1,
governs how quickly an object comes to rest, when striking another, and is actually
back to front, with logical thinking, such that a setting of 1, means NOT coming to
rest! Like a super-ball bouncing! A zero value, is like a lump of putty hitting the ground.
It virtually stops dead. In your case, you don't want that, as the balls should bounce
well with the 'cushions', so set the balls & cushions 'Friction = 0' & 'Restitution = 1'.

Now, they bounce well, but keep moving too much. THIS is controlled by Damping.
Setting 'LinearDamping' (0 to 1), to about .4 will start slowing them down to a stop,
as if moving through a light liquid. Simillarly, 'AngularDamping' set to about .4 will
eventually stop them spinning. Should look a bit more realistic then.

As i mentioned, i've been playing around with it, and have done all that, and more,
in a modified version, including better graphics, and adding a ball collection chute!
I will upload it in a few hours, so you can see how it was done, with the coding.

Re: Shortcuts.
Most can be found by selecting from the menu toolbar, File, Edit, View|Zoom etc.
(Note, the zoom in is shown as 'Ctrl++', meaning [Ctrl] & [Shift] & [+] ).
One of the most useful ones, is [F10], which toggles 'Snapping' on & off, so you
can start draging/drawing another shape from a point or centre of another.
1x1 square diag = root-2. Cube diag = root-3. Beautiful !

Re: Scripting Examples 6 years, 3 months ago #614

Howdy again DonDon6.
Didn't upoad the scene-file to this Physion site, in case it bothered you.
I have uploaded it up to this location though, including a README file....
workingfiles.netii.net/PhysionStuff/PoolTable/
It intrests me, as a subject matter, and is worth exploring more.
Have fun. Glenn. Sunny South-Australia.
1x1 square diag = root-2. Cube diag = root-3. Beautiful !

Re: Scripting Examples 3 years, 6 months ago #892

This topic is being covered again in simple terms, in the new Beginners Guide...
1x1 square diag = root-2. Cube diag = root-3. Beautiful !
  • Page:
  • 1
  • 2
Moderators: Lynxx, Glenn555
Time to create page: 0.13 seconds