| 74 | static void AddStaticPropPoints(std::vector<PropPoint> &propPoints, FCDSceneNode* node) |
| 75 | { |
| 76 | if (node->GetName().find("prop-") == 0) |
| 77 | { |
| 78 | // Strip off the "prop-" from the name |
| 79 | std::string propPointName (node->GetName().substr(5)); |
| 80 | |
| 81 | Log(LOG_INFO, "Adding prop point %s", propPointName.c_str()); |
| 82 | |
| 83 | // Get translation and orientation of local transform |
| 84 | |
| 85 | FMMatrix44 localTransform = node->CalculateWorldTransform(); |
| 86 | |
| 87 | HMatrix matrix; |
| 88 | memcpy(matrix, localTransform.Transposed().m, sizeof(matrix)); |
| 89 | |
| 90 | AffineParts parts; |
| 91 | decomp_affine(matrix, &parts); |
| 92 | |
| 93 | // Add prop point to list |
| 94 | |
| 95 | PropPoint p = { |
| 96 | propPointName, |
| 97 | { parts.t.x, parts.t.y, parts.t.z }, |
| 98 | { parts.q.x, parts.q.y, parts.q.z, parts.q.w }, |
| 99 | 0xff |
| 100 | }; |
| 101 | propPoints.push_back(p); |
| 102 | } |
| 103 | |
| 104 | for (size_t i = 0; i < node->GetChildrenCount(); ++i) |
| 105 | AddStaticPropPoints(propPoints, node->GetChild(i)); |
| 106 | } |
| 107 | |