コード例 #1
0
ファイル: export.cpp プロジェクト: grasmanek94/darkreign2
void XsiExp::ExportMeshObject( INode * node, int indentLevel)
{
	Object * obj = node->EvalWorldState(GetStaticFrame()).obj;
	if (!obj || obj->ClassID() == Class_ID(TARGET_CLASS_ID, 0))
  {
		return;
  }
	TSTR indent = GetIndent(indentLevel);
	
	ExportNodeHeader(node, "Frame", indentLevel);
	
	ExportNodeTM(node, indentLevel);
	
	ExportMesh(node, GetStaticFrame(), indentLevel);
}
コード例 #2
0
ファイル: Export.cpp プロジェクト: MagistrAVSH/node3d
void Exporter::ExportGeomObject(INode* node, int indentLevel)
{
	ObjectState os = node->EvalWorldState(GetStaticFrame());
	if (!os.obj)
		return;
	
	// Targets are actually geomobjects, but we will export them
	// from the camera and light objects, so we skip them here.
	if (os.obj->ClassID() == Class_ID(TARGET_CLASS_ID, 0))
		return;
	
	
	ExportNodeHeader(node);
	ExportNodeTM(node, indentLevel,&rsm->mesh->mat);
	ExportMesh(node, GetStaticFrame(), indentLevel);
	ExportMaterial(node, indentLevel);
}
コード例 #3
0
ファイル: export.cpp プロジェクト: grasmanek94/darkreign2
void XsiExp::ExportBoneObject( INode * node, int indentLevel)
{
	Object * obj = node->EvalWorldState(GetStaticFrame()).obj;
	if (!obj || obj->ClassID() != Class_ID(BONE_CLASS_ID, 0))
  {
    // reject non-bones
    return;
	}
  if (!node->GetParentNode() || node->GetParentNode()->IsRootNode())
  {
    // bone matrices get passed to children
    // drop root bone
    return;
  }
	TSTR indent = GetIndent(indentLevel);

  ExportNodeHeader(node, "Frame", indentLevel);

  // export parent as this bone
	ExportNodeTM(node->GetParentNode(), indentLevel);
}
コード例 #4
0
ファイル: Export.cpp プロジェクト: MagistrAVSH/node3d
void Exporter::ExportCameraObject(INode* node, int indentLevel)
{
	RSCameraObject *pCO=new RSCameraObject;
	pCO->name=new char[strlen(node->GetName())+1];
	strcpy(pCO->name,node->GetName());

	INode* target = node->GetTarget();
	ExportNodeTM(node, indentLevel,&pCO->tm);

	CameraState cs;
	TimeValue t = GetStaticFrame();
	Interval valid = FOREVER;
	// Get animation range
	Interval animRange = ip->GetAnimRange();
	
	ObjectState os = node->EvalWorldState(t);
	CameraObject *cam = (CameraObject *)os.obj;
	
	cam->EvalCameraState(t,valid,&cs);
	pCO->fov=cs.fov;

#define TARGETFPS	60

	TimeValue start = ip->GetAnimRange().Start();
	TimeValue end = ip->GetAnimRange().End();
	int delta = GetTicksPerFrame() * GetFrameRate() / TARGETFPS;
	Matrix3 tm;

	rsm->m_nCameraFrame=(end-start)/delta+1;
	Matrix3 *m=pCO->am=new Matrix3[rsm->m_nCameraFrame];
	for (t=start; t<=end; t+=delta) {
		tm = node->GetNodeTM(t) * Inverse(node->GetParentTM(t));
		*m=tm;
		m++;
	}
	
	rsm->m_CameraList.Add(pCO);

}