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

C++ GetVectorForKey函数代码示例

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

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



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

示例1: CalcTerrainSize

/*
================
CalcTerrainSize
================
*/
void CalcTerrainSize( vec3_t mins, vec3_t maxs, vec3_t size ) {
	bspbrush_t	*brush;
	int			i;
	const char  *key;

	// calculate the size of the terrain
	ClearBounds( mins, maxs );
	for( brush = mapent->brushes; brush != NULL; brush = brush->next ) {
		AddPointToBounds( brush->mins, mins, maxs );
		AddPointToBounds( brush->maxs, mins, maxs );
	}

	key = ValueForKey( mapent, "min" ); 
	if ( key[ 0 ] ) {
		GetVectorForKey( mapent, "min", mins );
	}

	key = ValueForKey( mapent, "max" ); 
	if ( key[ 0 ] ) {
		GetVectorForKey( mapent, "max", maxs );
	}

	for( i = 0; i < 3; i++ ) {
		mins[ i ] =  floor( mins[ i ] + 0.1 );
		maxs[ i ] =  floor( maxs[ i ] + 0.1 );
	}

	VectorSubtract( maxs, mins, size );

	if ( ( size[ 0 ] <= 0 ) || ( size[ 1 ] <= 0 ) ) {
		Error ("CalcTerrainSize: Invalid terrain size: %fx%f", size[ 0 ], size[ 1 ] );
	}
}
开发者ID:FS-NulL,项目名称:Q3Radiant,代码行数:38,代码来源:terrain.c


示例2: InitMacroTexture

void InitMacroTexture( const char *pBSPFilename )
{
	// Get the world bounds (same ones used by minimaps and level designers know how to use).
	int i = 0;
	for (i = 0; i < num_entities; ++i)
	{
		char* pEntity = ValueForKey(&entities[i], "classname");
		if( !strcmp(pEntity, "worldspawn") )
		{
			GetVectorForKey( &entities[i], "world_mins", g_MacroWorldMins );
			GetVectorForKey( &entities[i], "world_maxs", g_MacroWorldMaxs );
			break;
		}
	}

	if ( i == num_entities )
	{
		Warning( "MaskOnMacroTexture: can't find worldspawn" );
		return;
	}


	// Load the macro texture that is mapped onto everything.
	char mapName[512], vtfFilename[512];
	Q_FileBase( pBSPFilename, mapName, sizeof( mapName ) );
	Q_snprintf( vtfFilename, sizeof( vtfFilename ), "materials/macro/%s/base.vtf", mapName );
	g_pGlobalMacroTextureData = LoadMacroTextureFile( vtfFilename );

	
	// Now load the macro texture for each face.
	g_FaceMacroTextures.SetSize( numfaces );
	for ( int iFace=0; iFace < numfaces; iFace++ )
	{
		g_FaceMacroTextures[iFace] = NULL;

		if ( iFace < g_FaceMacroTextureInfos.Count() )
		{
			unsigned short stringID = g_FaceMacroTextureInfos[iFace].m_MacroTextureNameID;
			if ( stringID != 0xFFFF )
			{
				const char *pMacroTextureName = &g_TexDataStringData[ g_TexDataStringTable[stringID] ];
				Q_snprintf( vtfFilename, sizeof( vtfFilename ), "%smaterials/%s.vtf", gamedir, pMacroTextureName );
				
				g_FaceMacroTextures[iFace] = FindMacroTexture( vtfFilename );
				if ( !g_FaceMacroTextures[iFace] )
				{
					g_FaceMacroTextures[iFace] = LoadMacroTextureFile( vtfFilename );
					if ( g_FaceMacroTextures[iFace] )
					{
						g_MacroTextureLookup.Insert( vtfFilename, g_FaceMacroTextures[iFace] );
					}
				}
			}
		}
	}
}
开发者ID:chrizonix,项目名称:RCBot2,代码行数:56,代码来源:macro_texture.cpp


示例3: LoadEntities

