Beispiel #1
0
void  Stratosphere::addClouds()
{

	for (int i = 0; i < cloudAcount; i++){

		auto cloud = createCloud();

		this->cloudVector.pushBack(cloud);
		this->addChild(cloud, this->getRandomZorder());
	}

}
Beispiel #2
0
bool MainScene::init() {
	if (!Layer::init())
		return false;

	size = Director::getInstance()->getVisibleSize();

	createBackground();
	createCloud();
	createMouse();
	createProp();
	createCucrbit();
	createWeather();
	eventProcess();
	initCucurbit();
	createProgress();
	createProgressBlood();

	LoadingScene::loadData();

	if (hudLayer != nullptr)
		hudLayer->updateIQ();

	scheduleProcess();

	isHold = false;
	isFall = false;
	isAction = false;
	isJump = false;
	isSkateboardHit = false;
	isSkateboardFinishAction = false;
	isSkateboard = false;
	isSholvePropChose = false;
	mouseFallingSnare = nullptr;
	skateboard = nullptr;
	snares.clear();

	return true;
}
Beispiel #3
0
  void cloudViewer()
  {
    ros::Publisher pub = nh.advertise<pcl::PointCloud<pcl::PointXYZRGBA> > ("/original_pointcloud", 100);

    //######################################################################################
    // if you want to visualize original pc uncomment the following
    //######################################################################################
    // cv::Mat color, depth;
    // pcl::visualization::PCLVisualizer::Ptr visualizer(new pcl::visualization::PCLVisualizer("Cloud Viewer"));
    // const std::string cloudName = "rendered";
    //
    // lock.lock();
    // color = this->color;
    // depth = this->depth;
    // updateCloud = false;
    // lock.unlock();
    //
    // createCloud(depth, color, cloud);
    //
    // visualizer->addPointCloud(cloud, cloudName);
    // visualizer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, cloudName);
    // visualizer->initCameraParameters();
    // visualizer->setBackgroundColor(0, 0, 0);
    // visualizer->setPosition(mode == BOTH ? color.cols : 0, 0);
    // visualizer->setSize(color.cols, color.rows);
    // visualizer->setShowFPS(true);
    // visualizer->setCameraPosition(0, 0, 0, 0, -1, 0);
    // // visualizer->registerKeyboardCallback(&Receiver::keyboardEvent, *this);
    //######################################################################################

    for(; running && ros::ok();)
    {
      if(updateCloud)
      {
        lock.lock();
        color = this->color;
        depth = this->depth;
        updateCloud = false;
        lock.unlock();

        createCloud(depth, color, cloud);

        //######################################################################################
        // visualizer->updatePointCloud(cloud, cloudName);
        //######################################################################################

        pcl::PointCloud<pcl::PointXYZRGBA>::Ptr msg (new pcl::PointCloud<pcl::PointXYZRGBA>);
        msg->header.frame_id = "kinect2_rgb_optical_frame";
        *msg += *cloud;
        msg->header.stamp = ros::Time::now().toNSec();
        pub.publish(msg);
      }
    //   if(save)
    //   {
    //     save = false;
    //     cv::Mat depthDisp;
    //     dispDepth(depth, depthDisp, 12000.0f);
    //     saveCloudAndImages(cloud, color, depth, depthDisp);
    //   }
      //######################################################################################
    //   visualizer->spinOnce(10);
      //######################################################################################
    }
    //######################################################################################
    // visualizer->close();
    //######################################################################################
  }