Cogs.Core
TrajectoryAlignedComponent.h
1#include "Components/Core/DynamicComponent.h"
2
3#include <glm/vec3.hpp>
4#include <glm/gtc/quaternion.hpp>
5
6#include <memory>
7
8namespace Cogs
9{
10 namespace Core
11 {
12 class Context;
13
21 {
22 public:
24
27 void update();
28
30 std::shared_ptr<ComponentModel::Entity> trajectory;
31
33 float depth = 0;
34
36 glm::vec3 offset = glm::vec3(0, 0, 0);
37
39 glm::quat rotation = glm::quat();
40
41 static void registerType();
42 };
43 }
44}
45
46template<> inline Cogs::StringView getName<Cogs::Core::TrajectoryAlignedComponent>() { return "TrajectoryAlignedComponent"; }
Base class for components implementing dynamic behavior.
Aligns the entity along a trajectory at a specified depth.
glm::vec3 offset
Offset to move the entity from the sampled trajectory position.
float depth
The depth along the trajectory to position the shape at.
glm::quat rotation
Rotation around the objects local axes.
std::shared_ptr< ComponentModel::Entity > trajectory
Target trajectory along which to align.
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains all Cogs related functionality.
Definition: FieldSetter.h:23