您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ update_position函数代码示例

51自学网 2021-06-03 09:15:42
  C++
这篇教程C++ update_position函数代码示例写得很实用,希望能帮到您。

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

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

示例1: update_position

Array<TV> SurfacePins::closest_points(Array<const TV> X) {  update_position(X,false);  Array<TV> closest(particles.size(),uninit);  for (int i=0;i<particles.size();i++)    closest[i] = X[particles[i]]-info[i].phi*info[i].normal;  return closest;}
开发者ID:mikest,项目名称:geode,代码行数:7,


示例2: run

static voidrun(LV2_Handle instance, uint32_t sample_count){	Metro*           self = (Metro*)instance;	const MetroURIs* uris = &self->uris;	// Work forwards in time frame by frame, handling events as we go	const LV2_Atom_Sequence* in     = self->ports.control;	uint32_t                 last_t = 0;	for (const LV2_Atom_Event* ev = lv2_atom_sequence_begin(&in->body);	     !lv2_atom_sequence_is_end(&in->body, in->atom.size, ev);	     ev = lv2_atom_sequence_next(ev)) {		// Play the click for the time slice from last_t until now		play(self, last_t, ev->time.frames);		// Check if this event is an Object		// (or deprecated Blank to tolerate old hosts)		if (ev->body.type == uris->atom_Object ||		    ev->body.type == uris->atom_Blank) {			const LV2_Atom_Object* obj = (const LV2_Atom_Object*)&ev->body;			if (obj->body.otype == uris->time_Position) {				// Received position information, update				update_position(self, obj);			}		}		// Update time for next iteration and move to next event		last_t = ev->time.frames;	}	// Play for remainder of cycle	play(self, last_t, sample_count);}
开发者ID:jordanhalase,项目名称:lv2,代码行数:34,


示例3: SafeMoveWindow

DLL_EXPORT voidSafeMoveWindow(unsigned int serial, HWND hwnd, int x, int y, int width, int height){	RECT rect;	if (IsZoomed(hwnd))		return;	WaitForSingleObject(g_mutex, INFINITE);	g_block_move_hwnd = hwnd;	g_block_move_serial = serial;	g_block_move.left = x;	g_block_move.top = y;	g_block_move.right = x + width;	g_block_move.bottom = y + height;	ReleaseMutex(g_mutex);	SetWindowPos(hwnd, NULL, x, y, width, height, SWP_NOACTIVATE | SWP_NOZORDER);	vchannel_write("ACK", "%u", serial);	if (!GetWindowRect(hwnd, &rect))		debug("GetWindowRect failed!/n");	else if ((rect.left != x) || (rect.top != y) || (rect.right != x + width)		 || (rect.bottom != y + height))		update_position(hwnd);	else if (! IsIconic(hwnd))		vchannel_write("POSITION", "0x%08lx,%d,%d,%d,%d,0x%08x", hwnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, 0);	WaitForSingleObject(g_mutex, INFINITE);	g_block_move_hwnd = NULL;	memset(&g_block_move, 0, sizeof(RECT));	ReleaseMutex(g_mutex);}
开发者ID:Oyatsumi,项目名称:ulteo4Kode4kids,代码行数:34,


示例4: handle_resize

static void handle_resize(struct view_handler * handler,                          uint32_t old_width, uint32_t old_height){    struct panel * panel = wl_container_of(handler, panel, view_handler);    update_position(panel);}
开发者ID:Kinokoio,项目名称:swc,代码行数:7,


示例5: main

/************************************************************Main Loop************************************************************/int main(void){	/* Confirm Power */	m_red(ON);	/* Initializations */	initialize_robockey();	pause();	play();		/* Confirm successful initialization(s) */	m_green(ON);	/* Run */	while (1){		update_position();		if (check(ADCSRA,ADIF)){adc_update();} // Check if ADC conversion has completed		bot_behavior_update();		if (check(TIFR3,OCF3A)){motor_update();}	// Check if timestep has completed		if (wifi_flag) {			wifi_flag = 0;			m_red(TOGGLE);			wireless_recieve();					}	}}
开发者ID:banisadr,项目名称:robockey,代码行数:30,


示例6: utf8iterator_next

void utf8iterator_next(Utf8Iterator* iter) {  // We update positions based on the *last* character read, so that the first  // character following a newline is at column 1 in the next line.  update_position(iter);  iter->_start += iter->_width;  read_char(iter);}
开发者ID:309746069,项目名称:samurai-native,代码行数:7,


示例7: update_position_idle

static gboolean update_position_idle(NotifyStack* stack){	update_position(stack);	stack->update_id = 0;	return FALSE;}
开发者ID:TheCoffeMaker,项目名称:Mate-Desktop-Environment,代码行数:7,


示例8: update_position

void	CPs2NewParticle::plat_update( void ){	if (m_params.m_LocalCoord)	{		update_position();	}}
开发者ID:basecq,项目名称:thug,代码行数:7,


示例9: update_position

int  SKY_BOX::DrawGradient(CVIEWptr &v){   //DebugBreak();   update_position(); //center at the eye position            Patch* p = get_patch();   assert(p);   Skybox_Texture* tex = get_tex<Skybox_Texture>(p);   assert(tex);   glPushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT );   glEnable(GL_DEPTH_TEST);   // set xform:   glMatrixMode(GL_MODELVIEW);   glPushMatrix();   glMultMatrixd(xform().transpose().matrix());    // draw the mesh normally:   int ret= tex->draw(v);             glMatrixMode(GL_MODELVIEW);   glPopMatrix();   glPopAttrib();   GL_VIEW_PRINT_GL_ERRORS("(regular) : ");   return ret;}
开发者ID:QuLogic,项目名称:jot-lib,代码行数:32,


示例10: delete_edl

void VWindow::change_source(EDL *edl){//printf("VWindow::change_source(EDL *edl) 1/n");//printf("VWindow::change_source %p/n", edl);// EDLs are identical	if(edl && mwindow->edl->vwindow_edl && 		edl->id == mwindow->edl->vwindow_edl->id) return;	delete_edl();	if(edl)	{		this->asset = 0;		mwindow->edl->vwindow_edl = edl;// in order not to later delete edl if it is shared		mwindow->edl->vwindow_edl_shared = 1;// Update GUI		gui->change_source(edl, edl->local_session->clip_title);		update_position(CHANGE_ALL, 1, 1);// Update master session		strcpy(mwindow->edl->session->vwindow_folder, CLIP_FOLDER);		mwindow->edl->session->vwindow_source = 			mwindow->edl->clips.number_of(edl);	}	else		gui->change_source(edl, _("Viewer"));}
开发者ID:beequ7et,项目名称:cinelerra-cv,代码行数:29,


示例11: move

/* * Move robot forward, update current position and perform adjustments if the cell has been visited before */void move(){    move_forward();    update_position();    int i = find_current_cell();    int k = find_prev_cell();    if (cells[i].visited == 0) {        check_walls();        determ_type(i);        checked_walls = 1;        drive_through = 0;    }    else {        checked_walls = 1;        check_wall_weights();        printf("Attempting adjustment.../n");        drive_through = 1;        perform_angle_adjustment(k, i);        perform_one_wall_adjustment(i);    }    update_visited();}
开发者ID:siberianbrother,项目名称:robotics-2016,代码行数:31,


示例12: SafeMoveWindow

EXTERN voidSafeMoveWindow(unsigned int serial, HWND hwnd, int x, int y, int width,               int height){    RECT rect;    if (!g_wm_seamless_focus)        return;    WaitForSingleObject(g_mutex, INFINITE);    g_shdata->block_move_hwnd = hwnd_to_long(hwnd);    g_shdata->block_move_serial = serial;    g_shdata->block_move.left = x;    g_shdata->block_move.top = y;    g_shdata->block_move.right = x + width;    g_shdata->block_move.bottom = y + height;    ReleaseMutex(g_mutex);    SetWindowPos(hwnd, NULL, x, y, width, height,                 SWP_NOACTIVATE | SWP_NOZORDER);    vchannel_write("ACK", "%u", serial);    if (!GetWindowRect(hwnd, &rect))        debug("GetWindowRect failed!");    else if ((rect.left != x) || (rect.top != y) || (rect.right != x + width)             || (rect.bottom != y + height))        update_position(hwnd);    WaitForSingleObject(g_mutex, INFINITE);    g_shdata->block_move_hwnd = 0;    memset(&g_shdata->block_move, 0, sizeof(RECT));    ReleaseMutex(g_mutex);}
开发者ID:pengliang,项目名称:rdesktop-seamless,代码行数:34,


示例13: ocl_one_step_move

void ocl_one_step_move(sotl_device_t *dev){  if (gravity_enabled)    gravity (dev);#ifdef _SPHERE_MODE_  if (eating_enabled)    eating_pacman (dev);  if (growing_enabled)    growing_ghost (dev);#endif  if (force_enabled)    // Classic n^2 compute force version    n2_lennard_jones (dev);  if(detect_collision)    atom_collision (dev);  if(borders_enabled)    border_collision (dev);  update_position (dev);#ifdef HAVE_LIBGL  if (dev->display)    update_vertices (dev);#endif}
开发者ID:Thundzz,项目名称:GPU,代码行数:30,


示例14: pthread_mutex_init

void SoundPlayer::init(float volume, float x, float y, float z) {	stop = true;	paused = true;	pthread_mutex_init(&player_mutex, NULL);	pthread_mutex_init(&control_mutex, NULL);	update_volume(volume);	update_position(x, y, z);}
开发者ID:andre-d,项目名称:violet,代码行数:8,


示例15: handle_event

 bool handle_event(mouse_position npos){   int dx = npos.x - 200;   int dy = npos.y - 200;   SetMousePosition(200,200);   r1 += dx;   r2 += dy;   update_position(0,0,dx,dy);   return true; }
开发者ID:rolfrm,项目名称:epiclib,代码行数:9,


示例16: move_on_curve

//struct sphere move_on_curve( struct sphere *ball ) {void move_on_curve( struct sphere *ball ) {	point3f temp;	temp = ball->pos;	// store previous position	ball->previous_pos = temp;	ball->interval =( current - ball->start_time )/		( CLOCKS_PER_SEC * ball->curve_time );	update_position( ball );}
开发者ID:Koobeanz,项目名称:Gra-Sim-Project,代码行数:10,


示例17: update_position

/* * advances the sphere along the curved path */void Sphere::move_on_curve(double current) {	point3f temp;	temp = pos;	// store previous position	previous_pos = temp;	interval =( current - start_time )/		( CLOCKS_PER_SEC * curve_time );	update_position();}
开发者ID:AyalaStadler,项目名称:tasp,代码行数:12,


示例18: send_servos

/*  update the Gazebo simulation by one time step */void Gazebo::update(const struct sitl_input &input){    send_servos(input);    recv_fdm(input);    update_position();    // update magnetic field    update_mag_field_bf();}
开发者ID:ArmaJo,项目名称:ardupilot,代码行数:12,


示例19: play_game

int play_game(){  draw_border();  update_position();  draw_snake();  usleep(get_speed());  return 1;}
开发者ID:abimaelmartell,项目名称:snake,代码行数:9,


示例20: MPI_Wtime

int pSim::Update(){#ifdef VERBOSE	update_log << "Update no contact" << endl;#endif#ifdef TIMING_CHECK	update_start_time = MPI_Wtime();#endif#ifdef PSIM_TEST	max_condition_number = -1.0;	max_sigma_ratio = -1.0;	max_condition_number_joint = 0;	max_sigma_ratio_joint = 0;	condition_numbers.resize(n_dof);	sigma_ratios.resize(n_dof);	condition_numbers.zero();	sigma_ratios.zero();	total_gamma_error = 0.0;#endif	/**** assembly ****/	// position-dependent variables	update_position();#if 1	if(do_connect)	{		//		// do collision computation if needed		//		update_collision();		// don't forget to recompute link velocities		CalcVelocity();		do_connect = false;	}#endif	// velocity-dependent variables	update_velocity();#ifdef TIMING_CHECK	cerr << "[" << rank << "] disassembly t = " << MPI_Wtime()-update_start_time << endl;#endif	/**** disassembly ****/	disassembly();	#ifdef PSIM_TEST	cerr << "--- max condition number = " << max_condition_number << " at " << max_condition_number_joint->name << endl;	cerr << "--- max sigma ratio = " << max_sigma_ratio << " at " << max_sigma_ratio_joint->name << endl;	cerr << "--- total_gamma_error = " << total_gamma_error << endl;//	cerr << "condition_numbers = " << tran(condition_numbers) << endl;//	cerr << "sigma_ratios = " << tran(sigma_ratios) << endl;#endif#ifdef USE_MPI	// scatter results	scatter_acc();#endif	return 0;}
开发者ID:YoheiKakiuchi,项目名称:openhrp3-1,代码行数:56,


示例21: set_offset

static void set_offset(struct wl_client * client, struct wl_resource * resource,                       uint32_t offset){    struct panel * panel = wl_resource_get_user_data(resource);    panel->offset = offset;    if (panel->docked)        update_position(panel);}
开发者ID:Kinokoio,项目名称:swc,代码行数:10,


示例22: write_data

int write_data(databuf_t* db, int pos) {    update_position(&track);    pos = race_write_short(db,pos,TRACK_MSG);    pos = race_write_short(db,pos,1);  // we only send one track (for now)    pos = race_write_track_data(db, pos,                             track.id, track.time_msec, track.lat_deg, track.lon_deg,                              track.alt_m, track.heading_deg, track.speed_m_sec);    return pos;}
开发者ID:NASARace,项目名称:race,代码行数:10,


示例23: send_servos

/*  update the last_letter simulation by one time step */void last_letter::update(const struct sitl_input &input){    send_servos(input);    recv_fdm(input);    sync_frame_time();    update_position();    // update magnetic field    update_mag_field_bf();}
开发者ID:IISAR,项目名称:ardupilot,代码行数:13,


示例24: collision_avoided

void collision_avoided(double direction, struct timeval time){	running = 0;	current.timer = time;	free(route.path);	compare_tile();	current.current_destination.angle = direction;	update_position(&current);	compare_tile();	recalc();}
开发者ID:guswangqi,项目名称:nav,代码行数:10,


示例25: get_edl

void VWindow::goto_start(){	if(get_edl())	{		get_edl()->local_session->set_selectionstart(0);		get_edl()->local_session->set_selectionend(0);		update_position(CHANGE_NONE, 			0, 			1);	}}
开发者ID:beequ7et,项目名称:cinelerra-cv,代码行数:11,


示例26: update_surfel_attributes

void reduction_entropy::update_surfel_attributes(shared_surfel target_surfel_ptr,                          shared_entropy_surfel_vector const invalidated_neighbours) const {    update_normal(target_surfel_ptr, invalidated_neighbours);    update_color(target_surfel_ptr, invalidated_neighbours);    // position needs to be updated before the radius is updated    update_position(target_surfel_ptr, invalidated_neighbours);    update_radius(target_surfel_ptr, invalidated_neighbours);}
开发者ID:scholli,项目名称:lamure,代码行数:11,


示例27: utf8iterator_next

void utf8iterator_next(Utf8Iterator* iter) {    iter->_start += iter->_width;    // We update positions based on the *last* character read, so that the first    // character following a newline is at column 1 in the next line.    update_position(iter);    if (iter->_start < iter->_end) {        read_char(iter);    } else {  // EOF        iter->_current = -1;    }}
开发者ID:RetVal,项目名称:RSCoreFoundation,代码行数:11,


示例28: move_on_curve

//struct sphere move_on_curve( struct sphere *ball ) {void move_on_curve( struct sphere *ball ) {	struct point2f temp;	temp = ball->pos;	// store previous position	ball->previous_pos = temp;	ball->interval =( current - ball->start_time )/		( CLOCKS_PER_SEC * ball->curve_time );	//printf("before update: %f %f || %f %f/n", ball->previous_pos.x, ball->previous_pos.y, ball->pos.x, ball->pos.y);	update_position( ball );	//printf("after update: %f %f || %f %f/n", ball->previous_pos.x, ball->previous_pos.y, ball->pos.x, ball->pos.y);}
开发者ID:Koobeanz,项目名称:Gra-Sim-Project,代码行数:12,


示例29: sqrt

void CombatGameInst::attempt_move_to_position(GameState* gs, float& newx,		float& newy) {	float dx = newx - rx, dy = newy - ry;	float dist = sqrt(dx * dx + dy * dy);	bool collided = gs->tile_radius_test(round(newx), round(newy), 20);	if (!collided) {		rx = newx, ry = newy;	} else {		float nx = round(rx + vx), ny = round(ry + vy);		bool collided = gs->tile_radius_test(nx, ny, radius);		if (collided) {			bool hitsx = gs->tile_radius_test(nx, y, radius);			bool hitsy = gs->tile_radius_test(x, ny, radius);			if (hitsy || hitsx || collided) {				if (hitsx) {					vx = 0;				}				if (hitsy) {					vy = 0;				}				if (!hitsy && !hitsx) {					vx = -vx;					vy = -vy;				}			}		}//		else {//			if (in_corridor_heurestic(gs,//					Pos(rx / TILE_SIZE, ry / TILE_SIZE))) {//				float proportion = proportion_in_same_dir(dx, dy, vx, vy);//				if (!gs->tile_radius_test(round(rx + vx * proportion),//						round(ry + vy * proportion), radius)) {//					vx *= proportion, vy *= proportion;//				} else {//					vx = 0.0f, vy = 0.0f;//				}//			}//		}//		normalize(nx, ny, effective_stats().movespeed);		vx = round(vx * ROUNDING_MULTIPLE) / ROUNDING_MULTIPLE;		vy = round(vy * ROUNDING_MULTIPLE) / ROUNDING_MULTIPLE;		rx += vx;		ry += vy;	}	newx = rx, newy = ry;	update_position();}
开发者ID:Zolomon,项目名称:lanarts,代码行数:53,



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


C++ update_process_times函数代码示例
C++ update_panels函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。