Aether3D Game Engine
Main Page
Related Pages
Namespaces
Classes
Files
File List
SpriteRendererComponent.hpp
1
#ifndef SPRITE_RENDERER_COMPONENT_H
2
#define SPRITE_RENDERER_COMPONENT_H
3
4
#include <type_traits>
5
#include <string>
6
7
namespace
ae3d
8
{
10
class
SpriteRendererComponent
11
{
12
public
:
14
SpriteRendererComponent
();
15
17
SpriteRendererComponent
(
const
SpriteRendererComponent
& other );
18
20
~SpriteRendererComponent
();
21
23
SpriteRendererComponent
&
operator=
(
const
SpriteRendererComponent
& other );
24
26
std::string
GetSerialized
()
const
;
27
29
void
Clear
();
30
42
void
SetTexture
(
const
class
TextureBase
* texture,
const
struct
Vec3
& position,
const
Vec3
& dimensionPixels,
const
struct
Vec4
& tintColor );
43
44
private
:
45
friend
class
GameObject
;
46
friend
class
Scene
;
47
48
/* \return Component's type code. Must be unique for each component type. */
49
static
int
Type() {
return
1; }
50
51
/* \return Component handle that uniquely identifies the instance. */
52
static
unsigned
New();
53
54
/* \return Component at index or null if index is invalid. */
55
static
SpriteRendererComponent
* Get(
unsigned
index );
56
57
/* \param projectionModelMatrix Projection and model matrix combined. */
58
void
Render(
const
float
* projectionModelMatrix );
59
60
struct
Impl;
61
Impl& m() {
return
reinterpret_cast<
Impl&
>
(_storage); }
62
Impl
const
& m()
const
{
return
reinterpret_cast<
Impl const&
>
(_storage); }
63
64
static
const
std::size_t StorageSize = 1384;
65
static
const
std::size_t StorageAlign = 16;
66
67
std::aligned_storage<StorageSize, StorageAlign>::type _storage;
68
};
69
}
70
#endif
ae3d::SpriteRendererComponent::SpriteRendererComponent
SpriteRendererComponent()
Constructor.
ae3d
Definition:
AudioClip.hpp:4
ae3d::Vec4
4-component vector.
Definition:
Vec3.hpp:351
ae3d::SpriteRendererComponent::Clear
void Clear()
Removes all textures that were added using SetTexture.
ae3d::SpriteRendererComponent::GetSerialized
std::string GetSerialized() const
ae3d::SpriteRendererComponent::SetTexture
void SetTexture(const class TextureBase *texture, const struct Vec3 &position, const Vec3 &dimensionPixels, const struct Vec4 &tintColor)
ae3d::Vec3
3-component vector.
Definition:
Vec3.hpp:12
ae3d::SpriteRendererComponent::~SpriteRendererComponent
~SpriteRendererComponent()
Destructor.
ae3d::GameObject
GameObject is composed of components that define its behavior.
Definition:
GameObject.hpp:9
ae3d::SpriteRendererComponent::operator=
SpriteRendererComponent & operator=(const SpriteRendererComponent &other)
ae3d::SpriteRendererComponent
Renders sprites.
Definition:
SpriteRendererComponent.hpp:10
ae3d::Scene
Contains game objects in a transform hierarchy.
Definition:
Scene.hpp:16
ae3d::TextureBase
Base class for textures.
Definition:
TextureBase.hpp:47
Generated on Wed Nov 18 2015 22:17:00 for Aether3D Game Engine by
1.8.9.1