123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #include "Entity.h"
- #include "Globals.h"
- Entity::Entity(const EntityType* zType, Framework::Model3DData* model, Framework::Model3DTextur* texture, int id)
- : Model3D(), id(id), zType(zType)
- {
- setModelDaten(model);
- setModelTextur(texture);
- }
- Entity::~Entity()
- {}
- void Entity::api(char* message)
- {
- switch (message[0])
- {
- case 0:
- { // update position
- pos.x = *(float*)(message + 1);
- pos.y = *(float*)(message + 5);
- pos.z = *(float*)(message + 9);
- break;
- }
- case 1:
- { // update rotation
- // TODO
- break;
- }
- }
- }
- bool Entity::tick(double time)
- {
- return Model3D::tick(time);
- }
- int Entity::getId() const
- {
- return id;
- }
- const EntityType* Entity::zEntityType() const
- {
- return zType;
- }
- void Entity::lock()
- {
- cs.lock();
- }
- void Entity::unlock()
- {
- cs.unlock();
- }
|