aboutsummaryrefslogtreecommitdiff
path: root/source/EditorAttachmentImpl.cpp
blob: 62d15eb9bb6154a25015e6099df803975fce6a49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "EditorAttachmentImpl.hpp"
#include "EditorAttachment.hpp"

EditorAttachment::EditorAttachment() {
}

std::unique_ptr<EditorAttachment> EaGameObject::Create(GameObject* object) {
	EaGameObject* result;

	auto kind = object->GetKind();
	switch (kind) {
		case GameObject::KD_Player: result = new EaPlayer(); break;
		case GameObject::KD_LevelWrapper: result = new EaLevelWrapper(); break;

		default: result = new EaGameObject(); break;
	}

	result->name = GameObject::ToString(kind);
	result->eulerAnglesRotation = glm::eulerAngles(object->GetRotation());
	return std::unique_ptr<EditorAttachment>(result);
}