spring_comp.hpp 433 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once

#include <mirrage/ecs/ecs.hpp>
#include <mirrage/utils/sf2_glm.hpp>

namespace phase_shifter::gameplay {

	struct Spring_comp : public mirrage::ecs::Component<Spring_comp> {
		static constexpr const char* name() { return "Spring"; }
		using Component::Component;

		glm::vec3 velocity = {0.f, 0.f, 0.f};

		float spring_constant = 1.f;
		float mass            = 1.f;
	};

	sf2_structDef(Spring_comp, spring_constant);
}