Skip to main content

Vehicle physics

Verified via reverse engineering

Traced in FarCry2_server (symbols) and mapped into Dunia.dll (Steam v1.03). Addresses without a binary named are Steam Dunia.dll. Vehicle Overhaul (mods/vehicle-overhaul) drives everything below on the player's car, and its speed, braking, grip and centre-of-mass changes were felt in game.

Cars are the Havok vehicle kit, assembled in code from the archetype's WheeledParams. The .hkx holds only bodies, shapes and hinges. FC2 replaces four Havok components with its own subclasses and leaves the transmission, brake and velocity damper as Havok made them. Boats and the paraglider are plain hkpUnaryActions and do not use the kit.

Building a car​

CPhysWheeledVehicleEntityImpl::BuildVehicle (0x104ACA30) allocates the components and runs SetupVehicleData (0x104AB610), then one SetupComponent per component, then hkpVehicleInstance::init.

Archetype fieldBecomesNote
fEnginePowerengine maxTorquepeak torque in N·m at 5,500 rpm, not power
fGearBoxTopSpeed, nGearsprimaryTransmissionRatiocalculatePrimaryTransmissionRatio(fGearBoxTopSpeed, 0.4, 7500, topGear): the speed is in mph and the wheel radius a fixed 0.4 m
fTorqueRoll/Pitch/YawFactorhkpVehicleData +0x60/+0x64/+0x68how much tyre forces roll, pitch and yaw the chassis; 1 is physical
fChassisUnitInertiaYaw/Roll/Pitch+0x74/+0x78/+0x7Cthe chassis body's inertia per kilogram: hkpVehicleInstance::init sets the body's to the mass times each
Wheel fBrakingTorquebrake maxBreakingTorque
Wheel fSuspStrength, dampingsuspension spring parametersper kilogram of chassis mass
Wheel fSuspLengthsuspension length
fMass, vectorCenterOfMassOffsetthe chassis bodythe centre of mass is the shape's, plus the offset

