MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ random_position_sphere_surface()

glm::vec3 MayaFlux::Nodes::Network::ParticleNetwork::random_position_sphere_surface ( float  radius) const
private

Random position on sphere surface.

Definition at line 649 of file ParticleNetwork.cpp.

650{
651 float theta = 2.0F * glm::pi<float>() * (static_cast<float>(rand()) / RAND_MAX);
652 float phi = std::acos(2.0F * (static_cast<float>(rand()) / RAND_MAX) - 1.0F);
653
654 return {
655 radius * std::sin(phi) * std::cos(theta),
656 radius * std::sin(phi) * std::sin(theta),
657 radius * std::cos(phi)
658 };
659}

Referenced by initialize_particle_positions().

+ Here is the caller graph for this function: