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

C++ GET_MODEL_PTR函数代码示例

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

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



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

示例1: GetModelBoundingBox

// GetModelBoundingBox( index, Float:mins[3], Float:maxs[3], sequence = Model_DefaultSize );
static cell AMX_NATIVE_CALL GetModelBoundingBox(AMX *amx, cell *params)
{
	int entityIndex = params[1];

	CHECK_ENTITY(entityIndex);

	edict_t *pentModel = INDEXENT2(entityIndex);

	if (!FNullEnt(pentModel))
	{
		studiohdr_t *pStudiohdr = static_cast<studiohdr_t*>(GET_MODEL_PTR(pentModel));

		if (!pStudiohdr)
		{
			MF_LogError(amx, AMX_ERR_NATIVE, "Could not find the model pointer for the entity.");
			return 0;
		}

		cell *bbmins = MF_GetAmxAddr(amx, params[2]);
		cell *bbmaxs = MF_GetAmxAddr(amx, params[3]);

		int sequence = params[4];

		if (sequence <= Model_DefaultSize)
		{
			bbmins[0] = amx_ftoc(pStudiohdr->min.x);
			bbmins[1] = amx_ftoc(pStudiohdr->min.y);
			bbmins[2] = amx_ftoc(pStudiohdr->min.z);

			bbmaxs[0] = amx_ftoc(pStudiohdr->max.x);
			bbmaxs[1] = amx_ftoc(pStudiohdr->max.y);
			bbmaxs[2] = amx_ftoc(pStudiohdr->max.z);
		}
		else
		{
			if (sequence <= Model_CurrentSequence || sequence >= pStudiohdr->numseq)
				sequence = pentModel->v.sequence;

			mstudioseqdesc_t *pSeqdesc;
			pSeqdesc = (mstudioseqdesc_t*)((byte*)pStudiohdr + pStudiohdr->seqindex);

			bbmins[0] = amx_ftoc(pSeqdesc[sequence].bbmin.x);
			bbmins[1] = amx_ftoc(pSeqdesc[sequence].bbmin.y);
			bbmins[2] = amx_ftoc(pSeqdesc[sequence].bbmin.z);

			bbmaxs[0] = amx_ftoc(pSeqdesc[sequence].bbmax.x);
			bbmaxs[1] = amx_ftoc(pSeqdesc[sequence].bbmax.y);
			bbmaxs[2] = amx_ftoc(pSeqdesc[sequence].bbmax.z);
		}

		return 1;
	}

	return 0;
};
开发者ID:Chuvi-w,项目名称:amxmodx,代码行数:56,代码来源:misc.cpp


示例2: GET_MODEL_PTR

//=========================================================
//=========================================================
void CBaseAnimating::ResetSequenceInfo()
{
	void *pmodel = GET_MODEL_PTR( ENT( pev ) );

	GetSequenceInfo( pmodel, pev, m_flFrameRate, m_flGroundSpeed );
	m_fSequenceLoops = ( ( GetSequenceFlags() & STUDIO_LOOPING ) != 0 );
	pev->animtime = gpGlobals->time;
	pev->framerate = 1.0;
	m_fSequenceFinished = false;
	m_flLastEventCheck = gpGlobals->time;
}
开发者ID:swmpdg,项目名称:HLEnhanced,代码行数:13,代码来源:CBaseAnimating.cpp


示例3: GET_MODEL_PTR

void CWeaponCycler::SecondaryAttack(void)
{
	pev->sequence = (pev->sequence + 1) % 8;
	pev->modelindex = m_iModel;

	void *pmodel = GET_MODEL_PTR(ENT(pev));

	float flFrameRate, flGroundSpeed;
	GetSequenceInfo(pmodel, pev, &flFrameRate, &flGroundSpeed);
	pev->modelindex = 0;

	if (flFrameRate == 0)
		pev->sequence = 0;

	SendWeaponAnim(pev->sequence);
	m_flNextSecondaryAttack = gpGlobals->time + 0.3;
}
开发者ID:AlexCSilva,项目名称:cs16-client,代码行数:17,代码来源:h_cycler.cpp


示例4: lookup_sequence