Fixed in code, out of the archetype's reach:

  • Engine: 1,000 / 5,500 / 7,500 rpm, torque factor 0.8 at minimum and 0 at maximum rpm, resistance 0.05 / 0.1 / 0. Gears 1.5, 1.2, 0.9, 0.75, then each 0.75 of the last; shifts at 6,500 up and 3,500 down; reverse 1.75.
  • Tyres: friction 3.0, at most 6.0; width 0.2. The radius is half the wheel body's height in the .hkx. Viscosity friction 0.05, slip angle 0, force feedback 0.1, and a contact body may be pushed at up to twice gravity.
  • Friction solver: frictionEqualizer 0.5, where Havok's default is 0, so FC2 chose it. maxVelocityForPositionalFriction stays at Havok's 10.
  • Drive: the torque is split evenly over the wheels whose bDriving is set, and the rest get none. All four of the Datsun's are set, so it is four-wheel drive at 0.25 each.
  • Axles: wheels 0 and 1 are the front axle, 2 and 3 the rear (PostSerialize sets each wheel's axle to its index ÷ 2). hkpVehicleData::init takes each axle's lever point from the last wheel on it, not from an average.
  • Brakes: a full pedal locks a wheel only after wheelsMinTimeToBlock, set to 1,000 s, so the wheels never lock. The pedal input that counts as blocking is 0.9.
  • Aerodynamics: air density 1.3, frontal area 1, drag 0.7, lift −0.3, and extraGravity (0, 0, −5): five more m/s² of downward pull on every car.
  • Velocity damper: spin damping 1.0 under 4 rad/s, which stops slow spins.
  • Only wheels 0 and 1 steer.

hkpVehicleData::init (0x10BF9C70) derives the chassis's response to tyre forces at +0x180: (pitch, roll, yaw factor ÷ unit inertia) ÷ mass. It also derives the friction solver's lever arms from the chassis centre of mass and each wheel's axle: its hardpoint plus the suspension direction times the suspension length. Running it again after moving the centre of mass or changing a suspension length rebuilds both.

The new constants above were read on GOG (SetupVehicleData 0x1049DA20) against the Havok class tables in the server's symbols (RE-verified).

The springs, the dampers and the body's inertia all scale with the chassis mass, so the mass cancels out of how the body moves on its suspension. A heavy car rocks as a light one does unless its per-kilogram values or wheel positions differ. Retail gives the 4,000 kg big truck the Datsun's unit inertias, 1 / 0.8 / 1, so the truck pitches and rolls as readily as the Datsun. The inertia is set in the server's hkpVehicleInstance::init (RE-verified).

What a car's model has to satisfy​

The wheels are matched to the model in SetupWheels (GOG 0x1006EC90, server CVehicleWheeledPhysComponent::SetupWheels). Each wheel node is put in a slot by its quadrant in model space:

SlotQuadrant
0y ≥ 0, x ≤ 0
1y ≥ 0, x > 0
2y < 0, x ≥ 0
3y < 0, x < 0

A car whose model breaks a rule gets no physics, and nothing says so. CreatePhysics frees the descriptor and returns without a physics entity, and neither function logs. It happens when:

  • two wheels land in the same quadrant
  • a wheel's body index is past the .hkx's body count, which includes a rigid-body name the .hkx does not have
  • there are more wheel primitives than [Wheels] entries, or the counts differ
  • a node's position or matrix cannot be found

The chassis body should be unrotated. Wheel hardpoints are brought into the body's frame as conj(q)·p − t and back out as R·p + t. These agree only when t = R·t, so a rotated body that is also offset gets wrong hardpoints in Havok itself, not just wrongly drawn wheels. All of this is RE-verified on GOG.

.hkx files are a 16-byte Dunia prefix and then a Havok 5.5.0-r1 packfile: all 2,745 retail files carry 57E0E057 10C0C010 at +0x10. The loader reads from +0x10 and refuses packfile versions below 4. See .hkx for the whole format.

Every step​

CHkPhysVehicleInstance::applyAction (0x104AC570) runs CPhysWheeledVehicleEntityImpl::Action (0x104AC3A0) and then Havok's own step. Action applies rolling resistance and sets the engine's peak torque:

maxTorque = (enginePower + fExtraClimbEnginePower × max(0, nose-up)) × enginePowerScale

enginePower is Impl + 0x1C4, the climb power +0x1C8, the scale +0xCC. The climb term is the archetype's assist for hills: 400 on top of the Rover's 95.

Rolling resistance (0x104ABF70): above 1 m/s, each wheel pushes back by the ground's fRollResist times its suspension force. Retail physicmaterial.xml has 0.1 everywhere, about 1.5 m/s² on a coasting car.

Gear changes: Havok's own hkpVehicleDefaultTransmission::updateCurrentGear changes down below the downshift rpm and up above the upshift rpm whenever the car is not reversing, even while a change already has the clutch out. Each change starts the clutch delay again. On a hill this hunts: the car slows while the clutch is out after a change up, and changes back down before the clutch is in. The gear count is read every step (RE-verified in the server).

Speed limiter: CHkPhysVehicleAerodynamics::calcAerodynamics (0x104C7FB0) adds 10 × mass × (v − 16.667)² against the horizontal velocity above 16.667 m/s when aerodynamics +0x30 is set. That is a hard ceiling at about 60 km/h. SetDriver sets the flag for a human driver or none, and clears it for AI.

Grip: the wheel collide's ground-friction override (0x104C7520) takes the ground's tyre friction from physicmaterial.xml and multiplies it by the wheel's 3.0. The handbrake lowers it on the rear wheels while steering. On slopes it fades from full at fGroundFrictionReduceMinAngle to nothing at MaxAngle.

The retail tyre frictions are Default 0.8, Metal 0.8, Grass 0.75, Stone 0.7, Wood 0.68 and Sand 0.65. The normal and terrain tyres are identical, and a rigid body's friction is 0.4. So a car's grip is 3.0 × 0.65–0.8, the same front and rear, capped at 6.0.

Engine start and fire​

A car's engine starts after a delay set by its damage level (GOG 0x1006E4F0; offsets from the server's RegisterProperties) (RE-verified):

LevelHealth ratioStarts once EngineStartTimer passesPower scale
0above MinorDamageLevelMintEngineStartTime1.0
1above MajorDamageLevelMinorDamageEngineStartTimeMinorDamageEngineScale
2above 0MajorDamageEngineStartTimeMajorDamageEngineScale
3, broken0never—

