|
NWengine 0.9
|
The Transform class represents the transformation of a game object. More...
#include <Transform.h>
Public Member Functions | |
| Transform () | |
| Default constructor for the Transform class. | |
| Transform (GameObject *go) | |
| Constructor for the Transform class. | |
| int | Serialize (std::fstream *data, int offset) override |
| Serializes the Transform component data. | |
| int | Deserialize (std::fstream *data, int offset) override |
| Deserializes the Transform component data. | |
| void | SetGameObject (void *go) override |
| Sets the game object attached to the Transform component. | |
| void * | GetGameObject () override |
| Gets the game object attached to the Transform component. | |
Public Member Functions inherited from GameComponent | |
| virtual void | Update () |
| Update the game component. | |
| virtual void | Start () |
| Start the game component. | |
| virtual | ~GameComponent () |
| Destructor for the game component. | |
Public Member Functions inherited from Serialized | |
| Serialized () | |
| Default constructor for Serialized class. | |
Static Public Member Functions | |
| static std::string | GetType () |
| GetType returns the type of the Transform component. | |
Static Public Member Functions inherited from GameComponent | |
| static std::string | GetType () |
| Get the type of the game component. | |
Public Attributes | |
| fVec2 | position = fVec2(0.0f,0.0f) |
| fVec2 | scale = fVec2(1.0f, 1.0f) |
| float | rotation = 0.0f |
| GameObject * | attachedObj |
Static Public Attributes | |
| static std::map< GameObject *, Transform > | componentList |
The Transform class represents the transformation of a game object.
Represents a transform component that defines the position, rotation, and scale of a game object.
| Transform::Transform | ( | GameObject * | go | ) |
Deserializes the Transform component data.
| data | The file stream to read the serialized data from. |
| offset | The offset in the file stream to start reading the serialized data. |
Reimplemented from Serialized.
|
overridevirtual |
Gets the game object attached to the Transform component.
Reimplemented from GameComponent.
|
inlinestatic |
Serializes the Transform component data.
| data | The file stream to write the serialized data to. |
| offset | The offset in the file stream to start writing the serialized data. |
Reimplemented from Serialized.
Sets the game object attached to the Transform component.
| go | The game object to attach. |
Reimplemented from GameComponent.
| GameObject* Transform::attachedObj |
The game object attached to the Transform component.
|
static |
The list of game objects with Transform components.
| float Transform::rotation = 0.0f |
The rotation of the game object.