// lookup_sequence(entid, "sequence name", &Float:framerate = 0.0, &bool:loops = false, &Float:groundspeed = 0.0);
static cell AMX_NATIVE_CALL lookup_sequence(AMX* amx, cell* params)
{
	int index = params[1];

	CHECK_ENTITY(index);

	edict_t* ent = INDEXENT(index);

	studiohdr_t* pstudiohdr = static_cast<studiohdr_t*>(GET_MODEL_PTR(ent));

	if (pstudiohdr == NULL)
	{
		MF_LogError(amx, AMX_ERR_NATIVE, "Could not retrieve the model pointer from the entity provided.");
		return 0;
	}

	mstudioseqdesc_t* pseqdesc;

	pseqdesc = reinterpret_cast<mstudioseqdesc_t*>(
					reinterpret_cast<char*>(pstudiohdr) + pstudiohdr->seqindex);

	char* label = MF_GetAmxString(amx, params[2], 0, NULL);

	for (int i = 0; i < pstudiohdr->numseq; i++)
	{
		if (UTIL_stricmp( pseqdesc[i].label, label ) == 0)
		{
			REAL* FrameRate = reinterpret_cast<REAL*>(MF_GetAmxAddr(amx, params[3]));
			cell* Loops = MF_GetAmxAddr(amx, params[4]);
			REAL* GroundSpeed = reinterpret_cast<REAL*>(MF_GetAmxAddr(amx, params[5]));

			// Taken from HLSDK: animation & animating.cpp
			pseqdesc = &pseqdesc[i];
			*FrameRate = 256 * pseqdesc->fps / (pseqdesc->numframes - 1);

			*GroundSpeed = sqrt( pseqdesc->linearmovement[0]*pseqdesc->linearmovement[0]+ pseqdesc->linearmovement[1]*pseqdesc->linearmovement[1]+ pseqdesc->linearmovement[2]*pseqdesc->linearmovement[2] );
			*GroundSpeed = *GroundSpeed * pseqdesc->fps / (pseqdesc->numframes - 1);

			*Loops = pseqdesc->flags & STUDIO_LOOPING;
			return i;
		}
	}

	return -1;

};
开发者ID:Chuvi-w,项目名称:amxmodx,代码行数:47,代码来源:misc.cpp


示例5: FIND_ENTITY_BY_TARGETNAME

// Find an entity that I'm interested in and precache the sounds he'll need in the sequence.
void CCineMonster::Activate(void)
{
	edict_t *     pentTarget;
	CBaseMonster *pTarget;

	// The entity name could be a target name or a classname
	// Check the targetname
	pentTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(m_iszEntity));
	pTarget    = NULL;

	while(!pTarget && !FNullEnt(pentTarget))
	{
		if(FBitSet(VARS(pentTarget)->flags, FL_MONSTER))
		{
			pTarget = GetMonsterPointer(pentTarget);
		}
		pentTarget = FIND_ENTITY_BY_TARGETNAME(pentTarget, STRING(m_iszEntity));
	}

	// If no entity with that targetname, check the classname
	if(!pTarget)
	{
		pentTarget = FIND_ENTITY_BY_CLASSNAME(NULL, STRING(m_iszEntity));
		while(!pTarget && !FNullEnt(pentTarget))
		{
			pTarget    = GetMonsterPointer(pentTarget);
			pentTarget = FIND_ENTITY_BY_TARGETNAME(pentTarget, STRING(m_iszEntity));
		}
	}
	// Found a compatible entity
	if(pTarget)
	{
		void *pmodel;
		pmodel = GET_MODEL_PTR(pTarget->edict());
		if(pmodel)
		{
			// Look through the event list for stuff to precache
			SequencePrecache(pmodel, STRING(m_iszIdle));
			SequencePrecache(pmodel, STRING(m_iszPlay));
		}
	}
}
开发者ID:Sh1ft0x0EF,项目名称:HLSDKRevamp,代码行数:43,代码来源:Scripted.cpp


示例6: SetModelBoundingBox

// SetModelBoudingBox( index, sequence = Model_DefaultSize );
static cell AMX_NATIVE_CALL SetModelBoundingBox(AMX *amx, cell *params)
{
	int entityIndex = params[1];

	CHECK_ENTITY(entityIndex);

	edict_t *pentModel = INDEXENT2(entityIndex);

	if (!FNullEnt(pentModel))
	{
		studiohdr_t *pStudiohdr = static_cast<studiohdr_t*>(GET_MODEL_PTR(pentModel));

		if (!pStudiohdr)
		{
			MF_LogError(amx, AMX_ERR_NATIVE, "Could not find the model pointer for the entity.");
			return 0;
		}

		int sequence = params[2];

		if (sequence <= Model_DefaultSize)
		{
			SET_SIZE(pentModel, pStudiohdr->min, pStudiohdr->max);
		}
		else
		{
			if (sequence <= Model_CurrentSequence || sequence >= pStudiohdr->numseq)
				sequence = pentModel->v.sequence;

			mstudioseqdesc_t *pSeqdesc; 
			pSeqdesc = (mstudioseqdesc_t*)((byte*)pStudiohdr + pStudiohdr->seqindex);

			SET_SIZE(pentModel, pSeqdesc[sequence].bbmin, pSeqdesc[sequence].bbmax);

			return 1;
		}
	}

	return 0;
}
开发者ID:Chuvi-w,项目名称:amxmodx,代码行数:41,代码来源:misc.cpp