A damaged level also needs its scale above 0, and the car needs its ignition. The scale goes to the physics entity every frame; that it scales engine power is likely but was not traced. Retail uses 0.5 / 0.8 / 1.2 s on 19 archetypes and 0.8 / 1.2 / 1.5 s on 5. The scales are 0.66 and 0.33 on 22 archetypes.

When the engine breaks, CVehicleTypeEngine::Update starts a fire timer. After fFireDelay the engine catches fire, and after fExplosionDelay more it explodes. The fire delay is 30 s and the explosion delay 5 s on all 22 engines.

Paint​

CVehicleMaterialComponent::ApplyChanges (GOG 0x105487A0) paints a car from a fixed table of 61 colours, 0x50 bytes each (RE-verified). Each entry is five colours, written to both the clean and the broken parameter of the same name: DiffuseColorBase, DiffuseColor1, DiffuseColor2, SpecularColorBase and SpecularColor1. The table is used only when ColorOverride is set and Destroyed is not. A destroyed car gets the burnt colours whatever its override says. Entry 60 is forced, with its own dust and dirt values, by a flag on the graphic component whose meaning is unknown.

The five colours go to the Vehicle shader:

  • base: DiffuseColorBase, where the mask's blue is 0
  • paint: DiffuseColor1, where it is 1
  • dirt: DiffuseColor2, the dirt layer's tint
  • two speculars: SpecularColorBase and SpecularColor1

The archetype picks the entry (RE-verified on GOG):

  • nMinRandomColorIndex and nMaxRandomColorIndex are the range.
  • selVehicleColor is the fixed pick.
  • The vehicle component's init (0x100E7880) rolls selVehicleColor uniformly in the range when min < max and a condition on the entity holds. That condition was not identified.
  • It then copies the index and the archetype's dirt and dust factors to the material component.
  • Material component offsets: dirt +0x2C, dust +0x30, index +0x34.
  • ApplyChanges clamps dirt and dust to 0–0.9 before writing dirtBlendFactor and dustBlendFactor. A Glass material passes them through a power curve; its exponent was not read.
  • The ranges in world 1 are below. Entries 26–41, the APR/UFLL faction colours, are in no archetype's range.
ArchetypeRangeDustDirt
Buggy1–40.150
Datsun, Quad (DLC_Vehicle1)5–100.150
Paraglider11–130.60
Rover, Unimog (DLC_Vehicle2)14–210.150
Swamp boat22–2500
Fishing boat42–4610
Big truck47–510.150
Jeep Liberty52–540.150
Jeep Wrangler56–590.150

The Scripted… variants carry dirt 0.15. The Unimog's paint materials have ColorOverride 0, so it keeps its own grey whatever entry it rolls.

The table is not constant data. A static initializer (0x10D383A0) fills it into writable memory at 0x115953D0 when the DLL loads, so a plugin can rewrite any entry after that. An index past 60 runs into the burnt colours at 0x115966E0, so new colours have to take existing slots. Each entry's base and paint colours, as RGB, of 61 entries named by the archetype's enumVehicleColor list:

