• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ERR_FAIL_NULL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ERR_FAIL_NULL函数的典型用法代码示例。如果您正苦于以下问题:C++ ERR_FAIL_NULL函数的具体用法?C++ ERR_FAIL_NULL怎么用?C++ ERR_FAIL_NULL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: switch

void ARVROrigin::_notification(int p_what) {
	switch (p_what) {
		case NOTIFICATION_ENTER_TREE: {
			set_process_internal(true);
		}; break;
		case NOTIFICATION_EXIT_TREE: {
			set_process_internal(false);
		}; break;
		case NOTIFICATION_INTERNAL_PROCESS: {
			// get our ARVRServer
			ARVRServer *arvr_server = ARVRServer::get_singleton();
			ERR_FAIL_NULL(arvr_server);

			// set our world origin to our node transform
			arvr_server->set_world_origin(get_global_transform());

			// check if we have a primary interface
			Ref<ARVRInterface> arvr_interface = arvr_server->get_primary_interface();
			if (arvr_interface.is_valid() && tracked_camera != NULL) {
				// get our positioning transform for our headset
				Transform t = arvr_interface->get_transform_for_eye(ARVRInterface::EYE_MONO, Transform());

				// now apply this to our camera
				tracked_camera->set_transform(t);
			};
		}; break;
		default:
			break;
	};
};
开发者ID:bigscorpions,项目名称:godot,代码行数:30,代码来源:arvr_nodes.cpp


示例2: ERR_FAIL_NULL

void EditorResourcePreview::queue_edited_resource_preview(const Ref<Resource> &p_res, Object *p_receiver, const StringName &p_receiver_func, const Variant &p_userdata) {

	ERR_FAIL_NULL(p_receiver);
	ERR_FAIL_COND(!p_res.is_valid());

	preview_mutex->lock();

	String path_id = "ID:" + itos(p_res->get_instance_id());

	if (cache.has(path_id) && cache[path_id].last_hash == p_res->hash_edited_version()) {

		cache[path_id].order = order++;
		p_receiver->call_deferred(p_receiver_func, path_id, cache[path_id].preview, p_userdata);
		preview_mutex->unlock();
		return;
	}

	cache.erase(path_id); //erase if exists, since it will be regen

	//print_line("send to thread "+p_path);
	QueueItem item;
	item.function = p_receiver_func;
	item.id = p_receiver->get_instance_id();
	item.resource = p_res;
	item.path = path_id;
	item.userdata = p_userdata;

	queue.push_back(item);
	preview_mutex->unlock();
	preview_sem->post();
}
开发者ID:rrrfffrrr,项目名称:godot,代码行数:31,代码来源:editor_resource_preview.cpp


示例3: ERR_FAIL_NULL

void Object::disconnect(const StringName& p_signal, Object *p_to_object, const StringName& p_to_method) {

	ERR_FAIL_NULL(p_to_object);
	Signal *s = signal_map.getptr(p_signal);
	if (!s) {
		ERR_EXPLAIN("Nonexistent signal: "+p_signal);
		ERR_FAIL_COND(!s);
	}
	if (s->lock>0) {
		ERR_EXPLAIN("Attempt to disconnect signal '"+p_signal+"' while emitting (locks: "+itos(s->lock)+")");
		ERR_FAIL_COND(s->lock>0);
	}

	Signal::Target target(p_to_object->get_instance_ID(),p_to_method);

	if (!s->slot_map.has(target)) {
		ERR_EXPLAIN("Disconnecting nonexistent signal '"+p_signal+"', slot: "+itos(target._id)+":"+target.method);
		ERR_FAIL();
	}

	p_to_object->connections.erase(s->slot_map[target].cE);
	s->slot_map.erase(target);

	if (s->slot_map.empty() && ObjectTypeDB::has_signal(get_type_name(),p_signal )) {
		//not user signal, delete
		signal_map.erase(p_signal);
	}
}
开发者ID:Brickcaster,项目名称:godot,代码行数:28,代码来源:object.cpp


示例4: ERR_FAIL_NULL

void Node::move_child(Node *p_child,int p_pos) {	
	
	ERR_FAIL_NULL(p_child);
	ERR_EXPLAIN("Invalid new child position: "+itos(p_pos));
	ERR_FAIL_INDEX( p_pos, data.children.size()+1 );
	ERR_EXPLAIN("child is not a child of this node.");
	ERR_FAIL_COND(p_child->data.parent!=this);
	ERR_FAIL_COND(data.blocked>0);
	
	data.children.remove( p_child->data.pos );
	data.children.insert( p_pos, p_child );

	if (data.tree) {
		data.tree->tree_changed();
	}

	data.blocked++;
	//new pos first
	for (int i=0;i<data.children.size();i++) {
		
		data.children[i]->data.pos=i;
	}
	// notification second
	move_child_notify(p_child);
	for (int i=0;i<data.children.size();i++) {
		data.children[i]->notification( NOTIFICATION_MOVED_IN_PARENT );

	}

	data.blocked--;

}
开发者ID:Martho42,项目名称:godot,代码行数:32,代码来源:node.cpp


