/*! NIFLIB_HIDDEN function. For internal use only. */ internal override void FixLinks(Dictionary <uint, NiObject> objects, List <uint> link_stack, List <NiObject> missing_link_stack, NifInfo info) { base.FixLinks(objects, link_stack, missing_link_stack, info); emitterObject = FixLink <NiAVObject>(objects, link_stack, missing_link_stack, info); }
private void WalkNodes(NiAVObject node) { // Ignore some node names if (!IsNodeDrawable(node)) return; // Render Children if (node is NiTriShape) { Export.Add(""); Export.Add(ParseShape((NiTriShape)node)); Export.Add(""); } else if (node is NiTriStrips) { Export.Add(""); Export.Add(ParseStrips((NiTriStrips)node)); Export.Add(""); } NiNode currentNode = node as NiNode; if (currentNode != null) { if (currentNode.Children.Length > 0) { foreach (var child in currentNode.Children) { if (child.IsValid()) { WalkNodes(child.Object); } } } } }
public NiPhysXTransformDest() { target = null; }
public NiPSVolumeEmitter() { emitterObject = null; }
/// <summary> /// Prints the nif node. /// </summary> /// <param name="root">The root.</param> /// <param name="depth">The depth.</param> private void PrintNifNode(NiAVObject root, int depth) { string text = string.Empty; for (int i = 0; i < depth; i++) { text += "*"; } text += " "; Console.WriteLine(text + " " + root.Name); NiNode niNode = root as NiNode; if (niNode != null) { NiRef<NiAVObject>[] children = niNode.Children; for (int j = 0; j < children.Length; j++) { NiRef<NiAVObject> niRef = children[j]; if (niRef.IsValid()) { this.PrintNifNode(niRef.Object, depth + 1); } } } }
public NiCollisionObject() { target = null; }
public NiSkinningMeshModifier() { flags = (ushort)0; skeletonRoot = null; numBones = (uint)0; }
internal bool IsNodeDrawable(NiAVObject node) { // Invisible Flag if ((node.Flags & 1) == 1) return false; // Ignore some node names foreach (string ignoreName in IgnoreNodeNames) { if (node.Name.Value.ToLower().StartsWith(ignoreName.ToLower())) return false; } return true; }
internal Matrix ComputeWorldMatrix(NiAVObject obj) { var path = new List<NiAVObject>(); var current = obj; while (current != null) { path.Add(current); current = current.Parent; } var worldMatrix = Matrix.Identity; for (var i = 0; i < path.Count; i++) { var node = path[i]; worldMatrix *= node.Rotation; worldMatrix *= Matrix.Scaling(node.Scale, node.Scale, node.Scale); worldMatrix *= Matrix.Translation(node.Translation.X, node.Translation.Y, node.Translation.Z); } return worldMatrix; }