File: ParticleInitializer.h

package info (click to toggle)
jazz2-native 3.5.0-1
  • links: PTS, VCS
  • area: contrib
  • in suites:
  • size: 16,836 kB
  • sloc: cpp: 172,557; xml: 113; python: 36; makefile: 5; sh: 2
file content (49 lines) | stat: -rw-r--r-- 1,739 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once

#include "../Primitives/Vector2.h"

namespace nCine
{
	/// Initialization parameters for particles
	/*! The vectors define a range between a minimum and a maximum value */
	struct ParticleInitializer
	{
		Vector2i rndAmount = Vector2i(1, 1);
		Vector2f rndLife = Vector2f(1.0f, 1.0f);
		Vector2f rndPositionX = Vector2f::Zero;
		Vector2f rndPositionY = Vector2f::Zero;
		Vector2f rndVelocityX = Vector2f::Zero;
		Vector2f rndVelocityY = Vector2f::Zero;
		Vector2f rndRotation = Vector2f::Zero;
		bool emitterRotation = true;

		void setAmount(std::int32_t amount);
		void setAmount(std::int32_t minAmount, std::int32_t maxAmount);

		void setLife(float life);
		void setLife(float minLife, float maxLife);

		void setPosition(float x, float y);
		void setPosition(float minX, float minY, float maxX, float maxY);
		void setPositionAndRadius(float x, float y, float radius);
		void setPosition(Vector2f pos);
		void setPosition(Vector2f minPos, Vector2f maxPos);
		void setPositionAndRadius(Vector2f pos, float radius);
		void setPositionInDisc(float radius);

		void setVelocity(float x, float y);
		void setVelocity(float minX, float minY, float maxX, float maxY);
		void setVelocityAndRadius(float x, float y, float radius);
		void setVelocityAndScale(float x, float y, float minScale, float maxScale);
		void setVelocityAndAngle(float x, float y, float angle);
		void setVelocity(Vector2f vel);
		void setVelocity(Vector2f minVel, Vector2f maxVel);
		void setVelocityAndRadius(Vector2f vel, float radius);
		void setVelocityAndScale(Vector2f vel, float minScale, float maxScale);
		void setVelocityAndAngle(Vector2f vel, float angle);

		void setRotation(float rot);
		void setRotation(float minRot, float maxRot);
	};

}