qadmesh affine transform parenting

This commit is contained in:
AndreaRigoni
2026-03-19 12:54:31 +00:00
parent 887b3b36f0
commit 4cb4560921
9 changed files with 103 additions and 33 deletions

View File

@@ -71,14 +71,13 @@ void QuadMeshEmitterPrimary::CalculateAreas() {
m_CumulativeAreas.clear();
m_TotalArea = 0.0;
const auto &points = m_Mesh->Points();
const auto &quads = m_Mesh->Quads();
for (const auto &q : quads) {
uLib::Vector3f v0 = points[q(0)];
uLib::Vector3f v1 = points[q(1)];
uLib::Vector3f v2 = points[q(2)];
uLib::Vector3f v3 = points[q(3)];
uLib::Vector3f v0 = m_Mesh->GetPoint(q(0));
uLib::Vector3f v1 = m_Mesh->GetPoint(q(1));
uLib::Vector3f v2 = m_Mesh->GetPoint(q(2));
uLib::Vector3f v3 = m_Mesh->GetPoint(q(3));
double a1 = 0.5 * (v1 - v0).cross(v2 - v0).norm();
double a2 = 0.5 * (v2 - v0).cross(v3 - v0).norm();
@@ -96,11 +95,10 @@ void QuadMeshEmitterPrimary::GeneratePrimaries(G4Event *anEvent) {
int quadIdx = std::distance(m_CumulativeAreas.begin(), it);
const auto &q = m_Mesh->Quads()[quadIdx];
const auto &points = m_Mesh->Points();
uLib::Vector3f v0 = points[q(0)];
uLib::Vector3f v1 = points[q(1)];
uLib::Vector3f v2 = points[q(2)];
uLib::Vector3f v3 = points[q(3)];
uLib::Vector3f v0 = m_Mesh->GetPoint(q(0));
uLib::Vector3f v1 = m_Mesh->GetPoint(q(1));
uLib::Vector3f v2 = m_Mesh->GetPoint(q(2));
uLib::Vector3f v3 = m_Mesh->GetPoint(q(3));
// 2. Choose a point on the quad
double a1 = 0.5 * (v1 - v0).cross(v2 - v0).norm();