9 #ifndef IMPNPCTRANSPORT_RANDOMIZING_H
10 #define IMPNPCTRANSPORT_RANDOMIZING_H
12 #include "npctransport_config.h"
17 IMPNPCTRANSPORT_BEGIN_NAMESPACE
19 template <
class Rig
idBody,
class BoundingVolume>
20 void randomize_rigid_body(RigidBody rbi,
const BoundingVolume &bv) {
21 core::RigidBody rb(rbi);
24 algebra::Transformation3D tr(rot, trans);
25 algebra::ReferenceFrame3D rf(tr);
26 rb.set_reference_frame(rf);
34 template <
class ParticlesList,
class BoundingVolume>
36 for (
unsigned int i = 0; i < ps.size(); ++i) {
39 if (core::RigidBody::get_is_setup(ps[i])) {
40 randomize_rigid_body(ps[i], bv);
44 }
else if (core::RigidMember::get_is_setup(ps[i])) {
50 randomize_rigid_body(parent_rb, bv);
56 IMPNPCTRANSPORT_END_NAMESPACE
void randomize_particles(const ParticlesList &ps, const BoundingVolume &bv)
bool get_coordinates_are_optimized() const
Get whether the coordinates are optimized.
Rotation3D get_random_rotation_3d()
Pick a rotation at random from all possible rotations.
void set_coordinates(const algebra::Vector3D &v)
set all coordinates from a vector
functionality for defining rigid bodies
Functions to generate vectors.
VectorD< D > get_random_vector_in(const BoundingBoxD< D > &bb)
Generate a random vector in a box with uniform density.
A decorator for a particle with x,y,z coordinates.
bool get_coordinates_are_optimized() const
A decorator for a rigid body.