示例7: StudioFrameAdvanceEnt

void StudioFrameAdvanceEnt(edict_t *pEdict)
{
	float flInterval = gpGlobals->time - pEdict->v.animtime;
	if (flInterval <= 0.001f) {
		pEdict->v.animtime = gpGlobals->time;
		return;
	}

	if (pEdict->v.animtime == 0.0f) {
		flInterval = 0.0f;
	}

	studiohdr_t *pstudiohdr = static_cast<studiohdr_t *>(GET_MODEL_PTR(pEdict));
	if (!pstudiohdr) {
		return;
	}

	if (pEdict->v.sequence >= pstudiohdr->numseq || pEdict->v.sequence < 0) {
		return;
	}

	float flFrameRate = 256.0f;
	mstudioseqdesc_t *pseqdesc = (mstudioseqdesc_t *)((byte *)pstudiohdr + pstudiohdr->seqindex) + int(pEdict->v.sequence);
	if (pseqdesc->numframes > 1)
	{
		flFrameRate = pseqdesc->fps * 256.0f / (pseqdesc->numframes - 1);
	}

	pEdict->v.frame += flInterval * flFrameRate * pEdict->v.framerate;
	pEdict->v.animtime = gpGlobals->time;

	if (pEdict->v.frame < 0.0f || pEdict->v.frame >= 256.0f)
	{
		// true if the sequence loops
		if (pseqdesc->flags & STUDIO_LOOPING)
			pEdict->v.frame -= int(pEdict->v.frame / 256.0f) * 256.0f;
		else
			pEdict->v.frame = (pEdict->v.frame < 0.0f) ? 0.0f : 255.0f;
	}
}
开发者ID:s1lentq,项目名称:reapi,代码行数:40,代码来源:reapi_utils.cpp


示例8: while

// Find an entity that I'm interested in and precache the sounds he'll need in the sequence.
void CCineMonster::Activate( void )
{
	CBaseMonster* pTarget = nullptr;

	CBaseEntity* pNextTarget = nullptr;

	// The entity name could be a target name or a classname
	// Check the targetname
	while( !pTarget && ( pNextTarget = UTIL_FindEntityByTargetname( pNextTarget, STRING( m_iszEntity ) ) ) != nullptr )
	{
		if( pNextTarget->GetFlags().Any( FL_MONSTER ) )
		{
			pTarget = pNextTarget->MyMonsterPointer();
		}
	}

	// If no entity with that targetname, check the classname
	if( !pTarget )
	{
		pNextTarget = nullptr;
		while( !pTarget && ( pNextTarget = UTIL_FindEntityByClassname( pNextTarget, STRING( m_iszEntity ) ) ) != nullptr )
		{
			pTarget = pNextTarget->MyMonsterPointer();
		}
	}

	// Found a compatible entity
	if( pTarget )
	{
		void *pmodel;
		pmodel = GET_MODEL_PTR( pTarget->edict() );
		if( pmodel )
		{
			// Look through the event list for stuff to precache
			SequencePrecache( pmodel, STRING( m_iszIdle ) );
			SequencePrecache( pmodel, STRING( m_iszPlay ) );
		}
	}
}
开发者ID:oskarlh,项目名称:HLEnhanced,代码行数:40,代码来源:CCineMonster.cpp


示例9: lookup_sequence_by_id

