MCPcopy Create free account
hub / github.com/ElectroZybr/LatticeLab / randomRotationMatrix

Method randomRotationMatrix

Lattice/Engine/Simulation.cpp:70–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68Simulation::Simulation() = default;
69
70glm::mat3 Simulation::randomRotationMatrix() {
71 static thread_local std::mt19937 rng(std::random_device{}());
72 std::uniform_real_distribution<float> angleDist(0.0f, glm::two_pi<float>());
73
74 const glm::quat qx = glm::angleAxis(angleDist(rng), glm::vec3(1.0f, 0.0f, 0.0f));
75 const glm::quat qy = glm::angleAxis(angleDist(rng), glm::vec3(0.0f, 1.0f, 0.0f));
76 const glm::quat qz = glm::angleAxis(angleDist(rng), glm::vec3(0.0f, 0.0f, 1.0f));
77 return glm::mat3_cast(qz * qy * qx);
78}
79
80void Simulation::finishAtomBatch() {
81 if (!atomBatchActive_) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected