Example. In Physics, what does static refer to. I’m kinda figuring it out but would be nice to be able to just look it up. Or, what’s the difference between local and world velocities. Or, how does “Push” work when it is set in terms of velocity. And what is the “set simple physics tick rate”??
as of now there’s no thorough documentation of our Blockly code library available. Feel free to ask questions related to physics and Blockly in our forum. We’re looking into providing more documentation in the future
Static objects are physics objects that can’t be moved. This is useful when you want to create surfaces other objects can collide against, but are themselves not affected by gravity or move by collisions. In the example below, the lower block is a static physics item while the upper block is a normal physics item.
Simple physics tick rate
This block can change the speed at which all physics blocks from the “simple” category are executed after each other.
The tick rate below is set to one second. Every physics block waits 1 second before continuing to the next one.
Now the tick rate is set to 0. The blocks run directly after each other, causing the block to fly high in the air.
The push block moves an object towards a direction relative to its forward direction (the direction where the object looks to). If your program does not know what the current forward direction of a physics item is, you can use the “push towards” - block.
Local / world space velocity
With the local / world space velocity drop-downs you can define if an object should be given a force relative to its own orientation, or if the force should be applied relative to the scene.
Given this code:
You see this result:
The Red character moves along the Y axis as expected, but the Blue character appears to move along the X axis instead. This is because the local space coordinate behaves like the push block mentioned above. In local space of the Blue item, the Y axis is forward.
I hope this helps you getting started with physics!
Thanks! That’s very helpful. It might help me solve the problem of calculating distance between two objects. I replied to that post before reading this. Regarding to the “Push” block, I’d like to see the concept of force added as an option so that acceleration from a force can be simulated. Ex. Push object of mass 2kg with a force of 1.4N. The result would be an accelerating object of 0.7 m/s2.
Just in case anybody else needs this - I’ve created a glossary of the current blockly blocks:
I haven’t worked / tried out a lot of the Physics and more advanced blocks so those are blank, feel free to add your own explanations to them in this editable version:
They’re split into ‘Basic’ and ‘Physics and Others’ right now but feel free to combine them
Looking forward to blockly documentation to use in classes with students.
Blockly support in CoSpaces was deprecated and eventually removed in favour of CoBlocks in the end of 2018. For CoBlocks reference please watch this topic.