// lookup_sequence_by_id(entid, sequence_id, &Float:framerate = 0.0, &bool:loops = false, &Float:groundspeed = 0.0);
static cell AMX_NATIVE_CALL lookup_sequence_by_id(AMX* amx, cell* params)
{
	int index = params[1];

	CHECK_ENTITY(index);

	edict_t* ent = INDEXENT(index);

	studiohdr_t* pstudiohdr = static_cast<studiohdr_t*>(GET_MODEL_PTR(ent));

	if (pstudiohdr == NULL)
	{
		MF_LogError(amx, AMX_ERR_NATIVE, "Could not retrieve the model pointer from the entity (%d %p) provided.", index, ent);
		return 0;
	}

	mstudioseqdesc_t* pseqdesc;

	pseqdesc = reinterpret_cast<mstudioseqdesc_t*>(
		reinterpret_cast<char*>(pstudiohdr)+pstudiohdr->seqindex);

	int sequence_id = params[2];
	if (sequence_id < 0 || sequence_id >= pstudiohdr->numseq)
		return -1;

	REAL* FrameRate = reinterpret_cast<REAL*>(MF_GetAmxAddr(amx, params[3]));
	cell* Loops = MF_GetAmxAddr(amx, params[4]);
	REAL* GroundSpeed = reinterpret_cast<REAL*>(MF_GetAmxAddr(amx, params[5]));

	// Taken from HLSDK: animation & animating.cpp
	pseqdesc = &pseqdesc[sequence_id];
	*FrameRate = 256 * pseqdesc->fps / (pseqdesc->numframes - 1);

	*GroundSpeed = sqrt(pseqdesc->linearmovement[0] * pseqdesc->linearmovement[0] + pseqdesc->linearmovement[1] * pseqdesc->linearmovement[1] + pseqdesc->linearmovement[2] * pseqdesc->linearmovement[2]);
	*GroundSpeed = *GroundSpeed * pseqdesc->fps / (pseqdesc->numframes - 1);

	*Loops = pseqdesc->flags & STUDIO_LOOPING;
	return sequence_id;
};
开发者ID:dreamstalker,项目名称:amxmodx,代码行数:40,代码来源:misc.cpp


示例10: ExtractBbox

/* <10b5f> ../cstrike/dlls/animating.cpp:250 */
int CBaseAnimating::ExtractBbox(int sequence, float *mins, float *maxs)
{
	return ::ExtractBbox(GET_MODEL_PTR(ENT(pev)), sequence, mins, maxs);
}
开发者ID:omertelli,项目名称:ReGameDLL_CS,代码行数:5,代码来源:animating.cpp


示例11: GetBodygroup

/* <10af0> ../cstrike/dlls/animating.cpp:244 */
NOXREF int CBaseAnimating::GetBodygroup(int iGroup)
{
	return ::GetBodygroup(GET_MODEL_PTR(ENT(pev)), pev, iGroup);
}
开发者ID:omertelli,项目名称:ReGameDLL_CS,代码行数:5,代码来源:animating.cpp


示例12: SetBodygroup

/* <10aad> ../cstrike/dlls/animating.cpp:239 */
NOXREF void CBaseAnimating::SetBodygroup(int iGroup, int iValue)
{
	::SetBodygroup(GET_MODEL_PTR(ENT(pev)), pev, iGroup, iValue);
}
开发者ID:omertelli,项目名称:ReGameDLL_CS,代码行数:5,代码来源:animating.cpp


示例13: GET_MODEL_PTR

/* <108d3> ../cstrike/dlls/animating.cpp:192 */
NOXREF float CBaseAnimating::SetBlending(int iBlender, float flValue)
{
	void *pmodel = GET_MODEL_PTR(ENT(pev));
	return ::SetBlending(pmodel, pev, iBlender, flValue);
}
开发者ID:omertelli,项目名称:ReGameDLL_CS,代码行数:6,代码来源:animating.cpp


示例14: SpawnRandomGibs

