Animation::Animation(unsigned int rng_seed, float scale) : rng_(rng_seed), dir_(-1.0f, 1.0f), speed_(0.1f, 1.0f) { float x = dir_(rng_); float y = dir_(rng_); float z = dir_(rng_); if (std::abs(x) + std::abs(y) + std::abs(z) == 0.0f) x = 1.0f; current_.axis = glm::normalize(glm::vec3(x, y, z)); current_.speed = speed_(rng_); current_.scale = scale; current_.matrix = glm::scale(glm::mat4(1.0f), glm::vec3(current_.scale)); }
BCVideos::BCVideos(string VideoFolder) :BCBase(eBC_VIDEO, eG_BACKGROUND) ,_VideoIdx(0) { ofDirectory dir_(VideoFolder); dir_.allowExt("mov"); int iNum_ = dir_.listDir(); _VideoList.resize(iNum_); for(int idx_ = 0; idx_ < iNum_; ++idx_) { string videoPath_ = VideoFolder + dir_.getName(idx_); _VideoList[idx_].setPlayer(ofPtr<ofxHapPlayer>(new ofxHapPlayer)); _VideoList[idx_].setLoopState(ofLoopType::OF_LOOP_NORMAL); _VideoList[idx_].loadMovie(videoPath_); _VideoList[idx_].setVolume(0); } }