anchor.diff:  			Orientation
   		)
   	),
  -
  -	NewState = dict:store(linear_velocity, LinearVelocity, State),
  -	NewState1 = dict:store(angular_velocity, AngularVelocity, NewState),
  -	NewState2 = dict:store(spin, Spin, NewState1),
  -
  -	{Spin, NewState2}.
  -
  -%% --------------------------------------------------------------------------------------------------------------------
  +	NewState = State#physical{
  +		linear_velocity = LinearVelocity,
  +		angular_velocity = AngularVelocity,
  +		spin = Spin
  +	},
  +	{Spin, NewState}.
  +
  +%% ------------------------------------------------------------------------
  +
   %% @doc Simulate physical movement of the 'physical' object represented by `State`, over the given `TimeDelta`.
  -
  -simulate(TimeDelta, State) ->
  -	Position = dict:fetch(position, State),
  -	Velocity = dict:fetch(linear_velocity, State),
  -	{OrientW, OrientX, OrientY, OrientZ} = dict:fetch(orientation, State),
  -	AngularMomentum = dict:fetch(angular_momentum, State),
  +simulate(TimeDelta, InitialPhysical) ->
  +
  +	Physical = #physical{
  +			position = dict:fetch(position, InitialPhysical),
  +			linear_momentum = dict:fetch(linear_momentum, InitialPhysical),
  +			orientation = dict:fetch(orientation, InitialPhysical),
  +			angular_momentum = dict:fetch(angular_momentum, InitialPhysical),
  +
  +			force_absolute = dict:fetch(force_absolute, InitialPhysical),
  +			force_relative = dict:fetch(force_relative, InitialPhysical),
  +			torque_absolute = dict:fetch(torque_absolute, InitialPhysical),
  +			torque_relative = dict:fetch(torque_relative, InitialPhysical),
  +
  +			last_update = dict:fetch(last_update, InitialPhysical),
  +			linear_velocity = dict:fetch(linear_velocity, InitialPhysical),
  +			angular_velocity = dict:fetch(angular_velocity, InitialPhysical),
  +			spin = dict:fetch(spin, InitialPhysical),
  +
  +			mass = dict:fetch(mass, InitialPhysical),
  +			inverse_mass = dict:fetch(inverse_mass, InitialPhysical),
  +			inertia_tensor = dict:fetch(inertia_tensor, InitialPhysical),
  +			inverse_inertia_tensor = dict:fetch(inverse_inertia_tensor, InitialPhysical)
  +	},
  +
  +	NewPhysical = simulate_internal(TimeDelta, Physical),
  +
  +	dict:from_list([
  +			{ position, NewPhysical#physical.position },
  +			{ linear_momentum, NewPhysical#physical.linear_momentum },
  +			{ orientation, NewPhysical#physical.orientation },
  +			{ angular_momentum, NewPhysical#physical.angular_momentum },
  +
  +			{ force_absolute, NewPhysical#physical.force_absolute },
  +			{ force_relative, NewPhysical#physical.force_relative },
  +			{ torque_absolute, NewPhysical#physical.torque_absolute },
  +			{ torque_relative, NewPhysical#physical.torque_relative },
  +
  +			{ last_update, NewPhysical#physical.last_update },
  +			{ linear_velocity, NewPhysical#physical.linear_velocity },
  +			{ angular_velocity, NewPhysical#physical.angular_velocity },
  +			{ spin, NewPhysical#physical.spin },
  +
  +			{ mass, NewPhysical#physical.mass },
  +			{ inverse_mass, NewPhysical#physical.inverse_mass },
  +			{ inertia_tensor, NewPhysical#physical.inertia_tensor },
  +			{ inverse_inertia_tensor, NewPhysical#physical.inverse_inertia_tensor }
  +	]).
  +
  +%% ------------------------------------------------------------------------
  +
  +simulate_internal(TimeDelta, State) ->
  +	#physical{
  +		position = Position,
  +		linear_velocity = Velocity,
  +		orientation = {OrientW, OrientX, OrientY, OrientZ},
  +		angular_momentum = AngularMomentum
  +	} = State,
   
   	{Velocity1, Force1, Spin1, Torque1, State1} = evaluate(0, {0, 0, 0}, {0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0}, State),
   	{Velocity2, Force2, Spin2, Torque2, State2} = evaluate(TimeDelta * 0.5, Velocity1, Force1, Spin1, Torque1, State1),
  
positive.code: 	},
  	NextAngularMomentum = vector:add(AngularMomentum, vector:multiply(TimeDelta, Torque)),
  
  	State1 = dict:store(position, NextPosition, State),
  	State2 = dict:store(linear_velocity, NextVelocity, State1),
  	State3 = dict:store(orientation, quaternion:unit(NextOrientation), State2),
  	State4 = dict:store(angular_momentum, NextAngularMomentum, State3),
  
  	%TODO: Should _NextAngularVelocity even be returned?
  	{NextSpin, State5} = update_state(State4),
  
  	{NextForce, NextTorque} = forces(TimeDelta, State5),
  
  	{NextVelocity, NextForce, NextSpin, NextTorque, State5}.
  
  %% --------------------------------------------------------------------------------------------------------------------
  
  -spec forces(TimeDelta, State) -> {Force, Torque} when
  	TimeDelta :: float(),
  	State :: dict(),
  	Force :: vector:vec(),
  	Torque :: vector:vec().
  
  %FIXME: This should be a callback so the behavior can do stuff like target-velocity calculations.
  forces(_TimeDelta, State) ->
  	ForceAbs = dict:fetch(force_absolute, State),
  	ForceRel = dict:fetch(force_relative, State),
  	Orientation = dict:fetch(orientation, State),
  	TorqueAbs = dict:fetch(torque_absolute, State),
  	TorqueRel = dict:fetch(torque_relative, State),
  
  	Force = vector:add(ForceAbs, quaternion:rotate(ForceRel, Orientation)),
  	Torque = vector:add(TorqueAbs, quaternion:rotate(TorqueRel, Orientation)),
  
  	{Force, Torque}.
  
  %% --------------------------------------------------------------------------------------------------------------------
  
  -spec update_state(State) -> {Spin, AngularVelocity} when
  	State :: dict(),
  	Spin :: quaternion:quat(),
  	AngularVelocity :: vector:vec().
  
  update_state(State) ->
  	LinearMomentum = dict:fetch(linear_momentum, State),
  	Orientation = dict:fetch(orientation, State),
  	AngularMomentum = dict:fetch(angular_momentum, State),
  	InverseMass = dict:fetch(inverse_mass, State),
  	InverseInertia = dict:fetch(inverse_inertia_tensor, State),
  
  	LinearVelocity = vector:multiply(InverseMass, LinearMomentum),
  
  
negative.code: 	Force :: vector:vec(),
  	Spin :: quaternion:quat(),
  	Torque :: vector:vec(),
  	State :: #physical{}.
  
  evaluate(TimeDelta, Velocity, Force, Spin, Torque, State) ->
  	#physical{
  		position = Position,
  		linear_velocity = InitialVelocity,
  		orientation = Orientation,
  		angular_momentum = AngularMomentum
  	} = State,
  
  	{SpinW, SpinX, SpinY, SpinZ} = Spin,
  	{OrientW, OrientX, OrientY, OrientZ} = Orientation,
  