CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
Helpers.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "SceneObject.hpp"
11
14
15namespace CeresEngine {
16
17 class Scene;
18
22 [[nodiscard]] inline auto move(Vector3 position) {
23 return [position](Entity&& entity) {
24 entity.get<TransformComponent>().position = position;
25 return entity;
26 };
27 }
28
32 [[nodiscard]] inline auto scale(Vector3 scale) {
33 return [scale](Entity&& entity) {
34 entity.get<TransformComponent>().scale = scale;
35 return entity;
36 };
37 }
38
42 [[nodiscard]] inline auto rotate(Vector3 rotation) {
43 return [rotation](Entity&& entity) {
44 // entity.get<TransformComponent>().rotation = rotation;
45 return entity;
46 };
47 }
48
52 [[nodiscard]] inline auto parent(const Entity& parent) {
53 return [parent](Entity&& entity) {
54 entity.setParent(parent);
55 return entity;
56 };
57 }
58
59} // namespace CeresEngine
The base entity class.
Definition Entity.hpp:41
Definition Application.hpp:19
auto move(Vector3 position)
Moves a entity to the given position.
Definition Helpers.hpp:22
auto scale(Vector3 scale)
Applies a scale to the entity.
Definition Helpers.hpp:32
auto parent(const Entity &parent)
Sets the entity parent.
Definition Helpers.hpp:52
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition SceneObject.hpp:23