MCPcopy Create free account
hub / github.com/ThatOpen/engine_web-ifc / GetWorldTransformMatrix

Function GetWorldTransformMatrix

src/cpp/wasm/web-ifc-wasm.cpp:322–339  ·  view source on GitHub ↗

* @brief Returns the 4x4 world transformation matrix for a given placement Express ID, * flattened into a 1D array of 16 doubles in **column-major order**. * * @param modelID: ID of the IFC model. * @param placementExpressId: Express ID of the placement (e.g. IfcLocalPlacement). * @return std::array containing the flattened matrix. */

Source from the content-addressed store, hash-verified

320 * @return std::array<double,16> containing the flattened matrix.
321 */
322std::array<double, 16> GetWorldTransformMatrix(uint32_t modelID, uint32_t placementExpressId)
323{
324 std::array<double, 16> out{};
325 if (!manager.IsModelOpen(modelID))
326 return out;
327
328 glm::dmat4 m = manager.GetGeometryProcessor(modelID)->GetLoader().GetLocalPlacement(placementExpressId);
329
330 int index = 0;
331 for (int col = 0; col < 4; ++col)
332 {
333 for (int row = 0; row < 4; ++row)
334 {
335 out[index++] = m[col][row];
336 }
337 }
338 return out;
339}
340std::vector<uint32_t> GetLineIDsWithType(uint32_t modelID, emscripten::val types)
341{
342 if (!manager.IsModelOpen(modelID))

Callers

nothing calls this directly

Calls 3

GetLocalPlacementMethod · 0.80
GetGeometryProcessorMethod · 0.80
IsModelOpenMethod · 0.45

Tested by

no test coverage detected