CSolidObject::CSolidObject(): mass(100000), blocking(false), floatOnWater(false), immobile(false), blockHeightChanges(false), xsize(1), zsize(1), height(1), heading(0), physicalState(OnGround), isMoving(false), isUnderWater(false), isMarkedOnBlockingMap(false), speed(0, 0, 0), residualImpulse(0, 0, 0), allyteam(0), team(0), mobility(NULL), midPos(pos), curYardMap(0), buildFacing(0) { mapPos = GetMapPos(); }
CSolidObject::CSolidObject(): mass(DEFAULT_MASS), crushResistance(0.0f), blocking(false), crushable(false), immobile(false), blockHeightChanges(false), crushKilled(false), xsize(1), zsize(1), heading(0), physicalState(OnGround), isMoving(false), isUnderWater(false), isMarkedOnBlockingMap(false), speed(ZeroVector), residualImpulse(ZeroVector), team(0), allyteam(0), mobility(NULL), collisionVolume(NULL), frontdir(0.0f, 0.0f, 1.0f), rightdir(-1.0f, 0.0f, 0.0f), updir(0.0f, 1.0f, 0.0f), relMidPos(ZeroVector), midPos(pos), mapPos(GetMapPos()), curYardMap(NULL), buildFacing(0) { }
CSolidObject::CSolidObject() : mass(100000), blocking(false), blockHeightChanges(false), floatOnWater(false), xsize(1), ysize(1), height(1), //relMidPos(0,0,0), physicalState(Ghost), midPos(pos), immobile(false), //velocity(0,0,0), //momentum(0,0,0), isMoving(false), heading(0), //newVelocity(0,0,0), //newMomentum(0,0,0), residualImpulse(0,0,0), mobility(0), yardMap(0), isMarkedOnBlockingMap(false), speed(0,0,0), isUnderWater(false) { mapPos=GetMapPos(); // mapPos.x=0; // mapPos.y=0; }
void SecurityCamera::Update(double dt, TileMap* _map) { if (!m_state) { m_timer -= dt; if (m_timer <= 0.f) // Activate camera and reset timer for next use { m_state = true; if (m_dir == Direction::DIRECTIONS[Direction::DIR_UP]) { SetMesh(s_camMeshList[CAM_ON_UP]); // Force set tilemap Tile* _tile = _map->GetTileAt(GetMapPos()); _tile->SetMesh(s_camMeshList[CAM_ON_UP]); _tile->SetType(Tile::TILE_OBJ_CAMERA_ON_1_3); } else if (m_dir == Direction::DIRECTIONS[Direction::DIR_DOWN]) { SetMesh(s_camMeshList[CAM_ON_DOWN]); // Force set tilemap Tile* _tile = _map->GetTileAt(GetMapPos()); _tile->SetMesh(s_camMeshList[CAM_ON_DOWN]); _tile->SetType(Tile::TILE_OBJ_CAMERA_ON_1_1); } else if (m_dir == Direction::DIRECTIONS[Direction::DIR_LEFT]) { SetMesh(s_camMeshList[CAM_ON_LEFT]); // Force set tilemap Tile* _tile = _map->GetTileAt(GetMapPos()); _tile->SetMesh(s_camMeshList[CAM_ON_LEFT]); _tile->SetType(Tile::TILE_OBJ_CAMERA_ON_1_2); } else if (m_dir == Direction::DIRECTIONS[Direction::DIR_RIGHT]) { SetMesh(s_camMeshList[CAM_ON_RIGHT]); // Force set tilemap Tile* _tile = _map->GetTileAt(GetMapPos()); _tile->SetMesh(s_camMeshList[CAM_ON_RIGHT]); _tile->SetType(Tile::TILE_OBJ_CAMERA_ON_1_4); } GenerateViewBox(_map); m_timer = S_M_CAMERA_MAX_TIMER; } } }
int2 CSolidObject::GetMapPos() { return GetMapPos(pos); }