/*
==================
LoadEntities
==================
*/
void LoadEntities (void)
{
	char 		*s, *s2;
	entity_t	*e;
	lightentity_t	*le;
	int			i, j;

	ParseEntities ();
	
// go through all the entities
	for (i=1 ; i<num_entities ; i++)
	{
		e = &entities[i];

		s = ValueForKey (e, "classname");
		if (strncmp (s, "light", 5))
			continue;

		le = &lightentities[numlightentities];
		numlightentities++;

		strcpy (le->classname, s);
		le->light = FloatForKey (e, "light");
		if (!le->light)
			le->light = DEFAULTLIGHTLEVEL;
		le->style = FloatForKey (e, "style");
		le->angle = FloatForKey (e, "angle");
		GetVectorForKey (e, "origin", le->origin);

		s = ValueForKey (e, "target");
		if (!s[0])
			continue;

		// find matching targetname
		for (j=1 ; j<num_entities ; j++)
		{
			s2 = ValueForKey (&entities[j], "targetname");
			if (!strcmp (s, s2))
			{
				le->targetent = true;
				GetVectorForKey (&entities[j], "origin", le->targetorigin);
				break;
			}
		}
		if (j == num_entities)
			printf ("WARNING: entity %i has unmatched target %s\n", i, s);
	}

	qprintf ("%d lightentities\n", numlightentities);

}
开发者ID:6779660,项目名称:halflife,代码行数:56,代码来源:light.c


示例4: Map_StartPosition

//
// move the view to a start position
//
void Map_StartPosition(){
	entity_t *ent = AngledEntity();

	g_pParentWnd->GetCamWnd()->Camera()->angles[PITCH] = 0;
	if ( ent ) {
		GetVectorForKey( ent, "origin", g_pParentWnd->GetCamWnd()->Camera()->origin );
		GetVectorForKey( ent, "origin", g_pParentWnd->GetXYWnd()->GetOrigin() );
		g_pParentWnd->GetCamWnd()->Camera()->angles[YAW] = FloatForKey( ent, "angle" );
	}
	else
	{
		g_pParentWnd->GetCamWnd()->Camera()->angles[YAW] = 0;
		VectorCopy( vec3_origin, g_pParentWnd->GetCamWnd()->Camera()->origin );
		VectorCopy( vec3_origin, g_pParentWnd->GetXYWnd()->GetOrigin() );
	}
}
开发者ID:haapanen,项目名称:GtkRadiant,代码行数:19,代码来源:map.cpp


示例5: ParseEntity

/*
================
ParseEntity
================
*/
qboolean	ParseEntity (void)
{
	if (!GetToken (true))
		return false;

	if (strcmp (token, "{") )
		Error ("ParseEntity: { not found");

	if (num_entities == MAX_MAP_ENTITIES)
		Error ("num_entities == MAX_MAP_ENTITIES");

	mapent = &entities[num_entities];
	num_entities++;

	do
	{
		fflush(stdout);
		if (!GetToken (true))
			Error ("ParseEntity: EOF without closing brace");
		if (!strcmp (token, "}") )
			break;
		if (!strcmp (token, "{") )
			ParseBrush ();
		else
			ParseEpair ();
	}
	while (1);

	GetVectorForKey (mapent, "origin", mapent->origin);
	return true;
}
开发者ID:AidHamza,项目名称:eviltoys,代码行数:36,代码来源:map.c


示例6: ParseEpair

static void
ParseEpair(void)
{
    epair_t *e;

    e = AllocMem(OTHER, sizeof(epair_t), true);
    e->next = map.rgEntities[map.iEntities].epairs;
    map.rgEntities[map.iEntities].epairs = e;

    if (strlen(token) >= MAX_KEY - 1)
	Message(msgError, errEpairTooLong, linenum);
    e->key = copystring(token);
    ParseToken(PARSE_SAMELINE);
    if (strlen(token) >= MAX_VALUE - 1)
	Message(msgError, errEpairTooLong, linenum);
    e->value = copystring(token);

    if (!strcasecmp(e->key, "origin"))
	GetVectorForKey(map.iEntities, e->key,
			map.rgEntities[map.iEntities].origin);
    else if (!strcasecmp(e->key, "classname")) {
	if (!strcasecmp(e->value, "info_player_start")) {
	    if (rgfStartSpots & info_player_start)
		Message(msgWarning, warnMultipleStarts);
	    rgfStartSpots |= info_player_start;
	} else if (!strcasecmp(e->value, "info_player_deathmatch"))
	    rgfStartSpots |= info_player_deathmatch;
	else if (!strcasecmp(e->value, "info_player_coop"))
	    rgfStartSpots |= info_player_coop;
    }
}
开发者ID:AidHamza,项目名称:eviltoys,代码行数:31,代码来源:map.c


