コード例 #1
0
ファイル: direct3d.cpp プロジェクト: wolfman-x/mechcommander2
/// <summary>
/// <c>wMultiplyTransform</c> 
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="d3dDevice7"></param>
/// <param name="dtstTransformStateType"></param>
/// <param name="lpD3DMatrix"></param>
/// <returns></returns>
HRESULT __stdcall wMultiplyTransform(
	LPDIRECT3DDEVICE7 d3dDevice7, D3DTRANSFORMSTATETYPE dtstTransformStateType,
	LPD3DMATRIX lpD3DMatrix)
{
	PSTR		pszTransformType;
	PSTR		pszErrorMessage;
	HRESULT		hResult;

	pszTransformType = GetTransformType(dtstTransformStateType);
	InternalFunctionSpew("GameOS_Direct3D", "MultiplyTransform(%s)", pszTransformType);

	hResult = 
		d3dDevice7->MultiplyTransform(
		dtstTransformStateType,
		lpD3DMatrix);
	if (FAILED(hResult))
	{
		pszTransformType = GetTransformType(dtstTransformStateType);
		pszErrorMessage = ErrorNumberToMessage(hResult);
		if ( InternalFunctionPause("FAILED (0x%x - %s) - MultiplyTransform()", 
			hResult, pszErrorMessage, pszTransformType) )
			ENTER_DEBUGGER;
	}
	return hResult;
}
コード例 #2
0
IZ_BOOL CColladaAnimation::ReadJoint(domNodeRef pNode)
{
    domNodeType type = pNode->getType();

    if (type == NODETYPE_JOINT) {
        SJoint sJoint;

        sJoint.name = pNode->getName();

        for (size_t n = 0; n < pNode->getContents().getCount(); n++) {
            domElement* pContent = pNode->getContents().get(n);

            daeString strType = pContent->getTypeName();
            if (izanagi::tool::CString::CmpStr(strType, "node")) {
                // terminate...
                continue;
            }

            SJointTransform sTransform;
            sTransform.type = GetTransformType(strType);

            switch (sTransform.type) {
            case E_TRANSFROM_TYPE_TRANSLATE:
                GetTransform<domTranslate, 3>(pContent, sTransform);
                break;
            case E_TRANSFROM_TYPE_QUARTANION:
                GetTransform<domRotate, 4>(pContent, sTransform);
                break;
            case E_TRANSFROM_TYPE_SCALE:
                GetTransform<domScale, 3>(pContent, sTransform);
                break;
            default:
                VRETURN(IZ_FALSE);
                break;
            }

            sJoint.transforms.push_back(sTransform);
        }

        if (!sJoint.transforms.empty()) {
            m_Joints.push_back(sJoint);
        }
    }

    size_t nChildNodeCnt = pNode->getNode_array().getCount();

    for (size_t n = 0; n < nChildNodeCnt; n++) {
        domNodeRef node = pNode->getNode_array().get(n);
        VRETURN(ReadJoint(node));
    }

    return IZ_TRUE;
}