//LRC - changed signature, to support custom gib models
void CGib :: SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int notfirst, const char *szGibModel )
{
	if (cGibs == 0) return; // spawn nothing!

	CGib *pGib = GetClassPtr( (CGib *)NULL );
	pGib->Spawn( szGibModel );

	//LRC - check the model itself to find out how many gibs are available
	studiohdr_t *pstudiohdr = (studiohdr_t *)(GET_MODEL_PTR( ENT(pGib->pev) ));
	if (! pstudiohdr)
		return;

	mstudiobodyparts_t *pbodypart = (mstudiobodyparts_t *)((byte *)pstudiohdr + pstudiohdr->bodypartindex);
	//ALERT(at_console, "read %d bodyparts, canonical is %d\n", pbodypart->nummodels, HUMAN_GIB_COUNT);

	for (int cSplat = 0 ; cSplat < cGibs ; cSplat++ )
	{
		if (pGib == NULL) // first time through, we set pGib before the loop started
		{
			pGib = GetClassPtr( (CGib *)NULL );
			pGib->Spawn( szGibModel );
		}

		if (notfirst)
			pGib->pev->body = RANDOM_LONG(1, pbodypart->nummodels - 1);// start at one to avoid throwing random amounts of skulls (0th gib)
		else
			pGib->pev->body = RANDOM_LONG(0, pbodypart->nummodels - 1);

		if ( pevVictim )
		{
			// spawn the gib somewhere in the monster's bounding volume
			pGib->pev->origin.x = pevVictim->absmin.x + pevVictim->size.x * (RANDOM_FLOAT ( 0 , 1 ) );
			pGib->pev->origin.y = pevVictim->absmin.y + pevVictim->size.y * (RANDOM_FLOAT ( 0 , 1 ) );
			pGib->pev->origin.z = pevVictim->absmin.z + pevVictim->size.z * (RANDOM_FLOAT ( 0 , 1 ) ) + 1;	// absmin.z is in the floor because the engine subtracts 1 to enlarge the box

			// make the gib fly away from the attack vector
			pGib->pev->velocity = g_vecAttackDir * -1;

			// mix in some noise
			pGib->pev->velocity.x += RANDOM_FLOAT ( -0.25, 0.25 );
			pGib->pev->velocity.y += RANDOM_FLOAT ( -0.25, 0.25 );
			pGib->pev->velocity.z += RANDOM_FLOAT ( -0.25, 0.25 );

			pGib->pev->velocity = pGib->pev->velocity * RANDOM_FLOAT ( 300, 400 );

			pGib->pev->avelocity.x = RANDOM_FLOAT ( 100, 200 );
			pGib->pev->avelocity.y = RANDOM_FLOAT ( 100, 300 );

			// copy owner's blood color
			pGib->m_bloodColor = (CBaseEntity::Instance(pevVictim))->BloodColor();
			
			if ( pevVictim->health > -50)
			{
				pGib->pev->velocity = pGib->pev->velocity * 0.7;
			}
			else if ( pevVictim->health > -200)
			{
				pGib->pev->velocity = pGib->pev->velocity * 2;
			}
			else
			{
				pGib->pev->velocity = pGib->pev->velocity * 4;
			}

			pGib->pev->solid = SOLID_BBOX;
			UTIL_SetSize ( pGib->pev, Vector( 0 , 0 , 0 ), Vector ( 0, 0, 0 ) );
		}
		pGib->LimitVelocity();
		pGib = NULL; //LRC
	}
}
开发者ID:RichardRohac,项目名称:hl-amnesia-src,代码行数:72,代码来源:combat.cpp


示例15: GetSequenceDuration

float AvHBaseBuildable::GetTimeForAnimation(int inIndex) const
{
	return GetSequenceDuration(GET_MODEL_PTR(ENT(pev)), this->pev);
}
开发者ID:Arkshine,项目名称:NS,代码行数:4,代码来源:AvHBaseBuildable.cpp


示例16: set_controller

// Float:set_controller(entid, controllerid, Float:value);
static cell AMX_NATIVE_CALL set_controller(AMX* amx, cell* params)
{
// From animation.cpp from the HLSDK
//	SetController( void *pmodel, entvars_t *pev, int iController, float flValue )
	int entindex = params[1];
	CHECK_ENTITY(entindex);
	edict_t* entity = INDEXENT(entindex);

	int iController = params[2];

	if (iController < 0 || iController > 3)
	{
		MF_LogError(amx, AMX_ERR_NATIVE, "Invalid controller id passed. Expected 0 through 3, got %d.", iController);
		return 0;
	}
	entvars_t* pev = &entity->v;

	float flValue = amx_ctof(params[3]);
	
	studiohdr_t* pstudiohdr = static_cast<studiohdr_t*>(GET_MODEL_PTR(entity));

	if (! pstudiohdr)
	{
		MF_LogError(amx, AMX_ERR_NATIVE, "Could not find the model pointer for the entity.");
		return amx_ftoc(flValue);
	}

	mstudiobonecontroller_t	*pbonecontroller = (mstudiobonecontroller_t *)((byte *)pstudiohdr + pstudiohdr->bonecontrollerindex);

	int i = 0;

	// find first controller that matches the index
	for (i = 0; i < pstudiohdr->numbonecontrollers; i++, pbonecontroller++)
	{
		if (pbonecontroller->index == iController)
			break;
	}
	if (i >= pstudiohdr->numbonecontrollers)
		return amx_ftoc(flValue);

	// wrap 0..360 if it's a rotational controller

	if (pbonecontroller->type & (STUDIO_XR | STUDIO_YR | STUDIO_ZR))
	{
		// ugly hack, invert value if end < start
		if (pbonecontroller->end < pbonecontroller->start)
			flValue = -flValue;

		// does the controller not wrap?
		if (pbonecontroller->start + 359.0 >= pbonecontroller->end)
		{
			if (flValue > ((pbonecontroller->start + pbonecontroller->end) / 2.0) + 180)
				flValue = flValue - 360;
			if (flValue < ((pbonecontroller->start + pbonecontroller->end) / 2.0) - 180)
				flValue = flValue + 360;
		}
		else
		{
			if (flValue > 360)
				flValue = flValue - (int)(flValue / 360.0) * 360.0;
			else if (flValue < 0)
				flValue = flValue + (int)((flValue / -360.0) + 1) * 360.0;
		}
	}

	int setting = static_cast<int>(255 * (flValue - pbonecontroller->start) / (pbonecontroller->end - pbonecontroller->start));

	if (setting < 0) setting = 0;
	if (setting > 255) setting = 255;
	pev->controller[iController] = setting;

	return amx_ftoc(setting * (1.0 / 255.0) * (pbonecontroller->end - pbonecontroller->start) + pbonecontroller->start);
}
开发者ID:Chuvi-w,项目名称:amxmodx,代码行数:74,代码来源:misc.cpp