示例7: ParseEpair

static void
ParseEpair(parser_t *parser, mapentity_t *ent)
{
    epair_t *epair;

    epair = AllocMem(OTHER, sizeof(epair_t), true);
    epair->next = ent->epairs;
    ent->epairs = epair;

    if (strlen(parser->token) >= MAX_KEY - 1)
	Error(errEpairTooLong, parser->linenum);
    epair->key = copystring(parser->token);
    ParseToken(parser, PARSE_SAMELINE);
    if (strlen(parser->token) >= MAX_VALUE - 1)
	Error(errEpairTooLong, parser->linenum);
    epair->value = copystring(parser->token);

    if (!strcasecmp(epair->key, "origin")) {
	GetVectorForKey(ent, epair->key, ent->origin);
    } else if (!strcasecmp(epair->key, "classname")) {
	if (!strcasecmp(epair->value, "info_player_start")) {
	    if (rgfStartSpots & info_player_start)
		Message(msgWarning, warnMultipleStarts);
	    rgfStartSpots |= info_player_start;
	} else if (!strcasecmp(epair->value, "info_player_deathmatch")) {
	    rgfStartSpots |= info_player_deathmatch;
	} else if (!strcasecmp(epair->value, "info_player_coop")) {
	    rgfStartSpots |= info_player_coop;
	}
    }
}
开发者ID:JoshEngebretson,项目名称:FSRadQuakeStuff,代码行数:31,代码来源:map.c


示例8: FixRotateOrigin

/*
=================
FixRotateOrigin
=================
*/
void FixRotateOrigin(entity_t *Ent, vec3_t offset)
{
	int		FoundEnt = -1, BadTarget = -1;
	char		*Search, Origin[100], Str[100];
	static entity_t *PrevEnt = NULL; // Prevent multiple warnings for same entity

	Search = ValueForKey(Ent, "target");

	if (strlen(Search) != 0)
	{
		FoundEnt = FindTargetEntity(Search, &BadTarget);

		if (FoundEnt != -1)
			GetVectorForKey(&entities[FoundEnt], "origin", offset);
	}

	if (Ent != PrevEnt)
	{
		if (FoundEnt == -1)
		{
			Str[0] = '\0';

			if (BadTarget != -1)
				sprintf(Str, " (line %d)", entities[BadTarget].Line);

			Message (MSGWARN, "Bad target%s for rotation entity on line %d", Str, Ent->Line);
		}

		PrevEnt = Ent;
	}

	sprintf(Origin, "%d %d %d", (int)offset[0], (int)offset[1], (int)offset[2]);
	SetKeyValue(Ent, "origin", Origin);
}
开发者ID:kellyrm,项目名称:Q1,代码行数:39,代码来源:brush.c


示例9: BuildPatches

/*
 * @brief Create surface fragments for light-emitting surfaces so that light sources
 * may be computed along them.
 */
void BuildPatches(void) {
	int32_t i, j, k;
	winding_t *w;
	vec3_t origin;

	for (i = 0; i < d_bsp.num_models; i++) {

		const d_bsp_model_t *mod = &d_bsp.models[i];
		const entity_t *ent = EntityForModel(i);

		// bmodels with origin brushes need to be offset into their
		// in-use position
		GetVectorForKey(ent, "origin", origin);

		for (j = 0; j < mod->num_faces; j++) {

			const int32_t facenum = mod->first_face + j;
			d_bsp_face_t *f = &d_bsp.faces[facenum];

			VectorCopy(origin, face_offset[facenum]);

			if (!HasLight(f)) // no light
				continue;

			w = WindingForFace(f);

			for (k = 0; k < w->num_points; k++) {
				VectorAdd(w->points[k], origin, w->points[k]);
			}

			BuildPatch(facenum, w);
		}
	}
}
开发者ID:jayschwa,项目名称:quake2world,代码行数:38,代码来源:patches.c