Base and paint per entry
#NameBasePaint
0Default (Green)0.219 0.227 0.1640.383 0.383 0.289
1Buggy Blue0.000 0.102 0.2190.016 0.445 0.813
2Buggy Orange0.000 0.102 0.2190.742 0.313 0.000
3Buggy Red0.000 0.102 0.2190.664 0.000 0.188
4Buggy Yellow0.000 0.102 0.2191.102 0.914 0.258
5Datsun Brown0.266 0.266 0.2660.391 0.117 0.078
6Datsun Gold0.266 0.266 0.2661.383 0.813 0.000
7Datsun Green0.266 0.266 0.2660.031 0.258 0.313
8Datsun Magenta0.266 0.266 0.2660.820 0.008 0.211
9Datsun White0.266 0.266 0.2661.375 1.375 1.211
10Datsun Yellow0.266 0.266 0.2661.289 1.328 0.711
11Glider Purple-White0.547 0.547 0.5470.422 0.000 0.516
12Glider Red-Blue0.000 0.266 0.6250.695 0.055 0.055
13Glider Yellow-Green0.164 0.523 0.0470.672 0.523 0.000
14Rover Blue0.055 0.094 0.0700.375 0.797 1.367
15Rover Green0.055 0.094 0.0700.219 0.328 0.258
16Rover Orange0.109 0.039 0.0001.266 0.445 0.000
17Rover Red0.109 0.070 0.0001.328 0.211 0.133
18Rover Sand0.109 0.070 0.0000.859 0.688 0.633
19Rover Turquoise0.094 0.109 0.1090.602 0.867 1.109
20Rover White0.328 0.297 0.2891.359 1.234 1.188
21Rover Yellow0.094 0.078 0.0551.188 0.820 0.000
22–25Swamp boatcoloured0.781 0.711 0.656
26–32APR, per vehicledark red to blackreds
33–39UFLL, per vehicledark brownsyellows
40–46Fishing boat
47Big Truck Blue0.195 0.164 0.1020.180 0.531 0.664
48Big Truck Bourgogne0.117 0.102 0.0630.469 0.250 0.180
49Big Truck Green0.078 0.070 0.0390.266 0.508 0.211
50Big Truck Grey0.078 0.070 0.0390.352 0.352 0.352
51Big Truck Red0.117 0.102 0.0630.664 0.063 0.063
52Jeep Liberty Blue0.000 0.047 0.1560.000 0.133 0.469
53Jeep Liberty Green0.156 0.117 0.0630.039 0.156 0.000
54Jeep Liberty Grey0.133 0.133 0.1330.781 0.781 0.781
55Jeep Liberty Mission0.078 0.078 0.0780.078 0.078 0.078
56Jeep Wrangler Black0.078 0.078 0.0780.078 0.078 0.078
57Jeep Wrangler Blue0.000 0.047 0.1560.000 0.133 0.469
58Jeep Wrangler Green0.156 0.117 0.0630.039 0.156 0.000
59Jeep Wrangler White0.078 0.078 0.0781.133 1.133 1.133
60(forced entry)1.016 1.016 1.0160.000 0.266 0.625

The dirt colour is 0.438 0.406 0.344 on every car entry except Rover Orange and Rover Sand, which use 0.875 0.813 0.688. Entry 8 matches the Datsun body material's own DiffuseColor1 exactly.

Collision layers​

A collision filter word holds the layer in bits 0–14 and the system group in bits 17–31. Bit 15 marks a mask rather than a layer and bit 16 pairing. Layer 3 is the character capsules. Some queries filter by a mask of layers, layer n being bit n − 1 (RE-verified on GOG):

QueryMaskLayers
Bullets0x5BB1, 2, 4, 5, 6, 8, 9, 11 — not 3
AI sight0x5BFthe same plus 3
Wheel rays0x331, 2, 5, 6

Mounted guns overheat​

A mounted gun's heat rises by a fixed amount per bullet, up to 100 (GOG 0x100C4EC0). At 100 its heat state goes up and the heat resets to 0. After a delay it cools at a rate per second, and at 0 the state goes down and the heat is set back to 100 (0x100C4F20). The last state locks the weapon. The data per gun (RE-verified):

GunHeat per bulletCoolingDelay
M2450 / s2 s
M2492not checkednot checked
MK1930, or 35 on some variantsnot checked3 s on those variants

Suspension​

Each wheel is a ray, cast by CHkPhysVehicleRaycastWheelCollide::collideWheels from the suspension's hardpoint along its direction, for the suspension length plus the wheel radius. With no hit the wheel has no contact and hangs at the full length. With a hit its length is the hit distance less the radius, unclamped, so it goes negative when the ground is closer than the radius.

The spring is Havok's own. CHkPhysVehicleSuspension::calcSuspension (0x104C76D0, not marked as a function) calls hkpVehicleDefaultSuspension::calcSuspension (0x10BFA510) and keeps the forces it returns at +0x20. For each wheel in contact:

force = (strength × (length − current) × clippedInvContactDotSuspension − damping × closingSpeed) × chassis mass

The damping is the compression one while the closing speed is negative, the rebound one otherwise. The suspension length is both the ray's reach and where the spring stops pushing, so a wheel droops no further than the point where its force reaches zero, and a spring never pulls.

hkpVehicleInstance::applyAction (0x10BF59E0) pushes the chassis by each force along the contact normal, at the suspension's hardpoint rather than at the contact. It solves grip per axle, not per wheel. An axle's contact is the average of its wheels' contacts, and its friction the average of their friction, with a wheel in the air counting as 0. Its load is the sum of their suspension forces, and its drive and brake forces the sums of theirs. A wheel lifting off halves its axle's friction.

