Collision Categories and Filters

By default, all the shapes are able to collide with all the other shapes, but it’s also possible to set up ‘collision filters’ to provide finer control over which fixtures can collide with each other. Collision filtering is implemented by setting some flags in the fixture definition when we create the fixture. These flags are:

Category: The category(s) to which the object belongs

Collides With: The category(s) with which object can collide

Lets talk about X and Y objects whose categy is set so non None . The collision between them will occur only when following 2 conditions are met

  1. Y belongs to category which is listed in collides with category of X
  2. X belongs to category which is listed in collides with category of Y

Illustration Example

To illustrate collision filtering, let’s take an example: we have three kinds of objects in a simple platformer game: playersmonsters, coins, fireballs and ground.

We want the following rules: players should not collide with each others, neither do monsters, but players should collide with monsters (and vice-versa). Of course, players and monsters have to collide with the platform/ground.

ObJECT CATEGORY COLLIDES WITH
Ground None (default) All(default)
Mario A All-A
Monster B All-B
Coin C A
Fire D All-ACD

Here

  • Ground will collide with all since its behaviour is default.
  • Mario will collide All except those which are of category A
  • Monster will collide all except themselves
  • Fire will collide all except with Mario coin, and bullet
  • Coin will collide with Mario alone

Now, you git and idea how to perform selective collision. Download the corresponding simulation below to play in Simphy 2.5+.

SimPHY on Mac OS silicon (M1 chipset)

After a huge amount of efforts and time we are proud to announce that SimPHY now works natively on MacOS arm64.

However we could’t still create dmg installer, means Jva will have to be installed.

Follow the steps to get it working

  1. install Java for M1: https://cdn.azul.com/zulu/bin/zulu11.52.13-ca-jre11.0.13-macosx_aarch64.dmg
  2. download simphy java app:https://github.com/maheshkurmi/simphy-mac-m1
  3. extract above zip
  4. double click simphy.jar to run app
  5. if it does’t work, run command java -jar simphy.jar
  6. If still it does’t work, share the outcome of terminal

Simphy Custom forces demo

You can simulate almost any 2D motion of objects by applying custom force to body. Force may be the function of speed, position, mass of object.

SimPhy Fields Demo

SimPhy supports setting up of various fields other than gravity.

  • Gravity:

    The gravitational force on an object is calculated as
    Force = mass x gravity x gravityFactor

  • Electrostatic field:

    Electrostatic field (in N/C)added to the world, apply force on object if and only if it has non zero charge and it is inside bounds of field.

  • Magnetic field:

    The magnetic lorentz force on an object is calculated asForce = charge x speed x magnetic field  and is perpendicular to the velocity

  • Buoyancy and drag:

    Buoyancy can be added to a region representing hypothetical liquid in that region. The density and viscosity of liquid can be changed while adding/editing field.

Simphy Joints Demo

Simphy has a number of ‘joints’ that can be used to connect two bodies together. These joints can be used to simulate interaction between objects to form hinges, pistons, ropes, wheels, pulleys, vehicles, chains, etc. Learning to use joints effectively helps to create a more engaging and interesting scene.

Body Types in Simphy Demo

Demo for various type of bodies that can be added to Simphy. You can also create complex bodies by adding multiple fixtures or using constructive area geometry.

Mouse Gesture Demo

Demonstration of physics simulator Simphy’s new feature called universal tool. Now we can control, edit and create objects and joints simply using mouse gestures. It dynamically recognizes shapes and patterns and adds to simulator.

Create your first Wagon

Demonstrates how easy it to create a wagon controlled by keyboard , using SimPhy 5.0+.

General Usage Demo

The user, using just the mouse and by selecting corresponding tools, can create various physical objects (circles, polygons, gears, etc.) and joints (eg. springs, pulleys etc.) that obey the laws of Physics. This way the user can experiment by creating various scenes/scenarios which can be either simple physics experiments or jus a game demo.