Esempio n. 1
0
int main (int argc, char* argv[])
{
  QApplication app (argc, argv);

  MS ms;
  ms.show();

  return app.exec();
}
Esempio n. 2
0
void SceneNode::Draw(SceneManager *sceneManager, Mesh* debugMesh)
{
	sceneManager->PreRender(true);

	if (gameObject3D != NULL)
	{
		sceneManager->RenderPush(gameObject3D->getProperties().modelProperties);

#if _DEBUG
		if (debugMesh != NULL)
		{
			MS modelStack;
			modelStack.LoadIdentity();
			modelStack.PushMatrix();
			modelStack.Translate(gameObject3D->getHitbox().getMidPoint().x, gameObject3D->getHitbox().getMidPoint().y, gameObject3D->getHitbox().getMidPoint().z);
			modelStack.MultMatrix(gameObject3D->getProperties().rotation);
			modelStack.Scale(gameObject3D->getHitbox().getLength(), gameObject3D->getHitbox().getHeight(), gameObject3D->getHitbox().getDepth());
			sceneManager->Render3DMesh(debugMesh, false);
			modelStack.PopMatrix();
		}
#endif
		sceneManager->Render3DMesh(gameObject3D->getMesh(), gameObject3D->getReflectLight());
	}

	for (unsigned i = 0; i < childNodes.size(); ++i)
	{
		this->childNodes[i]->DrawChild(sceneManager, debugMesh);
	}

	if (gameObject3D != NULL)
	{
		sceneManager->RenderPop();
	}
}
Esempio n. 3
0
void CFood::RenderItem(MS& modelStack)
{
	float C = Charge * 8;
	C = C > 1 ? 1 : C;

	modelStack.Translate(0, translation.y, translation.z);
	modelStack.Translate((currentWeapbobX + translation.x) * (1 - C), currentWeapbobY * (1 - C), 0);
	modelStack.Translate(0, bobY * C, 0);
	modelStack.Rotate(-45 * (1 - C), 0, 1, 0);
	modelStack.Rotate(90, 1, 0, 0);
	modelStack.Scale(2, 4, 2);
}
Esempio n. 4
0
MS DCTranslator::exportSelected()
{
	MS status;
	MSelectionList selection;
	MGlobal::getActiveSelectionList(selection);
	MItSelectionList selIt(selection);
	if (selIt.isDone()) {
		status.perror("MayaToolKit: Nothing Selected!");
		MGlobal::displayWarning("kaleido maya toolkit: Nothing selected!");
		return MS::kFailure;
	}

	MDagPathArray pathArray;
	for (; !selIt.isDone(); selIt.next()) {
		MItDag dagIt(MItDag::kDepthFirst, MFn::kInvalid, &status);
		MDagPath objPath;
		status = selIt.getDagPath(objPath);
		status = dagIt.reset(objPath.node(), MItDag::kDepthFirst, MFn::kInvalid);
		do {
			MDagPath dagPath;
			MObject component = MObject::kNullObj;
			status = dagIt.getPath(dagPath);
			MFnDagNode dagNode(dagPath, &status);
			if (dagNode.isIntermediateObject())
			{

			}
			else if (dagPath.hasFn(MFn::kMesh))
			{
				if (!dagPath.hasFn(MFn::kTransform))
				{
					SpMesh curMesh{ new Mesh };
					status = GetMeshFromNode(dagPath, status, *curMesh);
					//WriteTheMesh Here
					if (status == MS::kSuccess) {
						(*m_MeshArch) << curMesh;
						MGlobal::displayInfo("Write Mesh finished.");
						m_Meshes.push_back(curMesh);
					}
					else {
						MGlobal::displayError("Error GetMesh From Node.");
					}
				}
			}
			else if (dagPath.hasFn(MFn::kCamera))
			{
				if (!dagPath.hasFn(MFn::kTransform))
				{
					pathArray.append(dagPath);
				}
			}
			else if (dagPath.hasFn(MFn::kSpotLight))
			{
				if (!dagPath.hasFn(MFn::kTransform))
				{
					pathArray.append(dagPath);
				}
			}
			dagIt.next();
		} while (!dagIt.isDone());
	}

	return status;
}
Esempio n. 5
0
void Entity::RenderObject(MS& modelStack)
{
	modelStack.Translate(position);
	modelStack.Rotate(hOrientation, 0, 1, 0);
	modelStack.Scale(size);
}