Physics

A set of universal blocks that work with the physical properties of Varwin objects. You can configure the physics of the object both in the 3D scene editing mode and in the Blockly logic editor

Inspector

../../../_images/image-418.png
  • Mass - the parameter sets the mass of the object and affects the speed of its fall

Note

If two objects with different masses collide with each other, the heavier object will be the squeezing one

  • Springiness - adjusts the effect of an object bouncing off the surface as it falls. The bounce force also depends on its mass

Note

The bounds of these two parameters must be in the range from 0 to 1, and they can be set as non-integer numbers with an unlimited number after the decimal point

  • Gravity - a parameter that sets the object to be able to use the gravity rules
  • Static - a rule that forbids the user to physically affect the object
  • Obstacle - the parameter that enables the object’s colliders. If they are enabled, the user will not be able to pass through the object

Note

* Colliders determine the shape of an object for physical collisions

Blockly

Actions

../../../_images/image-152.png
  1. Execute Object to apply force of magnitude N in direction X: Y: Z: relative to Object/World - instantly applies force to object in direction of specified vector in local or world coordinate system
  2. Execute Object to apply force of magnitude N in the direction X: Y: Z: during M relative to Object 2 - applies force to the object in the direction of the specified vector in the local or world coordinate system for the specified time
  3. Stop/stop/continue action of any force - controls the action of any force on the object. Suspended force action can be resumed with the “Continue” block

Variables

../../../_images/image-230.png
    1. Object is subject to force at the moment - returns “true” if force is applied to the specified object at the moment. Otherwise, it returns “false”.
  1. Get from Object the value of physical property mass/springness/acceleration/velocity/angle speed - returns the value of selected physical property of the object
  2. Set Object value of physical property mass/springiness/acceleration/velocity/velocity/angle speed = N - sets the value of one of the object’s physical properties
  3. Set Object physical property subordinate/unsubordinate to gravity - sets whether gravity affects the object
  4. Set Object physical property Object static/non-static - defines if the specified object is static. If the object is static, no physical forces affect it
  5. Set Object physical property Object is/isn’t an obstacle - specifies whether the specified object is an obstacle for the player and other objects

Events

../../../_images/image-327.png
  1. object Started/finished collision with Object/object list - the event is triggered when the specified object started a collision with another object. The parameters include the specified object and the object, with which the collision started, or the list of all objects of the scene
  2. Object Inside/outside of the target object for Object - the event is triggered when the specified object has entered or left another object. The parameters include the specified object and the object that the specified object got in or out of
  3. Force stopped acting on the object for Object - event is triggered when any physical force starts to act on the object. The specified object is passed to the parameter