本文整理汇总了C++中NiNodeRef::GetVisibility方法的典型用法代码示例。如果您正苦于以下问题:C++ NiNodeRef::GetVisibility方法的具体用法?C++ NiNodeRef::GetVisibility怎么用?C++ NiNodeRef::GetVisibility使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NiNodeRef
的用法示例。
在下文中一共展示了NiNodeRef::GetVisibility方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ImportBones
//.........这里部分代码省略.........
PosRotScale prs = prsDefault;
Vector3 pos; Matrix33 rot; float scale;
m4.Decompose(pos, rot, scale);
Matrix3 im = TOMATRIX3(m4);
Point3 p = im.GetTrans();
Quat q(im);
//q.Normalize();
Vector3 ppos;
Point3 zAxis(0,0,0);
bool hasChildren = !children.empty();
if (hasChildren) {
float len = 0.0f;
for (vector<NiAVObjectRef>::iterator itr=children.begin(), end = children.end(); itr != end; ++itr) {
len += GetObjectLength(*itr);
}
len /= float(children.size());
ppos = pos + Vector3(len, 0.0f, 0.0f); // just really need magnitude as rotation will take care of positioning
}
else if (parent)
{
ppos = pos + Vector3(len/3.0f, 0.0f, 0.0f);
}
Point3 pp(ppos.x, ppos.y, ppos.z);
Point3 qp = TORAD(TOEULER(im));
INode *bone = NULL;
if (!doNotReuseExistingBones) // Games like BC3 reuse the same bone names
{
bone = FindNode(node);
if (bone == NULL)
bone = gi->GetINodeByName(name.c_str());
}
if (bone)
{
// Is there a better way of "Affect Pivot Only" behaviors?
INode *pinode = bone->GetParentNode();
if (pinode)
bone->Detach(0,1);
PosRotScaleNode(bone, p, q, scale, prs);
if (pinode)
pinode->AttachChild(bone, 1);
}
else
{
bool isDummy = ( (uncontrolledDummies && !HasControllerRef(ctrlCount, name))
|| (!dummyNodeMatches.empty() && wildmatch(dummyNodeMatches, name))
|| (convertBillboardsToDummyNodes && node->IsDerivedType(NiBillboardNode::TYPE))
);
if (wildmatch("Camera*", name)) {
if (enableCameras) {
if (bone = CreateCamera(name)) {
PosRotScaleNode(bone, p, q, scale, prs);
bone->Hide(node->GetVisibility() ? FALSE : TRUE);
}
}
}else if (isDummy && createNubsForBones)
bone = CreateHelper(name, p);
else if (bone = CreateBone(name, p, pp, zAxis))
{
PosRotScaleNode(bone, p, q, scale, prs);
bone->Hide(node->GetVisibility() ? FALSE : TRUE);
}
if (bone)
{
if (!parentname.empty())
{
if (mergeNonAccum && wildmatch("* NonAccum", parentname)) {
parentname = parentname.substr(0, parentname.length() - 9);
}
if (INode *pn = gi->GetINodeByName(parentname.c_str()))
pn->AttachChild(bone, 1);
}
RegisterNode(node, bone);
}
}
// Import UPB
if (bone) ImportUPB(bone, node);
// Import Havok Collision Data surrounding node,
// unfortunately this causes double import of collision so I'm disabling it for now.
if (enableCollision && node->GetParent()) {
ImportCollision(node);
}
if (bone && recurse)
{
ImportBones(childNodes);
}
}
catch( exception & e )
{
e=e;
}
catch( ... )
{
}
}