示例10: Entity_WriteSelected

//
// =======================================================================================================================
//    Entity_WriteSelected to a CMemFile
// =======================================================================================================================
//
void Entity_WriteSelected(entity_t *e, CMemFile *pMemFile)
{
    brush_t *b;
    idVec3	origin;
    char	text[128];
    int		count;

    for (b = e->brushes.onext; b != &e->brushes; b = b->onext)
    {
        if (IsBrushSelected(b))
        {
            break;	// got one
        }
    }

    if (b == &e->brushes)
    {
        return;		// nothing selected
    }

    // if fixedsize, calculate a new origin based on the current brush position
    if (e->eclass->fixedsize || EntityHasModel(e))
    {
        if (!GetVectorForKey(e, "origin", origin))
        {
            VectorSubtract(e->brushes.onext->mins, e->eclass->mins, origin);
            sprintf(text, "%i %i %i", (int)origin[0], (int)origin[1], (int)origin[2]);
            SetKeyValue(e, "origin", text);
        }
    }

    MemFile_fprintf(pMemFile, "{\n");

    count = e->epairs.GetNumKeyVals();
    for (int j = 0; j < count; j++)
    {
        MemFile_fprintf(pMemFile, "\"%s\" \"%s\"\n", e->epairs.GetKeyVal(j)->GetKey().c_str(), e->epairs.GetKeyVal(j)->GetValue().c_str());
    }

    if (!EntityHasModel(e))
    {
        count = 0;
        for (b = e->brushes.onext; b != &e->brushes; b = b->onext)
        {
            if (e->eclass->fixedsize && !b->entityModel)
            {
                continue;
            }
            if (IsBrushSelected(b))
            {
                MemFile_fprintf(pMemFile, "// brush %i\n", count);
                count++;
                Brush_Write( b, pMemFile, e->origin, ( g_PrefsDlg.m_bNewMapFormat != FALSE ) );
            }
        }
    }

    MemFile_fprintf(pMemFile, "}\n");
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:64,代码来源:EditorEntity.cpp


示例11: Entity_New

entity_t *EntityFromMapEntity(idMapEntity *mapent, CWaitDlg *dlg)
{
	entity_t *ent = NULL;

	if (mapent) {
		ent = Entity_New();
		ent->brushes.onext = ent->brushes.oprev = &ent->brushes;
		ent->origin.Zero();
		ent->epairs = mapent->epairs;
		GetVectorForKey(ent, "origin", ent->origin);
		int count = mapent->GetNumPrimitives();
		long lastUpdate = 0;
		idStr status;

		for (int i = 0; i < count; i++) {
			idMapPrimitive *prim = mapent->GetPrimitive(i);

			if (prim) {
				// update 20 times a second
				if ((GetTickCount() - lastUpdate) > 50) {
					lastUpdate = GetTickCount();

					if (prim->GetType() == idMapPrimitive::TYPE_BRUSH) {
						sprintf(status, "Reading primitive %i (brush)", i);
					} else if (prim->GetType() == idMapPrimitive::TYPE_PATCH) {
						sprintf(status, "Reading primitive %i (patch)", i);
					}

					dlg->SetText(status, true);
				}

				if (dlg->CancelPressed()) {
					return ent;
				}

				brush_t *b = NULL;

				if (prim->GetType() == idMapPrimitive::TYPE_BRUSH) {
					idMapBrush *mapbrush = reinterpret_cast<idMapBrush *>(prim);
					b = BrushFromMapBrush(mapbrush, ent->origin);
				} else if (prim->GetType() == idMapPrimitive::TYPE_PATCH) {
					idMapPatch *mappatch = reinterpret_cast<idMapPatch *>(prim);
					b = BrushFromMapPatch(mappatch, ent->origin);
				}

				if (b) {
					b->owner = ent;
					// add to the end of the entity chain
					b->onext = &ent->brushes;
					b->oprev = ent->brushes.oprev;
					ent->brushes.oprev->onext = b;
					ent->brushes.oprev = b;
				}
			}
		}
	}

	return ent;
}
开发者ID:AreaScout,项目名称:dante-doom3-odroid,代码行数:59,代码来源:EditorMap.cpp


示例12: AAS_PositionFuncRotatingBrush

//===========================================================================
// this function sets the func_rotating_door in it's final position
//
// Parameter:				-
// Returns:					-
// Changes Globals:		-
//===========================================================================
void AAS_PositionFuncRotatingBrush(entity_t *mapent, mapbrush_t *brush)
{
	int    spawnflags, i;
	float  distance;
	vec3_t movedir, angles, pos1, pos2;
	side_t *s;

	spawnflags = FloatForKey(mapent, "spawnflags");
	VectorClear(movedir);
	if (spawnflags & DOOR_X_AXIS)
	{
		movedir[2] = 1.0;       //roll
	}
	else if (spawnflags & DOOR_Y_AXIS)
	{
		movedir[0] = 1.0;       //pitch
	}
	else     // Z_AXIS
	{
		movedir[1] = 1.0;       //yaw

	}
	// check for reverse rotation
	if (spawnflags & DOOR_REVERSE)
	{
		VectorInverse(movedir);
	}

	distance = FloatForKey(mapent, "distance");
	if (!distance)
	{
		distance = 90;
	}

	GetVectorForKey(mapent, "angles", angles);
	VectorCopy(angles, pos1);
	VectorMA(angles, -distance, movedir, pos2);
	// if it starts open, switch the positions
	if (spawnflags & DOOR_START_OPEN)
	{
		VectorCopy(pos2, angles);
		VectorCopy(pos1, pos2);
		VectorCopy(angles, pos1);
		VectorInverse(movedir);
	} //end if
	  //
	for (i = 0; i < brush->numsides; i++)
	{
		s           = &brush->original_sides[i];
		s->planenum = AAS_TransformPlane(s->planenum, mapent->origin, pos2);
	} //end for
	  //
	FreeBrushWindings(brush);
	AAS_MakeBrushWindings(brush);
	AddBrushBevels(brush);
	FreeBrushWindings(brush);
} //end of the function AAS_PositionFuncRotatingBrush
开发者ID:morsik,项目名称:war-territory,代码行数:64,代码来源:aas_map.c


示例13: Q3_ParseBSPEntity

//===========================================================================
//===========================================================================
qboolean Q3_ParseBSPEntity(int entnum)
{
	entity_t *mapent;
	char *model;
	int startbrush, startsides;

	startbrush = nummapbrushes;
	startsides = nummapbrushsides;

	mapent = &entities[entnum]; //num_entities];
	mapent->firstbrush = nummapbrushes;
	mapent->numbrushes = 0;
	mapent->modelnum = -1;  //-1 = no BSP model

	model = ValueForKey(mapent, "model");

	if(model && strlen(model))
	{
		if(*model == '*')
		{
			//get the model number of this entity (skip the leading *)
			mapent->modelnum = atoi(&model[1]);
		} //end if
	} //end if

	GetVectorForKey(mapent, "origin", mapent->origin);

	//if this is the world entity it has model number zero
	//the world entity has no model key
	if(!strcmp("worldspawn", ValueForKey(mapent, "classname")))
	{
		mapent->modelnum = 0;
	} //end if

	//if the map entity has a BSP model (a modelnum of -1 is used for
	//entities that aren't using a BSP model)
	if(mapent->modelnum >= 0)
	{
		//parse the bsp brushes
		Q3_ParseBSPBrushes(mapent);
	} //end if

	//
	//the origin of the entity is already taken into account
	//
	//func_group entities can't be in the bsp file
	//
	//check out the func_areaportal entities
	if(!strcmp("func_areaportal", ValueForKey(mapent, "classname")))
	{
		c_areaportals++;
		mapent->areaportalnum = c_areaportals;
		return true;
	} //end if

	return true;
} //end of the function Q3_ParseBSPEntity
开发者ID:Diskutant,项目名称:RTCW-SP,代码行数:59,代码来源:map_q3.c


示例14: FloodEntities

/*
 * @brief Marks all nodes that can be reached by entites
 */
_Bool FloodEntities(tree_t *tree) {
    int32_t i;
    vec3_t origin;
    const char *cl;
    _Bool inside;
    node_t *head_node;

    head_node = tree->head_node;
    Com_Debug("--- FloodEntities ---\n");
    inside = false;
    tree->outside_node.occupied = 0;
    cl = "";

    for (i = 1; i < num_entities; i++) {
        GetVectorForKey(&entities[i], "origin", origin);
        if (VectorCompare(origin, vec3_origin))
            continue;

        cl = ValueForKey(&entities[i], "classname");
        origin[2] += 1; // so objects on floor are ok

        // nudge playerstart around if needed so clipping hulls always
        // have a valid point
        if (!g_strcmp0(cl, "info_player_start")) {
            int32_t x, y;

            for (x = -16; x <= 16; x += 16) {
                for (y = -16; y <= 16; y += 16) {
                    origin[0] += x;
                    origin[1] += y;
                    if (PlaceOccupant(head_node, origin, &entities[i])) {
                        inside = true;
                        goto gotit;
                    }
                    origin[0] -= x;
                    origin[1] -= y;
                }
            }
gotit:
            ;
        } else {
            if (PlaceOccupant(head_node, origin, &entities[i]))
                inside = true;
        }
    }

    if (!inside) {
        Com_Debug("no entities in open -- no filling\n");
    } else if (tree->outside_node.occupied) {
        Com_Debug("entity %s reached from outside -- no filling\n", cl);
    }

    return inside && !tree->outside_node.occupied;
}
开发者ID:jayschwa,项目名称:quake2world,代码行数:57,代码来源:portals.c


示例15: Error

/*
 =======================================================================================================================
    Entity_Parse If onlypairs is set, the classname info will not be looked up, and the entity will not be added to the
    global list. Used for parsing the project.
 =======================================================================================================================
 */
entity_t *Entity_Parse(bool onlypairs, brush_t *pList) {
	entity_t	*ent;

	if (!GetToken(true)) {
		return NULL;
	}

	if (strcmp(token, "{")) {
		Error("ParseEntity: { not found");
	}

	ent = Entity_New();
	ent->brushes.onext = ent->brushes.oprev = &ent->brushes;
	ent->origin.Zero();

	int n = 0;
	do {
		if (!GetToken(true)) {
			Warning("ParseEntity: EOF without closing brace");
			return NULL;
		}

		if (!strcmp(token, "}")) {
			break;
		}

		if (!strcmp(token, "{")) {
			GetVectorForKey(ent, "origin", ent->origin);
			brush_t *b = Brush_Parse(ent->origin);
			if (b != NULL) {
				b->owner = ent;

				// add to the end of the entity chain
				b->onext = &ent->brushes;
				b->oprev = ent->brushes.oprev;
				ent->brushes.oprev->onext = b;
				ent->brushes.oprev = b;
			}
			else {
				break;
			}
		}
		else {
			ParseEpair(&ent->epairs);
		}
	} while (1);

	if (onlypairs) {
		return ent;
	}

	return Entity_PostParse(ent, pList);
}
开发者ID:ProfessorKaos64,项目名称:tdm,代码行数:59,代码来源:EditorEntity.cpp


示例16: ParseEntity

/*
================
ParseEntity
================
*/
qboolean	ParseEntity (void)
{
	if (!GetToken (true))
		return false;

	if (strcmp (token, "{") )
		Error ("ParseEntity: { not found");

	if (num_entities == MAX_MAP_ENTITIES)
		Error ("num_entities == MAX_MAP_ENTITIES");

	mapent = &entities[num_entities];
	num_entities++;

	do
	{
		fflush(stdout);
		if (!GetToken (true))
			Error ("ParseEntity: EOF without closing brace");
		if (!strcmp (token, "}") )
			break;
		if (!strcmp (token, "{") )
			ParseBrush ();
		else
			ParseEpair ();
	} while (1);

	// all fields have been parsed
	if (!strncmp (mapent->classname, "light", 5))
	{
		if (!mapent->light)
		{
			mapent->color[0] = mapent->color[1] = mapent->color[2] = 1;
			mapent->light = DEFAULTLIGHTLEVEL;
		}
		// LordHavoc: added falloff and color
		if (!mapent->falloff)
			mapent->falloff = DEFAULTFALLOFF * DEFAULTFALLOFF;
	}

	if (!strcmp (mapent->classname, "light"))
		if (mapent->targetname[0] && !mapent->style)
		{
			char	s[16];
			mapent->style = LightStyleForTargetname (mapent->targetname, true);
			sprintf (s,"%i", mapent->style);
			SetKeyValue (mapent, "style", s);
		}

	GetVectorForKey (mapent, "origin", mapent->origin);
	return true;
}
开发者ID:atphalix,项目名称:eviltoys,代码行数:57,代码来源:map.c


示例17: SetKeyVec3

/*
 =======================================================================================================================
 =======================================================================================================================
 */
void SetKeyVec3(entity_t *ent, const char *key, idVec3 v) {
	if (ent == NULL) {
		return;
	}

	if (!key || !key[0]) {
		return;
	}

	idStr str;
	sprintf(str, "%g %g %g", v.x, v.y, v.z);
	ent->epairs.Set(key, str);
	GetVectorForKey(ent, "origin", ent->origin);
}
开发者ID:ProfessorKaos64,项目名称:tdm,代码行数:18,代码来源:EditorEntity.cpp


示例18: brushes

/*
=================
SetEntityBounds

finds the bounds of an entity's brushes (necessary for terrain-style generic metashaders)
=================
*/
void SetEntityBounds( entity_t *e )
{
	int		i;
	brush_t		*b;
	parseMesh_t	*p;
	vec3_t		mins, maxs;
	const char	*value;

	ClearBounds( mins, maxs );
	for( b = e->brushes; b; b = b->next )
	{
		AddPointToBounds( b->mins, mins, maxs );
		AddPointToBounds( b->maxs, mins, maxs );
	}
	for( p = e->patches; p; p = p->next )
	{
		for( i = 0; i < (p->mesh.width * p->mesh.height); i++ )
			AddPointToBounds( p->mesh.verts[i].xyz, mins, maxs );
	}
	
	value = ValueForKey( e, "min" ); 
	if( value[0] != '\0' ) GetVectorForKey( e, "min", mins );
	value = ValueForKey( e, "max" ); 
	if( value[0] != '\0' ) GetVectorForKey( e, "max", maxs );
	
	for( b = e->brushes; b; b = b->next )
	{
		VectorCopy( mins, b->eMins );
		VectorCopy( maxs, b->eMaxs );
	}
	for( p = e->patches; p; p = p->next )
	{
		VectorCopy( mins, p->eMins );
		VectorCopy( maxs, p->eMaxs );
	}
}
开发者ID:a1batross,项目名称:Xash3D_ancient,代码行数:43,代码来源:map.c


示例19: SetKeyMat3

/*
 =======================================================================================================================
 =======================================================================================================================
 */
void SetKeyMat3(entity_t *ent, const char *key, idMat3 m) {
	if (ent == NULL) {
		return;
	}

	if (!key || !key[0]) {
		return;
	}

	idStr str;
	
	sprintf(str, "%g %g %g %g %g %g %g %g %g",m[0][0],m[0][1],m[0][2],m[1][0],m[1][1],m[1][2],m[2][0],m[2][1],m[2][2]);
	
	ent->epairs.Set(key, str);
	GetVectorForKey(ent, "origin", ent->origin);
}
开发者ID:ProfessorKaos64,项目名称:tdm,代码行数:20,代码来源:EditorEntity.cpp


示例20: ComputeLightingOrigin

//-----------------------------------------------------------------------------
// Computes the lighting origin
//-----------------------------------------------------------------------------
static bool ComputeLightingOrigin( StaticPropBuild_t const& build, Vector& lightingOrigin )
{
	for (int i = s_LightingInfo.Count(); --i >= 0; )
	{
		int entIndex = s_LightingInfo[i];

		// Check against all lighting info entities
		char const* pTargetName = ValueForKey( &entities[entIndex], "targetname" );
		if (!Q_strcmp(pTargetName, build.m_pLightingOrigin))
		{
			GetVectorForKey( &entities[entIndex], "origin", lightingOrigin );
			return true;
		}
	}

	return false;
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:20,代码来源:staticprop.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetVectors函数代码示例发布时间:2022-05-30
下一篇:
C++ GetVector函数代码示例发布时间: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