A new (BodyNode) property was recently added in Physion.
Its name: Gravity Scale (gravityScale).
As the name suggests, the gravityScale property of a body can be used to "scale" the gravitational attraction applied to it.
In other words, the gravityScale allows you to specify a different gravity for each body.
By default, the value of this new property is 1.0 meaning that the Scene's gravity will be applied to the body.
If you change this value to say 0.5 then only half of the Scene's gravitational force will be applied to the body.
If you want to make a body float (i.e ignore gravity) you can set a gravity scale of 0.
To make a balloon-like body you can set its gravityScale to a negative number.
In the video below you can see the gravity scale in action:
Note that the minimum value of this property is -1 and its maximum value is +1.
Using this new property and some minimal scripting, the user can easily create gravity pads which are very useful in marble races and other similar simulations.
Recently, a feature request was made in Physion's Discord Server: "Add the ability to visualize the trajectory of an object".
This functionality was already implemented in the old version of Physion as you can see in the video below:
Unfortunately (and for the time being) the web version of Physion doesn't natively support tracers. The goods news is that we can implement the tracer functionality using scripting.
First, we use our initialized data member to perform a 'one-off' initialization task:
Add our graphics to the foreground layer of the scene (that our node belongs to).
In order to retrieve the scene that our node belongs to, we use the findscenenode method.
After initialization is performed, the script keeps repeating the following:
Updates the trajectory array
Draws the tracer
The updateTrajectory() method is responsible to update our trajectory array in each update. It does that by pushing the latest position of our node to the array. It also makes sure that this array doesn't grow infinetely: If the size of the trajectory array gets bigger than maxTrajectorySize then old positions will get removed.