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


C++ VMArray::Get方法代码示例

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


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

示例1: SetNodeLocalRotationEuler

	bool SetNodeLocalRotationEuler(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, VMArray<float> inArray, bool firstPerson)
	{
		NiAVObject	* object = ResolveNode(obj, nodeName, firstPerson);
		if(object && inArray.Length() == 3) {
			float heading, attitude, bank;

			inArray.Get(&heading, 0);
			inArray.Get(&attitude, 1);
			inArray.Get(&bank, 2);

			// Degrees to radians
			heading *= MATH_PI / 180;
			attitude *= MATH_PI / 180;
			bank *= MATH_PI / 180;

			object->m_localTransform.rot.SetEulerAngles(heading, attitude, bank);

			BSTaskPool * taskPool = BSTaskPool::GetSingleton();
			if(taskPool)
				taskPool->UpdateWorldData(object);

			return true;
		}

		return false;
	}
开发者ID:Alenett,项目名称:TES-Reloaded-Source,代码行数:26,代码来源:PapyrusNetImmerse.cpp

示例2: CreateEnchantment

	void CreateEnchantment(TESForm* baseForm, BaseExtraList * extraData, float maxCharge, VMArray<EffectSetting*> effects, VMArray<float> magnitudes, VMArray<UInt32> areas, VMArray<UInt32> durations)
	{
		if(baseForm && (baseForm->formType == TESObjectWEAP::kTypeID || baseForm->formType == TESObjectARMO::kTypeID)) {
			EnchantmentItem * enchantment = NULL;
			if(effects.Length() > 0 && magnitudes.Length() == effects.Length() && areas.Length() == effects.Length() && durations.Length() == effects.Length()) {
				tArray<MagicItem::EffectItem> effectItems;
				effectItems.Allocate(effects.Length());

				UInt32 j = 0;
				for(UInt32 i = 0; i < effects.Length(); i++) {
					EffectSetting * magicEffect = NULL;
					effects.Get(&magicEffect, i);
					if(magicEffect) { // Only add effects that actually exist
						magnitudes.Get(&effectItems[j].magnitude, i);
						areas.Get(&effectItems[j].area, i);
						durations.Get(&effectItems[j].duration, i);
						effectItems[j].mgef = magicEffect;
						j++;
					}
				}
				effectItems.count = j; // Set count to existing count

				if(baseForm->formType == TESObjectWEAP::kTypeID)
					enchantment = CALL_MEMBER_FN(PersistentFormManager::GetSingleton(), CreateOffensiveEnchantment)(&effectItems);
				else
					enchantment = CALL_MEMBER_FN(PersistentFormManager::GetSingleton(), CreateDefensiveEnchantment)(&effectItems);

				FormHeap_Free(effectItems.arr.entries);
			}

			if(enchantment) {
				if(maxCharge > 0xFFFF) // Charge exceeds uint16 clip it
					maxCharge = 0xFFFF;

				ExtraEnchantment* extraEnchant = static_cast<ExtraEnchantment*>(extraData->GetByType(kExtraData_Enchantment));
				if(extraEnchant) {
					PersistentFormManager::GetSingleton()->DecRefEnchantment(extraEnchant->enchant);
					extraEnchant->enchant = enchantment;
					PersistentFormManager::GetSingleton()->IncRefEnchantment(extraEnchant->enchant);

					extraEnchant->maxCharge = (UInt16)maxCharge;
				} else {
					ExtraEnchantment* extraEnchant = ExtraEnchantment::Create();
					extraEnchant->enchant = enchantment;
					extraEnchant->maxCharge = (UInt16)maxCharge;
					extraData->Add(kExtraData_Enchantment, extraEnchant);
				}
			}
		}
	}
开发者ID:NecroReindeer,项目名称:comp140-api-hacking,代码行数:50,代码来源:PapyrusWornObject.cpp

示例3: SetNodeLocalPosition

	bool SetNodeLocalPosition(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, VMArray<float> inArray, bool firstPerson)
	{
		NiAVObject	* object = ResolveNode(obj, nodeName, firstPerson);
		if(object && inArray.Length() == 3) {
			inArray.Get(&object->m_localTransform.pos.x, 0);
			inArray.Get(&object->m_localTransform.pos.y, 1);
			inArray.Get(&object->m_localTransform.pos.z, 2);

			BSTaskPool * taskPool = BSTaskPool::GetSingleton();
			if(taskPool)
				taskPool->UpdateWorldData(object);

			return true;
		}

		return false;
	}
开发者ID:Alenett,项目名称:TES-Reloaded-Source,代码行数:17,代码来源:PapyrusNetImmerse.cpp

