File: PointVolume.cpp

package info (click to toggle)
freespace2 25.0.0%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky
  • size: 47,232 kB
  • sloc: cpp: 657,500; ansic: 22,305; sh: 293; python: 200; makefile: 198; xml: 181
file content (21 lines) | stat: -rw-r--r-- 833 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "PointVolume.h"

#include "math/vecmat.h"

namespace particle {
	PointVolume::PointVolume() : m_modular_curve_instance(m_modular_curves.create_instance()) { };

	vec3d PointVolume::sampleRandomPoint(const matrix &orientation, decltype(ParticleEffect::modular_curves_definition)::input_type_t source, float particlesFraction) {
		auto curveSource = std::tuple_cat(source, std::make_tuple(particlesFraction));

		return pointCompensateForOffsetAndRotOffset(ZERO_VECTOR, orientation,
					m_modular_curves.get_output(VolumeModularCurveOutput::OFFSET_ROT, curveSource, &m_modular_curve_instance),
					m_modular_curves.get_output(VolumeModularCurveOutput::POINT_TO_ROT, curveSource, &m_modular_curve_instance));
	}

	void PointVolume::parse() {
		ParticleVolume::parseCommon();

		m_modular_curves.parse("$Volume Curve:");
	}
}