本文整理汇总了C++中Matrix3::Zero方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix3::Zero方法的具体用法?C++ Matrix3::Zero怎么用?C++ Matrix3::Zero使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix3
的用法示例。
在下文中一共展示了Matrix3::Zero方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetMat
void ProtHelpObject::GetMat(TimeValue t, INode* inode, ViewExp& vpt, Matrix3& tm)
{
if ( ! vpt.IsAlive() )
{
tm.Zero();
return;
}
tm = inode->GetObjectTM(t);
tm.NoScale();
float scaleFactor = vpt.NonScalingObjectSize() * vpt.GetVPWorldWidth(tm.GetTrans()) / 360.0f;
tm.Scale(Point3(scaleFactor,scaleFactor,scaleFactor));
}
示例2: Capture
//-----------------------------------------------------------------------------
BOOL CExporter::Capture()
{
VERIFY (m_Style!=eExportUndef);
Modifier* pPhysique;
IPhysiqueExport* pExport;
IPhyContextExport* pContext;
Object* pObject;
Matrix3 matMesh;
Matrix3 matZero;
if (!m_MeshNode){
ERR("Select mesh and try again.");
m_bHasError=TRUE;
return FALSE;
}
pObject = m_MeshNode->GetObjectRef();
if (!IsExportableMesh(m_MeshNode,pObject)){
ERR("Can't receive node references.");
m_bHasError=TRUE;
return FALSE;
}
// Get export interface
pPhysique = FindPhysiqueModifier(m_MeshNode);
if (!pPhysique){
ERR("Can't find Physique modifier.");
m_bHasError=TRUE;
return FALSE;
}
pExport = (IPhysiqueExport *)pPhysique->GetInterface(I_PHYINTERFACE);
if (!pExport){
ERR("Can't find Physique interface.");
m_bHasError=TRUE;
return FALSE;
}
// Get mesh initial transform (used to mult by the bone matrices)
int rval = CGINTM(m_MeshNode,pExport->GetInitNodeTM(m_MeshNode, matMesh));
matZero.Zero();
if (rval || matMesh.Equals(matZero, 0.0)){
ERR("Old CS version. Can't export mesh");
matMesh.IdentityMatrix();
}
// Add hierrarhy parts that has no effect on vertices,
// but required for hierrarhy stability
if (eExportMotion==m_Style){
if (m_AllBones.empty()){
ERR("Invalid skin object. Bone not found.");
return FALSE;
}
EConsole.ProgressStart((float)m_AllBones.size(),"..Capturing bones");
for (DWORD i=0; i<m_AllBones.size(); i++){
AddBone(m_AllBones[i], matMesh, pExport);
EConsole.ProgressInc();
}
EConsole.ProgressEnd();
}
bool bRes = TRUE;
if (eExportSkin==m_Style){
// For a given Object's INode get a
// ModContext Interface from the Physique Export Interface:
pContext = (IPhyContextExport *)pExport->GetContextInterface(m_MeshNode);
if (!pContext){
ERR("Can't find Physique context interface.");
return FALSE;
}
// convert to rigid with blending
pContext->ConvertToRigid(TRUE);
pContext->AllowBlending (TRUE);
// process vertices
int numVertices = pContext->GetNumberVertices();
EConsole.ProgressStart(float(numVertices),"..Capturing vertices");
for (int iVertex = 0; iVertex < numVertices; iVertex++ ){
IPhyVertexExport *pVertexExport = (IPhyVertexExport *)pContext->GetVertexInterface(iVertex);
R_ASSERT(pVertexExport);
// What kind of vertices are these?
int iVertexType = pVertexExport->GetVertexType();
IPhyRigidVertex* pRigidVertex=(IPhyRigidVertex*)pContext->GetVertexInterface(iVertex);
R_ASSERT (pRigidVertex);
switch (iVertexType){
case RIGID_TYPE:{
INode* node = pRigidVertex->GetNode();
R_ASSERT (node);
LPCSTR nm = node->GetName();
// get bone and create vertex
CVertexDef* pVertex = AddVertex();
int boneId = AddBone(node,matMesh,pExport);
if(BONE_NONE==boneId){
//.........这里部分代码省略.........