コード例 #1
0
void dAutomataState::GetStateArray (dList<dAutomataState*>& statesList)
{
	dTree<dAutomataState*, dAutomataState*> filter;

	int stack = 1;
	dAutomataState* pool[256];
	pool[0] = this;
	filter.Insert(this, this);

	while (stack) {
		stack --;
		dAutomataState* const state = pool[stack];
		statesList.Append(state);

		for (dList<dAutomataState::dTransition>::dListNode* node = state->m_transtions.GetFirst(); node; node = node->GetNext()) {
			dAutomataState* const state = node->GetInfo().GetState();
			if (!filter.Find (state)) {
				pool[stack] = state;
				filter.Insert(state, state);
				stack ++;
				_ASSERTE (stack < sizeof (pool)/sizeof (pool[0]));
			}
		}
	}
}
コード例 #2
0
void dCILInstrMove::GetUsedVariables (dList<dArg*>& variablesList)
{
	if (m_arg1.m_isPointer) {
		variablesList.Append(&m_arg1);
	} else {
		switch (m_arg1.GetType().m_intrinsicType) 
		{
			case m_constInt:
			case m_constFloat:
				break;

			default:
				variablesList.Append(&m_arg1);
		}
	}
}
コード例 #3
0
ファイル: dModel.cpp プロジェクト: Zarius/pseudoform
void dModel::GetBoneList (dList<dBone*>& bodeList) const
{
	for (dList<dBone*>::dListNode* node = m_skeleton.GetFirst(); node; node = node->GetNext()) {
		dBone* rootbone = node->GetInfo();
		for (dBone* bone = rootbone->GetFirst(); bone; bone = (dBone*) bone->GetNext()) {
			bodeList.Append(bone);
		}
	}
}
コード例 #4
0
void dCILInstrPhy::GetUsedVariables (dList<dArg*>& variablesList)
{
	for (dList<dArgPair>::dListNode* node = m_sources.GetFirst(); node; node = node->GetNext()) {
		dArg* const arg = &node->GetInfo().m_arg;
		if (arg->GetType().m_isPointer) {
			variablesList.Append(arg);
		} else {
			switch (arg->GetType().m_intrinsicType) 
			{
				case m_constInt:
				case m_constFloat:
					break;

				default:
					variablesList.Append(arg);
			}
		}
	}
}
コード例 #5
0
ファイル: dBone.cpp プロジェクト: Zarius/pseudoform
void dBone::Load(const char* fileName, dList<dBone*>& list, dLoaderContext& context)
{
	const TiXmlElement* root;
	TiXmlDocument doc (fileName);
	doc.LoadFile();

	root = doc.RootElement();
	if (root && !strcmp (root->GetText (), "newton 2.0 file format")){
		for (const TiXmlElement* skeleton = (TiXmlElement*)root->FirstChild("skeleton"); skeleton; skeleton = (TiXmlElement*)skeleton->NextSibling()) {
			dBone* rootBone;

			rootBone = NULL;
			for (const TiXmlElement* node = (TiXmlElement*)skeleton->FirstChild("bone"); node; node = (TiXmlElement*)node->NextSibling()) {
				dBone* bone;
				const char* name;
				const char* parent;

				name = node->Attribute ("name");
				parent = node->Attribute ("parent");

				if (parent) {
					dBone* parentBone;
					parentBone = rootBone->Find (parent);
					_ASSERTE (parentBone);
					bone = context.CreateBone (parentBone);
				} else {
					bone = context.CreateBone (NULL);
					rootBone = bone;
				}

				dMatrix matrix;
				bone->SetNameID(name);
				node->Attribute ("boneID", &bone->m_boneID);
				dModel::StringToFloats (node->Attribute("matrix"), &matrix[0][0]);
				bone->SetMatrix (matrix);
			} 

			list.Append(rootBone);
		}
	}
}
コード例 #6
0
void RigidBodyWorldDesc::GetNodeList (dList<INode*>& list)
{
	int stackIndex;
	INode* stack[4096];

	stackIndex = 1;
	Interface* const ip = GetCOREInterface();
	stack[0] = ip->GetRootNode();

	while (stackIndex) {
		stackIndex --;
		INode* const node = stack[stackIndex];
		list.Append(node); 

		for (int i = 0; i < node->NumberOfChildren(); i ++) {
			stack[stackIndex] = node->GetChildNode(i);
			stackIndex ++;
			_ASSERTE (stackIndex * sizeof (INode*) < sizeof (stack));	
		}
	}
}
コード例 #7
0
void dCILInstrStore::GetUsedVariables(dList<dArg*>& variablesList)
{
	variablesList.Append(&m_arg0);
	variablesList.Append(&m_arg1);
}
コード例 #8
0
void dCILInstrLoad::GetUsedVariables (dList<dArg*>& variablesList)
{
	variablesList.Append(&m_arg1);
}