CVehicleWheeledPhysComponent::UpdateWheelBonePositions places each wheel's bone every frame. The position is the hardpoint plus the suspension direction times the current length, from 0 up. The rotation, from CPhysWheeledVehicleEntityImpl::GetWheelLocalOrientation (0x104AB1E0), is a fixed turn per wheel times its spin times the steering angle, which the bone eases toward at 3 per second. The bone is given the inverse of the model's rotation times that one. Wheels never tilt.

Driver input​

SVehicleImpl::UpdateInput (0x100DD9E0) turns the controls into pedals every frame:

  • Reverse while rolling forward is the brake: on a keyboard a full pedal, at once.
  • Under 1.5 m/s, a pedal against the motion also pulls the handbrake.
  • At a stop with no pedal, the handbrake holds the car.
  • Reverse throttle is all or nothing.

fAccelerationPushFactor only moves the driver's view with acceleration. fJumpOutBrakeFactor is the brake pedal left on when the driver gets out.

Steering​

CHkPhysVehicleSteering::calcMainSteeringAngle (0x104C7340) replaces Havok's steering. It turns the front wheels by speed and by how long the key is held, and knows nothing of the tyres' grip:

  • t is the forward speed over the steering's fMaxSpeed, at most 1. It has no lower bound, so it goes negative in reverse.
  • An input under 0.7 sets the angle at once, up to lerp(fLowDirectMaxAngle, fHighDirectMaxAngle, t).
  • From 0.7 up, as a held key is, the angle starts from the direct one and winds out at lerp(fLowSteerSpeed, fHighSteerSpeed, t) per second to lerp(fLowMaxAngle, fHighMaxAngle, t).
  • An AI driver's input sets the angle straight to the maximum times the input. With timed steering off, the steering is Havok's own, which narrows the angle by (fMaxSpeedFullSteeringAngle / v)² above that speed.

The Datsun's wheels turn 10° at once and wind out at 10°/s, to 25° standing still and 10° from 12 m/s (43 km/h) up, so at speed a held key gets no more than a tap.

Who is driving​

CPhysWheeledVehicleEntityImpl::SetDriver(int) (no function start in the address library; found by pattern) is told 0 for no driver, 1 for a human and 2 for AI. It sets the speed limiter and the steering mode, and resets the AI's boost multipliers, SetSpecialEnginePowerMultiplier (0x104AACF0, +0x1C4 = +0x1E0 × m) and SetSpecialPrimaryRatioMultiplier (0x104AAD10).

Breakable parts​

CVehiclePhysComponent holds a vehicle's parts: doors, hood, bumpers, cargo boxes. Each part is a list of states, and each state names a body in the .hkx, a graphic object and a part id. Damage moves a part on to a later state, never back. Traced in FarCry2_server and matched in Steam Dunia.dll (RE-verified):

  • Hinged parts: Finalize (server 0x090BA320) makes a part hinged (type 3) when any .hkx constraint names the body of its current state. CreateConstrainedPart (server 0x090B3110) then spawns that body as a rigid entity of its own, hinged to the frame part, at the entity's position plus CPhysResource::GetBodyPos. CPart::GotoStateIndex (Steam 0x1006D920) does the same when a part moves into such a state, but only while bKeepAttached is false.
  • Drawing: OnMove (server 0x090B8C00, Steam 0x1006EE10) runs every frame. It copies each hinged body's transform, relative to the vehicle, onto its graphic object's node with SetNodeMatrix. It also sets the engine-running flag once EngineStartTimer passes the damage level's start time (engine start).
  • Bodies by name: a state's body is looked up by name (SetupRigidBodyIndices, GetBodyIndexFromName).
  • Getting in and out: AttachToSeat and TryLeaveVehicle call PushConstrainedPart, an impulse of 3.0 on every hinged part.
  • Saves: GetSavedParts (Steam 0x1006E120) appends each part's health (float) and state index (u32).

The retail game never reads a vehicle's baked descriptor (CFileDescriptorComponent.hidDescriptor):

  • CGraphicComponent::IsLoadingFromFileDescriptor is true only while CRequestManager+0x2E1 is clear. That byte is the engine's switch for loading from archives, set from SEngineParameters+0x1D, and it also gates InitBigFile.
  • So the skeleton comes from the .xbg's nodes (AddGeomNodesToSkeleton), the objects from the serialized CGraphicComponent list and the parts from the serialized Parts.
  • The big truck confirmed it in game: a bone added only to the descriptor was not drawn, and the same bone as an .xbg node was.