示例5: ERR_FAIL_NULL

void Camera2D::set_custom_viewport(Node *p_viewport) {
	ERR_FAIL_NULL(p_viewport);
	if (is_inside_tree()) {
		remove_from_group(group_name);
		remove_from_group(canvas_group_name);
	}

	custom_viewport = Object::cast_to<Viewport>(p_viewport);

	if (custom_viewport) {
		custom_viewport_id = custom_viewport->get_instance_id();
	} else {
		custom_viewport_id = 0;
	}

	if (is_inside_tree()) {

		if (custom_viewport)
			viewport = custom_viewport;
		else
			viewport = get_viewport();

		RID vp = viewport->get_viewport_rid();
		group_name = "__cameras_" + itos(vp.get_id());
		canvas_group_name = "__cameras_c" + itos(canvas.get_id());
		add_to_group(group_name);
		add_to_group(canvas_group_name);
	}
}
开发者ID:jejung,项目名称:godot,代码行数:29,代码来源:camera_2d.cpp


示例6: ERR_FAIL_NULL

void ARVROrigin::set_world_scale(float p_world_scale) {
	// get our ARVRServer
	ARVRServer *arvr_server = ARVRServer::get_singleton();
	ERR_FAIL_NULL(arvr_server);

	arvr_server->set_world_scale(p_world_scale);
};
开发者ID:bigscorpions,项目名称:godot,代码行数:7,代码来源:arvr_nodes.cpp


示例7: ERR_FAIL_NULL

void RayCast::add_exception(const Object* p_object){

	ERR_FAIL_NULL(p_object);
	CollisionObject *co=((Object*)p_object)->cast_to<CollisionObject>();
	if (!co)
		return;
	add_exception_rid(co->get_rid());
}
开发者ID:AwsomeGameEngine,项目名称:godot,代码行数:8,代码来源:ray_cast.cpp


示例8: ERR_FAIL_NULL

void Skeleton::unbind_child_node_from_bone(int p_bone, Node *p_node) {

	ERR_FAIL_NULL(p_node);
	ERR_FAIL_INDEX(p_bone, bones.size());

	uint32_t id = p_node->get_instance_id();
	bones.write[p_bone].nodes_bound.erase(id);
}
开发者ID:dataxerik,项目名称:godot,代码行数:8,代码来源:skeleton.cpp


示例9: ERR_FAIL_NULL

void RayCast2D::remove_exception(const Object* p_object){

	ERR_FAIL_NULL(p_object);
	CollisionObject2D *co=((Object*)p_object)->cast_to<CollisionObject2D>();
	if (!co)
		return;
	remove_exception_rid(co->get_rid());
}
开发者ID:3miu,项目名称:godot,代码行数:8,代码来源:ray_cast_2d.cpp


示例10: ERR_FAIL_NULL

void Range::share(Range *p_range) {

	ERR_FAIL_NULL(p_range);

	p_range->_ref_shared(shared);
	p_range->_changed_notify();
	p_range->_value_changed_notify();
}
开发者ID:GalanCM,项目名称:godot,代码行数:8,代码来源:range.cpp


示例11: ERR_FAIL_NULL

void RayCast2D::add_exception(const Object *p_object) {

	ERR_FAIL_NULL(p_object);
	const CollisionObject2D *co = Object::cast_to<CollisionObject2D>(p_object);
	if (!co)
		return;
	add_exception_rid(co->get_rid());
}
开发者ID:KellyThomas,项目名称:godot,代码行数:8,代码来源:ray_cast_2d.cpp


示例12: get_parent

void BTCompositeNode::add_child_node(BTNode& child, Vector<BehaviorTree::Node*>& node_hierarchy) {
	BTNode* p_parent = get_parent() ? get_parent()->cast_to<BTNode>() : NULL;
	ERR_EXPLAIN("Parent node is not a BTNode.");
	ERR_FAIL_NULL(p_parent);
	if (p_parent) {
		node_hierarchy.push_back(get_behavior_node());
		p_parent->add_child_node(child, node_hierarchy);
	}
}
开发者ID:AntonioModer,项目名称:godot_behavior_tree,代码行数:9,代码来源:bt_composite_node.cpp


示例13: ERR_FAIL_NULL

