Deprecated: Required parameter $query follows optional parameter $post in /var/www/html/wp-content/plugins/elementor-extras/modules/breadcrumbs/widgets/breadcrumbs.php on line 1215
Physics Engine - Blocks, Python Functions, Projects | PictoBlox Extension
[PictoBloxExtension]

Physics Engine

physics
Extension Description
Add physics to simulate the real-life simulation.

Introduction

What is Physics Engine?

Physics Engine is a 2D rigid body simulation library for making games and animations. Programmers can use it in their games to make objects move in realistic ways and make the projects more interactive. From the game engine’s point of view, the physics engine is just a system for procedural animation.

Accessing Physics Engine in Block Coding

Following is the process to add Physics Engine capability to the PictoBlox Project.

  1. Open PictoBlox and create a new file.
  2. Select the coding environment as Block Coding.
  3. Next, click on the Add Extension button and add the Physics Engine extension.
  4. You can find the Physics Engine blocks available in the project.

Core Concepts

Physics Engine works with several fundamental concepts and objects. We briefly define these objects here and more details are given later in the block definitions and examples.

  1. Shape: A shape is a 2D geometrical sprite, such as a circle or polygon or the sprite shape.
  2. Rigid body: A chunk of matter that is so strong that the distance between any two bits of matter on the chunk is constant. They are hard like a diamond. In the following discussion, we use body interchangeably with rigid body.
  3. Fixture: A fixture binds a shape to a body and adds material properties such as density, friction, and restitution. A fixture puts a shape into the collision system (broad phase) so that it can collide with other shapes.
  4. Constraint: A constraint is a physical connection that removes degrees of freedom from bodies. A 2D body has 3 degrees of freedom (two translation coordinates and one rotation coordinate). If we take a body and pin it to the wall (like a pendulum) we have constrained the body to the wall. At this point the body can only rotate about the pin, so the constraint has removed 2 degrees of freedom.
  5. Contact constraint: A special constraint designed to prevent penetration of rigid bodies and to simulate friction and restitution. You do not create contact constraints; they are created automatically by Physics Engine.
  6. World: A physics world is a collection of bodies, fixtures, and constraints that interact together. Box2D supports the creation of multiple worlds, but this is usually not necessary or desirable.
  7. Solver: The physics world has a solver that is used to advance time and resolve contact and joint constraints. The Box2D solver is a high-performance iterative solver that operates in order N time, where N is the number of constraints.
  8. Continuous collision: The solver advances bodies in time using discrete time steps.
Read More

PictoBlox Blocks

The block writes the message to the RFID tag. It will wait for the specified time to scan an RFID tag and write the value on it. The block also reports whether the operation is completed or not. If the write is complete the block returns 1, else it returns 0.
The block defines the value of the body.
This block allows the Gripper Robot to open its gripper.
This block is used to get the angle of a selected servo connected to a robotic arm.
The block gives the value of the current sensed on the sensing ports of evive in mili-Ampere.  
The Music module allows you to play tones, songs and other recorded audio files from your phone’s storage as per command send from the hardware device. This block is used to play the audio file for the key entered in the text box of the block.
This block reports the current position of the end effector in the selected axis.
The block holds its sprite’s X position. This block can be displayed as a Stage monitor.
If the block’s sprite is shown, it will hide the sprite. If the sprite is already hidden, nothing happens.
It reports the number of days (and fractions of a day) since 00:00:00 1 January 2000 (UTC).
The block rounds the given number to the nearest integer. It follows the standard rules of rounding; decimals that are .5 or higher are rounded up, whereas decimals less than .5 are rounded down.
The block hides the specified list’s Stage monitor.
The block reports the x velocity of the sprite.
The block set the last scanned RFID tag to the master RFID tag. This can be used for authentication.
The block sets the body content type to the specified value.
The block resets the timer running for the oscillator to 0.
This block allows the Gripper Robot to close its gripper.
The block reports the current position of the end effector along the X, Y, and Z axes.
The block returns the time passed since the device is turned ON or since the timer has been reset. This block returns time in milliseconds.
The Camera module allows you to use your mobile camera for different activities like recording videos, capturing images, color detection, and face detection. This block sends commands for clicking an image, starting the video, and stopping the video in the camera module.
The Notification module of the IoT module triggers a notification in your Smartphone based on events occurring on your hardware. This block is used for clearing the previous notifications from the phone.
The block holds its sprite’s Y position. This block can be displayed as a Stage monitor.
The block will place a sprite in front of all other sprites. It does this by changing the sprite’s layer value.
The block performs a specified function on a given number and reports the result. The function can be changed by clicking the down arrow and selecting a new function from the drop-down menu.
The block reports the y velocity of the sprite.
The block reports if the last RFID tag scanned is a master tag or not. If it is the master RFID tag, then it returns true, else false.
The block reports the time passed from the reset for the oscillator.
The block sets the timer’s value back to 0.0. Usually, the timer must be reset at the beginning of a project for the Timer block to hold the right value.
The Oscilloscope module allows you to visualize the input and output signals of your hardware device on your smartphone. This block for setting the baud rate of the Bluetooth module that you have connected to Arduino Mega.
The block holds its sprite’s direction, measured in degrees.
All articles loaded
No more articles to load

Block Coding Examples

There are no block coding examples for the extension to show.
Table of Contents