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

Play’s a notes from wizbot as specified from the list
This block allows sprite to go to any random position on stage.
The block is used to draw an outline of the ellipse or a filled ellipse of a specified X length, Y length and center position on evive TFT display. It takes the color, center, X length and Y length of the ellipse from the user and draws an ellipse.
The block set PWM output on evive PWM pins. The user can select the output from a range of 0 to 255.  If the PWM output is 128, then half the time output will be High and for rest, the output will be Low.
Dabble input module have 2 slide switch type input, having states left, right and off. This block reports if the selected slide switch is in the selected state in real-time. If the slide switch is in that state, then it returns true else false.
The block moves the end-effector in an arc.
This block sets the value of the selected servo by the value you enter. Whereas the angle of other servos remains the same.
The block moves its sprite costume center’s X position by the specified amount.
The block sets its sprite’s size to the specified amount. The default sprite size is 100%; anything lower than that will decrease the size of the sprite on the stage, and anything above will increase the size of the sprite on the stage.
It deletes the clone it runs in. This block is the only way, besides for clicking the Green Flag or Stop Sign, to delete clones.
The block holds the mouse-pointer’s current Mouse Y.
The block divides the second value from the first and returns the result. If the first value is not evenly divisible by the second, the reported value will have decimals. To find the remainder instead, use the () Mod () block. Note, dividing by 0 in the online editor will return infinity, 0, or negative infinity. It depends on if the numerator is positive, 0, or negative; respectively.
This function returns the specified parameter of the hand landmark detected.
The get () position of landmark () of the face () block reports the x and y position of the selected landmark (number from 1 to 68) of the selected face.
The block returns whether the specified number card (0-9) is detected in the analysis or not.
The function returns the city name of the location.
The block changes the brightness level of the RGB LEDs of Quarky to the defined value.
The block returns the analog reading of the sensor connected to the specified analog pin of the Quarky. The value varies between 0 to 4095.
Scripts that wear this block will activate once the selected class is predicted either on the recognition window, stage or camera.
The block enables the physics engine for the selected objects with the defined precision level.
The block activates the script under this hat block when the moisture reading from the sensor is greater than the specified value. 
The block sends the data to the ThingSpeak channel with a delay of the specified time seconds. The data is added to field 1 of the channel.
The block executes the oscillator according to stored parameters for the servo motor and the current time.
The block moves the servo motors of the pick and place robot at the pick angle specified by the user.
The block makes a request to ChatGPT to get an easily understandable text of the text specified in it. The response of ChatGPT is then stored in PictoBlox and can be accessed using the get AI response block.
The block displays the custom pattern on the 8×8 Dot Matrix Display.
PID functions use sensor feedback to improve the robot’s movement accuracy and stability.
Stops all the movement and actions of the wizbot.
Play’s a sound from quarky as specified from the list.
Mirrors the orientation of the sprite.
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