示例4: SetNodeLocalRotationMatrix

	bool SetNodeLocalRotationMatrix(StaticFunctionTag* base, TESObjectREFR * obj, BSFixedString nodeName, VMArray<float> inArray, bool firstPerson)
	{
		NiAVObject	* object = ResolveNode(obj, nodeName, firstPerson);
		if(object && inArray.Length() == 9) {
			inArray.Get(&object->m_localTransform.rot.data[0][0], 0);
			inArray.Get(&object->m_localTransform.rot.data[0][1], 1);
			inArray.Get(&object->m_localTransform.rot.data[0][2], 2);

			inArray.Get(&object->m_localTransform.rot.data[1][0], 3);
			inArray.Get(&object->m_localTransform.rot.data[1][1], 4);
			inArray.Get(&object->m_localTransform.rot.data[1][2], 5);

			inArray.Get(&object->m_localTransform.rot.data[2][0], 6);
			inArray.Get(&object->m_localTransform.rot.data[2][1], 7);
			inArray.Get(&object->m_localTransform.rot.data[2][2], 8);

			BSTaskPool * taskPool = BSTaskPool::GetSingleton();
			if(taskPool)
				taskPool->UpdateWorldData(object);

			return true;
		}

		return false;
	}
开发者ID:Alenett,项目名称:TES-Reloaded-Source,代码行数:25,代码来源:PapyrusNetImmerse.cpp

示例5: ApplyMultByIndex

void ApplyMultByIndex(VMArray<float> &multsToModify, UInt32 index, float iniVal, float max)
{
	//Enforce limits
	if (iniVal < 0.0)
		iniVal = 0.0;
	else if (iniVal > max)
		iniVal = max;

	float data;
	multsToModify.Get(&data, index);
	data *= iniVal;
	multsToModify.Set(&data, index);
}
开发者ID:egocarib,项目名称:EnchantingAwakened,代码行数:13,代码来源:Ini.cpp

示例6: PushArgs

	void PushArgs(VMArray<T> args)
	{
		using namespace papyrusUI;

		UInt32 argCount = args.Length();

		UInt32 offset = invokeDelegate_->argCount;
		UInt32 newArgCount = offset + argCount;

		if (newArgCount > 128)
		{
			_WARNING("Tried to push more than 128 arguments into PapyrusUICallback.");
			return;
		}
		
		invokeDelegate_->argCount = newArgCount;
		for (UInt32 i=0; i<argCount; i++, offset++)
		{
			T arg;
			args.Get(&arg, i);
			SetGFxValue<T>(&invokeDelegate_->args[offset], arg);
		}
	}
开发者ID:NecroReindeer,项目名称:comp140-api-hacking,代码行数:23,代码来源:PapyrusUICallback.cpp

示例7: SetMainArrays

bool EAr_MGEFInfoLib::SetMainArrays(
	VMArray<TESEffectShader*>	eShaders,
	VMArray<BGSArtObject*>		eArt,
	VMArray<TESEffectShader*>	hShaders,
	VMArray<BGSArtObject*>		hArt,
	VMArray<BGSProjectile*>		projectiles,
	VMArray<BGSImpactDataSet*>	impactData,
	VMArray<UInt32>				persistFlags,
	VMArray<float>				tWeights,
	VMArray<float>				tCurves,
	VMArray<float>				tDurations)
{
	if ((eShaders.Length() < 126) ||
		(eArt.Length() < 126) ||
		(hShaders.Length() < 126) ||
		(hArt.Length() < 126) ||
		(projectiles.Length() < 126) ||
		(impactData.Length() < 126) ||
		(persistFlags.Length() < 126) ||
		(tWeights.Length() < 126) ||
		(tCurves.Length() < 126) ||
		(tDurations.Length() < 126))
		return false;

	for (UInt32 i = 0; i < 126; i++)
	{
		TESEffectShader*  pESh = NULL;
		BGSArtObject*     pEAr = NULL;
		TESEffectShader*  pHSh = NULL;
		BGSArtObject*     pHAr = NULL;
		BGSProjectile*    pPro = NULL;
		BGSImpactDataSet* pIDS = NULL;
		UInt32            flag;
		float             tWei;
		float             tCur;
		float             tDur;

		eShaders.Get		(&pESh, i);
		eArt.Get			(&pEAr, i);
		hShaders.Get		(&pHSh, i);
		hArt.Get			(&pHAr, i);
		projectiles.Get		(&pPro, i);
		impactData.Get		(&pIDS, i);
		persistFlags.Get	(&flag, i);
		tWeights.Get		(&tWei, i);
		tCurves.Get			(&tCur, i);
		tDurations.Get		(&tDur, i);

		_eShaders.push_back		(pESh);
		_eArt.push_back			(pEAr);
		_hShaders.push_back		(pHSh);
		_hArt.push_back			(pHAr);
		_projectiles.push_back	(pPro);
		_impactData.push_back	(pIDS);
		_persistFlags.push_back	(flag);
		_tWeights.push_back		(tWei);
		_tCurves.push_back		(tCur);
		_tDurations.push_back	(tDur);
	}

	battleaxeKeyword = papyrusKeyword::GetKeyword(NULL, "WeapTypeBattleaxe");
	READY = true;
	_MESSAGE("Internal effect library loaded successfully.");
	return true;
}
开发者ID:egocarib,项目名称:EnchantedArsenal,代码行数:65,代码来源:EA_EffectLib.cpp


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