Static
getReturns a random 'somewhat bright' color. Avoids near-white colors.
Optional
random: Randoma random color
Static
makeMakes two blocks that are rigidly connected by two double joints, so that the blocks cannot move relative to each other. This is for testing that situations with redundant joints can be handled correctly.
the ContactSim to add the bodies
the horizontal location to move the first block
the vertical location to move the first block
the angle to set the blocks
array containing the two blocks
Static
makeMakes two 'pits' for the blocks to fall into.
Optional
opt_offset: numbervertical offset for position of walls
suggested zero energy level for blocks
Static
makeMake several blocks of random sizes (and default colors), position the first one at the given location and position the others to the right of that first block. The sizes of the blocks range from 0.2 to 1.2 on each side.
the ContactSim to add the bodies
the number of blocks to create
the location for the first block
the location for the first block
the random number generator to use for building blocks
Optional
rightAngle: booleanwhether to make right-angle blocks
the blocks that were created
Static
makeMakes a rectangular array of same-sized square blocks or circular balls that fill the given rectangle.
the ContactSim to add the blocks to
rectangle to fill with blocks
whether to make circular balls or square blocks
the radius of circular balls or half-width of square blocks
distance between each block
maximum number of blocks to make
Static
makeVPitMakes a single V-shaped 'pit' for blocks to fall into.
Optional
opt_offset: numbervertical offset for position of walls
suggested zero energy level for blocks
Generated using TypeDoc
Utility functions for making the 'pile of blocks' simulation.