void PopupPanel::set_child_rect(Control *p_child) {
	ERR_FAIL_NULL(p_child);

	Ref<StyleBox> p = get_stylebox("panel");
	p_child->set_area_as_parent_rect();
	for (int i = 0; i < 4; i++) {
		p_child->set_margin(Margin(i), p->get_margin(Margin(i)));
	}
}
开发者ID:Max-Might,项目名称:godot,代码行数:9,代码来源:popup.cpp


示例14: ERR_FAIL_NULL

void SoftBody::remove_collision_exception_with(Node *p_node) {
	ERR_FAIL_NULL(p_node);
	CollisionObject *collision_object = Object::cast_to<CollisionObject>(p_node);
	if (!collision_object) {
		ERR_EXPLAIN("Collision exception only works between two CollisionObject");
	}
	ERR_FAIL_COND(!collision_object);
	PhysicsServer::get_singleton()->soft_body_remove_collision_exception(physics_rid, collision_object->get_rid());
}
开发者ID:KellyThomas,项目名称:godot,代码行数:9,代码来源:soft_body.cpp


示例15: godot_arvr_set_controller_axis

void GDAPI godot_arvr_set_controller_axis(godot_int p_controller_id, godot_int p_axis, godot_real p_value, godot_bool p_can_be_negative) {
	ARVRServer *arvr_server = ARVRServer::get_singleton();
	ERR_FAIL_NULL(arvr_server);

	InputDefault *input = (InputDefault *)Input::get_singleton();
	ERR_FAIL_NULL(input);

	ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, p_controller_id);
	if (tracker != NULL) {
		int joyid = tracker->get_joy_id();
		if (joyid != -1) {
			InputDefault::JoyAxis jx;
			jx.min = p_can_be_negative ? -1 : 0;
			jx.value = p_value;
			input->joy_axis(joyid, p_axis, jx);
		}
	}
}
开发者ID:Ranakhamis,项目名称:godot,代码行数:18,代码来源:arvr_interface_gdnative.cpp


示例16: ERR_FAIL_NULL

void PhysicsBody::remove_collision_exception_with(Node* p_node) {

	ERR_FAIL_NULL(p_node);
	PhysicsBody *physics_body = p_node->cast_to<PhysicsBody>();
	if (!physics_body) {
		ERR_EXPLAIN("Collision exception only works between two objects of PhysicsBody type");
	}
	ERR_FAIL_COND(!physics_body);
	PhysicsServer::get_singleton()->body_remove_collision_exception(get_rid(),physics_body->get_rid());
}
开发者ID:hiltonm,项目名称:godot,代码行数:10,代码来源:physics_body.cpp


示例17: ERR_FAIL_NULL

void VisualServerRaster::request_frame_drawn_callback(Object *p_where, const StringName &p_method, const Variant &p_userdata) {

	ERR_FAIL_NULL(p_where);
	FrameDrawnCallbacks fdc;
	fdc.object = p_where->get_instance_id();
	fdc.method = p_method;
	fdc.param = p_userdata;

	frame_drawn_callbacks.push_back(fdc);
}
开发者ID:Paulloz,项目名称:godot,代码行数:10,代码来源:visual_server_raster.cpp


示例18: ERR_FAIL_NULL

void Array::sort_custom(Object *p_obj,const StringName& p_function){

	ERR_FAIL_NULL(p_obj);

	SortArray<Variant,_ArrayVariantSortCustom> avs;
	avs.compare.obj=p_obj;
	avs.compare.func=p_function;
	avs.sort(_p->array.ptr(),_p->array.size());

}
开发者ID:AMG194,项目名称:godot,代码行数:10,代码来源:array.cpp


示例19: ERR_FAIL_NULL

void Node::set_editable_instance(Node* p_node,bool p_editable) {

	ERR_FAIL_NULL(p_node);
	ERR_FAIL_COND(!is_a_parent_of(p_node));
	NodePath p = get_path_to(p_node);
	if (!p_editable)
		data.editable_instances.erase(p);
	else
		data.editable_instances[p]=true;

}
开发者ID:GovanifY,项目名称:godot,代码行数:11,代码来源:node.cpp


示例20: ERR_FAIL_NULL

void ARVRInterface::set_is_primary(bool p_is_primary) {
	ARVRServer *arvr_server = ARVRServer::get_singleton();
	ERR_FAIL_NULL(arvr_server);

	if (p_is_primary) {
		ERR_FAIL_COND(!is_initialized());

		arvr_server->set_primary_interface(this);
	} else {
		arvr_server->clear_primary_interface_if(this);
	};
};
开发者ID:UgisBrekis,项目名称:godot,代码行数:12,代码来源:arvr_interface.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ERR_FATAL函数代码示例发布时间:2022-05-30
下一篇:
C++ ERR_FAIL_INDEX_V函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap