当前位置: 首页>>代码示例>>C++>>正文


C++ UserData::isVisible方法代码示例

本文整理汇总了C++中nite::UserData::isVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ UserData::isVisible方法的具体用法?C++ UserData::isVisible怎么用?C++ UserData::isVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nite::UserData的用法示例。


在下文中一共展示了UserData::isVisible方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateUserState

void updateUserState(const nite::UserData& user, uint64_t ts)
{
	if (user.isNew())
	{
		USER_MESSAGE("New");
	}
	else if (user.isVisible() && !g_visibleUsers[user.getId()])
		printf("[%08" PRIu64 "] User #%d:\tVisible\n", ts, user.getId());
	else if (!user.isVisible() && g_visibleUsers[user.getId()])
		printf("[%08" PRIu64 "] User #%d:\tOut of Scene\n", ts, user.getId());
	else if (user.isLost())
	{
		USER_MESSAGE("Lost");
	}
	g_visibleUsers[user.getId()] = user.isVisible();


	if(g_skeletonStates[user.getId()] != user.getSkeleton().getState())
	{
		switch(g_skeletonStates[user.getId()] = user.getSkeleton().getState())
		{
		case nite::SKELETON_NONE:
			USER_MESSAGE("Stopped tracking.")
			break;
		case nite::SKELETON_CALIBRATING:
			USER_MESSAGE("Calibrating...")
			break;
		case nite::SKELETON_TRACKED:
			USER_MESSAGE("Tracking!")
			break;
		case nite::SKELETON_CALIBRATION_ERROR_NOT_IN_POSE:
		case nite::SKELETON_CALIBRATION_ERROR_HANDS:
		case nite::SKELETON_CALIBRATION_ERROR_LEGS:
		case nite::SKELETON_CALIBRATION_ERROR_HEAD:
		case nite::SKELETON_CALIBRATION_ERROR_TORSO:
			USER_MESSAGE("Calibration Failed... :-|")
			break;
		}
	}
}
开发者ID:kwiateusz,项目名称:NxtControl,代码行数:40,代码来源:Viewer.cpp

示例2: updateUserState

void updateUserState(const nite::UserData& user, unsigned long long ts)
{
	if (user.isNew())
		USER_MESSAGE("New")
	else if (user.isVisible() && !g_visibleUsers[user.getId()])
	USER_MESSAGE("Visible")
	else if (!user.isVisible() && g_visibleUsers[user.getId()])
	USER_MESSAGE("Out of Scene")
	else if (user.isLost())
	USER_MESSAGE("Lost")

	g_visibleUsers[user.getId()] = user.isVisible();


	if(g_skeletonStates[user.getId()] != user.getSkeleton().getState())
	{
		switch(g_skeletonStates[user.getId()] = user.getSkeleton().getState())
		{
		case nite::SKELETON_NONE:
			USER_MESSAGE("Stopped tracking.")
				break;
		case nite::SKELETON_CALIBRATING:
			USER_MESSAGE("Calibrating...")
				break;
		case nite::SKELETON_TRACKED:
			USER_MESSAGE("Tracking!")
				break;
		case nite::SKELETON_CALIBRATION_ERROR_NOT_IN_POSE:
		case nite::SKELETON_CALIBRATION_ERROR_HANDS:
		case nite::SKELETON_CALIBRATION_ERROR_LEGS:
		case nite::SKELETON_CALIBRATION_ERROR_HEAD:
		case nite::SKELETON_CALIBRATION_ERROR_TORSO:
			USER_MESSAGE("Calibration Failed... :-|")
				break;
		}
	}
}
开发者ID:Gabrinthei,项目名称:kinect-vision,代码行数:37,代码来源:FaceDetectionWorking.cpp

示例3: updateUserData

void User::updateUserData(const nite::UserData& data)
{
	userdata = data;
	
	for (int i = 0; i < NITE_JOINT_COUNT; i++)
	{
		const nite::SkeletonJoint &o = data.getSkeleton().getJoint((nite::JointType)i);
		joints[i].updateJointData(o);
	}
	
	stringstream ss;
	ss << "[" << data.getId() << "]" << endl;
	
	ss << (data.isVisible() ? "Visible" : "Out of Scene") << endl;;
	
	switch (data.getSkeleton().getState())
	{
		case nite::SKELETON_NONE:
			ss << "Stopped tracking.";
			break;
		case nite::SKELETON_CALIBRATING:
			ss << "Calibrating...";
			break;
		case nite::SKELETON_TRACKED:
			ss << "Tracking!";
			break;
		case nite::SKELETON_CALIBRATION_ERROR_NOT_IN_POSE:
		case nite::SKELETON_CALIBRATION_ERROR_HANDS:
		case nite::SKELETON_CALIBRATION_ERROR_LEGS:
		case nite::SKELETON_CALIBRATION_ERROR_HEAD:
		case nite::SKELETON_CALIBRATION_ERROR_TORSO:
			ss << "Calibration Failed... :-|";
			break;
	}
	
	status_string = ss.str();
	
	const nite::Point3f& pos = userdata.getCenterOfMass();
	center_of_mass.set(pos.x, pos.y, -pos.z);
	
	Joint &torso = joints[nite::JOINT_TORSO];
	activity += (torso.getPosition().distance(center_of_bone) - activity) * 0.1;
	center_of_bone = torso.getPosition();
}
开发者ID:Lyptik,项目名称:ofxNI2,代码行数:44,代码来源:ofxNiTE2.cpp

示例4: updateUserState

/**
 * update and event out on state of user and skeleton tracking
 */
void updateUserState(const nite::UserData& user)
{
    if (user.isNew()) {
        eventIDToSend = NEW_USER;
        async.data = (void*) &eventIDToSend;
        uv_async_send(&async);
    } else if (!isUserVisible && user.isVisible() && user.getId() == 1) {
        isUserVisible = 1;
        eventIDToSend = USER_IS_VISIBLE;
        async.data = (void*) &eventIDToSend;
        uv_async_send(&async);
    } else if (isUserVisible && !user.isVisible() && user.getId() == 1) {
        isUserVisible = 0;
        eventIDToSend = USER_IS_OUT_OF_SCENE;
        async.data = (void*) &eventIDToSend;
        uv_async_send(&async);
    }

    g_visibleUsers[user.getId()] = user.isVisible();

    if(g_skeletonStates[user.getId()] != user.getSkeleton().getState())
    {
        switch(g_skeletonStates[user.getId()] = user.getSkeleton().getState())
        {
            case nite::SKELETON_NONE:
                if (isSkeletonTracking) {
                    isSkeletonTracking = false;
                    isSkeletonCalibrating = false;
                    eventIDToSend = SKELETON_STOPPED_TRACKING;
                    async.data = (void*) &eventIDToSend;
                    uv_async_send(&async);
                }
                break;
            case nite::SKELETON_CALIBRATING:
                if (!isSkeletonCalibrating) {
                    isSkeletonCalibrating = true;
                    eventIDToSend = SKELETON_CALIBRATING;
                    async.data = (void*) &eventIDToSend;
                    uv_async_send(&async);
                }
                break;
            case nite::SKELETON_TRACKED:
                if (!isSkeletonTracking) {
                    isSkeletonTracking = true;
                    isSkeletonCalibrating = false;
                    eventIDToSend = SKELETON_TRACKING;
                    async.data = (void*) &eventIDToSend;
                    uv_async_send(&async);
                }
                break;
            case nite::SKELETON_CALIBRATION_ERROR_NOT_IN_POSE:
            case nite::SKELETON_CALIBRATION_ERROR_HANDS:
            case nite::SKELETON_CALIBRATION_ERROR_LEGS:
            case nite::SKELETON_CALIBRATION_ERROR_HEAD:
            case nite::SKELETON_CALIBRATION_ERROR_TORSO:
                eventIDToSend = SKELETON_CALIBRATION_FAILED;
                async.data = (void*) &eventIDToSend;
                uv_async_send(&async);
                isSkeletonTracking = false;
                isSkeletonCalibrating = false;
                break;
        }
    }
}
开发者ID:bengfarrell,项目名称:nuimotion,代码行数:67,代码来源:Main.cpp


注:本文中的nite::UserData::isVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。