VecFlow0.1.0
Effects guides

Rigid bodies

Bricks, crates, rocks and dice that tumble, stack and come to rest; bodies moved by hand; and joints for chains, doors, wheels and drawers.

VecFlow 0.1.0

A Rigid Body makes each particle of its event a solid body of the shape it shows: it falls, tumbles, hits the others, stacks and comes to rest.

Start from

The Rigid Bodies starter: a block born each frame for 60 frames, turned at random, falling into a pile.

The Rigid Bodies starter: blocks born one a frame, turned at random, piling up on the ground.BirthForcesPhysicsLooksTests

The bodies' shapes

Each body is the shape its particle shows:

  • With a Shapes collection (the Display panel's Shapes), its object's mesh, at the particle's Scale. A Shape operator picks among several; without one, all are the first.
  • Born On Pieces, its own piece of the mesh: see Destruction.
  • Otherwise, its sphere.

The Rigid Body's Shape says how closely the body follows that:

ShapeFollowsFor
BoxThe box round itBricks, crates, books. Fastest
BallA ball round its longest sideBalls, marbles, anything that should roll
HullIt, wrapped tight with no hollowsRocks, debris, broken pieces
ConcaveIt, hollows and allCups, bowls, frames, a chair. Slowest

Weight, grip and bounce

  • Density in kg/m³: water 1,000, wood about 600, stone about 2,500, steel 7,850. A body weighs its volume at that density, so a big rock is heavy and a pebble light. It matters when bodies meet: a heavy one shoves light ones aside, and a liquid floats wood and sinks stone.
  • Friction: low and they slide off each other; high and they stack.
  • Bounce: near 0 for bricks and stone, more for rubber.

Stacks that stand

A wall or a tall stack needs its bodies to rest quietly on each other:

  • Build it in place: Birth On Vertices of a mesh with a vertex where each brick goes, with a Shapes collection of one brick, or On Pieces.
  • Rounds is how many times a step the contacts are worked out: raise it if a stack sags, jitters or creeps. Loose debris needs fewer.
  • A little Friction helps a stack stand; bricks want 0.6 or so.

Moving bodies by hand: Kinematic

A Kinematic body doesn't fall or get pushed: it moves as the event's other operators say, through colliders, shoving the others aside. A wrecking ball, a paddle, a bulldozer's blade.

  • Moved by an object: in the same event, a Pin with the object. The body goes and turns with it, so keyframe the object.
  • Moved by a speed: a Speed, and a Spin for turning.

Held still until struck

A Struck Test on kinematic bodies sends those another body strikes to an event whose Rigid Body isn't kinematic: they're freed, and take the blow. A wall stands until a ball hits it.

Joints

A Bind between rigid bodies is a joint. Bind them Nearest, with a Distance a little over the distance between their centres, and pick the Joint:

JointBodiesFor
BallTurn freely about the point between themChains, a crate on a rope, dangling things
HingeTurn only round AxisDoors, wheels, seesaws, flaps, a drawbridge
SliderSlide along Axis, without turningDrawers, pistons, lifts
FixedHold together as they areWelds
GlueAre one body, until struck or loaded too hardThings to smash: see Destruction
  • A chain: links in a row, Bind Nearest with Max 2, so each holds the one before and after, and Joint Ball.
  • Fixed to the world: bind the end to a particle held still by a Pin in another event. That event needs a Bind too, so the two find each other.
  • A door: the door body, bound to a particle held by a Pin at its hinge edge, its Bind's Joint Hinge, Axis the door's own up axis. Limits keep it between Lower and Upper.
  • A wheel or a motor: a Hinge with Motor Speed (radians a second) and Motor Strength (newton metres) drives it round.
  • Breaking: Break Load in newtons (holding 1 kg takes 9.81) and Break Torque in newton metres. Load Over averages the load, so a sudden knock counts for less than a steady pull.

Bodies meet everything

  • Bodies hit the rigid bodies of every event, and their own event's Collide objects and ground.
  • Grains with Particle Physics push bodies and are pushed by them.
  • A liquid floats them by their density, and carries them off.
  • Cloth drapes over them.

What goes wrong

  • Bodies pass through each other. They're too small or fast for the substeps: raise the bake's Substeps.
  • They're all the same shape. Add a Shape operator to pick among the Shapes collection.
  • Hull or Concave is an error. They need a Shapes collection, or pieces, to take the shape from.
  • Bodies get the wrong shapes. The Shapes collection's names sort two ways: name them alike, Rock.001, Rock.002, as the editor asks.
  • Can't share an event with Pin. Only Kinematic bodies can be pinned. Free bodies hang from a pin through a joint.

On this page