9void World3D::adoptPreparedTopology(World3D &prepared) {
11 adoptCouplings3D(prepared);
12 auto swapped = rigidBackend_->swapTopology(*prepared.rigidBackend_);
13 if (!swapped)
throw eve::Exception(
"%s", swapped.status().describe().c_str());
14 std::swap(nextId_, prepared.nextId_);
15 std::swap(nextShapeId_, prepared.nextShapeId_);
16 std::swap(nextJointId_, prepared.nextJointId_);
17 std::swap(nextBodyHandleIndex_, prepared.nextBodyHandleIndex_);
18 std::swap(nextShapeHandleIndex_, prepared.nextShapeHandleIndex_);
19 std::swap(nextJointHandleIndex_, prepared.nextJointHandleIndex_);
20 std::swap(bodies_, prepared.bodies_);
21 std::swap(shapes_, prepared.shapes_);
22 std::swap(joints_, prepared.joints_);
23 std::swap(mechanisms_, prepared.mechanisms_);
24 std::swap(restoredBodies_, prepared.restoredBodies_);
25 std::swap(restoredShapes_, prepared.restoredShapes_);
26 std::swap(restoredJoints_, prepared.restoredJoints_);
27 std::swap(shapeRecords_, prepared.shapeRecords_);
28 std::swap(shapeHandles_, prepared.shapeHandles_);
29 std::swap(shapeRawHandles_, prepared.shapeRawHandles_);
30 std::swap(jointHandles_, prepared.jointHandles_);
31 std::swap(simulationTick_, prepared.simulationTick_);
34 for (
Joint3D *joint : joints_) joint->world_ = this;
37 for (
Joint3D *joint : prepared.joints_) joint->world_ = &prepared;
EVENGINE_API_FOUNDATION public API.
Optional physics backend for vehicle mobility and body attach.