Import and Export Simulations
Simulations can be saved on disc or can be uploaded to simulation hub on cloud. The current simulation will be saves in .ssim format.
Previously saved or downloaded simulations can directly be opened in SimPHY.
The Objects and Joints from any simulations can be imported to currently running simulation. This is useful if you want to add some special object(e.g. nicely designed car) to new simulations, just create object once, save the simulation and import it to new simulation.
Drag and draw to create Objects and Joint
With simPHY you can create simulation scenes with mouse using simple drawing tools like boxes, circles, polygons, gears etc, optionally connected by joints like spring or ropes . Composite bodies can be created by adding multiple fixtures or using constructive area geometry. You can also Edit and make changes by rotating, scaling, moving, cutting or cloning your objects.
Supported Objects Type
- Chains and gears
- You can also create special complex objects by adding multiple fixtures or using constructive area geometry
Supported Joints Type
- Spring and Distance Joint
- Rope joint
- Prismatic Joints
- Revolute Weld and Wheel Joint
- Pulley Joint
SimPHY supports all major editor options for objects and joints to make experience better.
- Multiple Selection
All these operations can be done using well known keyboard shortcuts like Ctrl+C for copy, etc
The gravitational force on an object is calculated as
Force = mass x gravity x gravityFactor
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.
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.
From SimPhy 3.0 onwards there is support of widgets that can be added to simulations. few of widgets are just for information purpose (like label and text widget), while other widgets respond to event by associating scripts with them(like button, slider etc).
Simphy supports follwing widgets
Analyse and Visualise
Any Simulation created can be analysed to learn actual physics behind it in following ways
- Draw Free Body diagram showing all forces on body (with their values) is extremely useful in understanding dynamics of body
- Plot variation of velocity, position, angular speed etc of body, select camera tool(by clicking over it) and press over the object.
- View Simulation in Frame of Object Camera will have its focus at center of mass of selected object(s) and hence center of mass of selection will always seem to be at rest.
- Attach tracer to any point on body to view/study path of object.
SimPHY supports many Moue based gestures to draw objects and joints and to edit/delete them without need of switching tools.
Few of them are
Individual body or joint can be selected by simply clicking over them. Selection clears when clicked somewhere else.
Object Creation gestures
If drawn figure is closed curve it will be transformed to disc, box triangle or polygon
Joining 2 bodies with straight or zigzag curve creates distance or spiring joint etc.
Simply draw a vertical line to pause or resume simulation, draw line over selected objects to delete them and many more
Scripting on World Events
- Start Stop or update of simulation
- Keyboard Events
- Mouse Events
Scripting on Widget Events
- Click of Button
- Change of Slider Value
- Timer fire
For finer control over simuation SimPHY supports some advanced features:
- Material properties for body: Each body can be modified to simulate materials like rubber, stone wood etc by changing friction, restitution or choosing from predefined set of objects
- Key Controllars for Body: Motion of can be controlled by binding keyboard key to it, on pressing the key body can be accelerated or rotated.
- Collision filtering It is used to only allow a category of bodies to collide with another category.
- Setting Html text to BodyThe body can display text in HTML format, which is extremely useful to display information in simulation in eye catching/fancy way.
Now we can create frame by frame animations and associate them to bodies in simphy by simple code
Or you can display animation on screen by function
Each body now can have a action, which is updated each frame by the bodies
act method. Many types of actions are included which can be instantiated, configured, and added to an actor. When the action is complete, it will automatically be removed from the actor.
Animation actions modify various properties of your actor, such as location, rotation, scale and alpha. They are:
- FadeIn – changes alpha of your actor from actor’s current alpha to 1
- FadeOut – changes alpha of your actor from actor’s current alpha to 0
- FadeTo – changes alpha of your actor from actor’s current alpha to specific value
- MoveBy – moves your actor by specific amount
- MoveTo – moves your actor to specific location
- RotateBy – rotates your actor by specific angle
- RotateTo – rotates your actor to specific angle
- ScaleTo – scales your actor to specific scale factor
Composite actions combine multiple actions in one action, there are:
- Parallel – execute given actions in parallel – all actions at once
- Sequence – execute given actions in sequence – one after another
- Repeat – repeats given action n-times
- Forever – repeats given action forever
- Delay – delays execution of given action for specific amount of time
- Remove – removes given Actor from stage
var rotate =actions.rotateTo(60,0.5f); //rotate Actor to angle 60 in 0.5 s
Example of creating more complex action sequence:
body.setAction(actions.sequence(actions.moveTo(10, 2), actions.delay(0.5f), actions.rotateTo(180,5)));