示例17: SequenceDuration

//=========================================================
// LookupActivity
//=========================================================
float CBaseAnimating :: SequenceDuration( void )
{               
	void *pmodel = GET_MODEL_PTR(ENT(pev));

	return ::SequenceDuration( pmodel, pev->sequence );
}
开发者ID:nekonomicon,项目名称:QuakeRemakeDevkit,代码行数:9,代码来源:animating.cpp


示例18: SetActivity

//=========================================================
// SetActivity 
//=========================================================
void CFriend :: SetActivity ( Activity NewActivity )
{
	int	iSequence = ACTIVITY_NOT_AVAILABLE;
	void *pmodel = GET_MODEL_PTR( ENT(pev) );

	switch ( NewActivity)
	{
	case ACT_RANGE_ATTACK1:
					
//		if (RANDOM_LONG(0,1))
//		{
//			iSequence = LookupSequence( "throwgrenade" );
//		}
//		else
//		{
			if (pev->frags)
			{
				iSequence = LookupSequence( "standing_shotgun" );
			}
			else
			{
				iSequence = LookupSequence( "standing_mp5" );
			}
//		}
		break;

	case ACT_RANGE_ATTACK2:
		// grunt is going to a secondary long range attack. This may be a thrown 
		// grenade or fired grenade, we must determine which and pick proper sequence
		// get toss anim
		iSequence = LookupSequence( "throwgrenade" );
		break;

	case ACT_RUN:
		if ( pev->health <= LIMP_HEALTH )
		{
			// limp!
			iSequence = LookupActivity ( ACT_RUN_HURT );
		}
		else
		{
			iSequence = LookupActivity ( NewActivity );
		}
		break;
	case ACT_WALK:
		if ( pev->health <= LIMP_HEALTH )
		{
			// limp!
			iSequence = LookupActivity ( ACT_WALK_HURT );
		}
		else
		{
			iSequence = LookupActivity ( NewActivity );
		}
		break;
	case ACT_IDLE:
		if ( m_MonsterState == MONSTERSTATE_COMBAT )
		{
			NewActivity = ACT_IDLE_ANGRY;
		}
		iSequence = LookupActivity ( NewActivity );
		break;
	default:
		iSequence = LookupActivity ( NewActivity );
		break;
	}
	
	m_Activity = NewActivity; // Go ahead and set this so it doesn't keep trying when the anim is not present

	// Set to the desired anim, or default anim if the desired is not present
	if ( iSequence > ACTIVITY_NOT_AVAILABLE )
	{
		if ( pev->sequence != iSequence || !m_fSequenceLoops )
		{
			pev->frame = 0;
		}

		pev->sequence		= iSequence;	// Set to the reset anim (if it's there)
		ResetSequenceInfo( );
		SetYawSpeed();
	}
	else
	{
		// Not available try to get default anim
		ALERT ( at_console, "%s has no sequence for act:%d\n", STRING(pev->classname), NewActivity );
		pev->sequence		= 0;	// Set to the reset anim (if it's there)
	}
}
开发者ID:JoelTroch,项目名称:am_src_rebirth,代码行数:91,代码来源:hgrunt_f.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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