Adding a moving part to a vehicle builds a part on all of this.

Layout​

CVehiclePhysComponent: parts +0x3C (stride 0x84), part count +0x40, frame part +0x80, EngineStartTimer +0xB8, engine running +0x100. A part: what holds its body +0x00, states +0x08 (stride 0x18: body index +0x08, high-res body index +0x0C, graphic object +0x10, part id +0x14), name hash +0x58, state +0x5C, health +0x6C, type +0x7C (2 still, 3 hinged, 4 detached), bKeepAttached +0x80.

The frame part's body is a CPhysEntity. Its vtable slot 0x28 returns its CPhysVehicleEntity, or null. A car's is a CPhysWheeledVehicleEntity (Steam vtable 0x10E659B0, 0x60 bytes), a wrapper with the CPhysWheeledVehicleEntityImpl at +0x5C.

A body's constraints are in two lists on its hkpEntity:

  • Master list: +0x98 data and +0x9C a u16 count. The entries are 0x30-byte hkConstraintInternals, each starting with its instance.
  • Slave list: +0xA0 pointers to the instances and +0xA4 their count.

A part's hinge was found in the chassis's master list.

hkpLimitedHingeConstraintData:

OffsetField
+0x10first atom's type (2)
+0xA0angular motor atom (type 18)
+0xA2motor enabled
+0xB0motor; its type byte at +0x08 is 2 for a velocity motor
+0xB6angular friction enabled

setMotorActive writes the motor flag and the opposite friction flag.

CPhysWheeledVehicleEntityImpl:

OffsetField
+0x68chassis hkpRigidBody
+0x184hkpVehicleInstance
+0x18Cwheel count
+0x1C0suspension component; +0x20 holds each wheel's last suspension force
+0x1C4 / +0x1C8engine power, climb power
+0x1DC / +0x1E0the retail primary ratio and engine power

hkpVehicleInstance: chassis +0x18, data +0x1C, steering +0x24, engine +0x28, transmission +0x2C (downshift rpm +0x08, upshift rpm +0x0C, primary ratio +0x10, clutch delay +0x14, reverse ratio +0x18, the forward gears' ratios +0x1C and their count +0x20; read on GOG in the transmission's setup at 0x1049DE10), brake +0x30 (wheels +0x08, stride 0x0C; lock time +0x14), suspension +0x34 (wheels +0x08, stride 0x30, length +0x20; springs +0x14, stride 0x0C), aerodynamics +0x38 (extraGravity +0x20, limiter +0x30), velocity damper +0x44 (spin damping +0x08), wheel infos +0x48 (stride 0xC0: ground friction +0x20, contact body +0x24, hardpoint +0x30, ray end +0x40, suspension length +0x50, spin angle +0xA4), rpm +0xB8. The gearbox's state, which the instance hands the transmission and takes back each step: reversing +0xCC, gear +0xCD, clutch out +0xCE, seconds left of the clutch delay +0xD0.

A wheel collide's output, one per wheel (stride 0x40): contact point +0x00, normal +0x10, ground friction +0x20, contact body +0x24, suspension length +0x2C, closing speed +0x30, clippedInvContactDotSuspension +0x34.

CHkPhysVehicleSteering: direct angles +0x20 / +0x24, maximum angles +0x28 / +0x2C, fMaxSpeed +0x30, steer speeds +0x34 / +0x38, timed steering off +0x3C, AI input +0x3D.

hkpVehicleData: wheel parameters +0x8C (stride 0x28: radius +0x00, friction +0x0C, maximum friction +0x14, axle +0x24), chassis response +0x180, inverse mass +0x18C.

The chassis body's hkpWorld is at +0x08, and the world's gravity at its own +0x10. The chassis body's motion state starts at +0xE0: rotation, the swept centre of mass at +0x120 and +0x130, the local centre of mass at +0x160, the inverse inertia about x, y and z at +0x190 with the inverse mass at +0x19C, the linear velocity at +0x1A0. Moving the centre of mass is what hkSweptTransformUtil::setCentreOfRotationLocal does: store the new local centre, rotate the change into world space, and add it to both swept centres.