コード例 #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public LightRefNode(Rcol parent) : base(parent)
        {
            version = 0xa;
            BlockID = 0x253d2018;

            rn = new RenderableNode(null);
            bn = new BoundedNode(null);
            tn = new TransformNode(null);

            items    = new string[0];
            unknown2 = new byte[13];
        }
コード例 #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ViewerRefNode(Rcol parent) : base(parent)
        {
            vrnb = new ViewerRefNodeBase(null);
            rn   = new RenderableNode(null);
            bn   = new BoundedNode(null);
            tn   = new TransformNode(null);

            names    = new string[0];
            unknown2 = new byte[0xA0];

            version = 0x0c;
            BlockID = 0x7BA3838C;
        }
コード例 #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ViewerRefNodeRecursive(Rcol parent) : base(parent)
        {
            vrnb = new ViewerRefNodeBase(null);
            rn   = new RenderableNode(null);
            bn   = new BoundedNode(null);
            tn   = new TransformNode(null);

            names    = new string[0];
            unknown4 = "";
            unknown5 = new byte[64];

            version = 0x01;
            BlockID = 0x0c152b8e;
        }
コード例 #4
0
        void AddJoint(Ambertation.Scenes.Joint parent, int index, Hashtable jointmap, ElementOrder component)
        {
            if (!joints)
            {
                return;
            }
            if (index < 0 || index >= gmdc.Joints.Count)
            {
                return;
            }

            GmdcJoint j = gmdc.Joints[index];

            Ambertation.Scenes.Joint nj = parent.CreateChild(j.Name);
            jointmap[index] = nj;

            if (j.AssignedTransformNode != null)
            {
                Vector3f tmp = j.AssignedTransformNode.Transformation.Translation;
                tmp = component.TransformScaled(tmp);
                //tmp = component.ScaleMatrix * tmp;

                nj.Translation.X = tmp.X; nj.Translation.Y = tmp.Y; nj.Translation.Z = tmp.Z;

                Quaternion q = component.TransformRotation(j.AssignedTransformNode.Transformation.Rotation);
                tmp = q.GetEulerAngles();

                //Console.WriteLine("        "+q.ToLinedString());
                nj.Rotation.X = tmp.X; nj.Rotation.Y = tmp.Y; nj.Rotation.Z = tmp.Z;

                IntArrayList li = j.AssignedTransformNode.ChildBlocks;
                foreach (int i in li)
                {
                    SimPe.Interfaces.Scenegraph.ICresChildren cld = j.AssignedTransformNode.GetBlock(i);
                    if (cld is TransformNode)
                    {
                        TransformNode tn = cld as TransformNode;
                        if (tn.JointReference != TransformNode.NO_JOINT)
                        {
                            AddJoint(nj, tn.JointReference, jointmap, component);
                        }
                    }
                }
            }
        }
コード例 #5
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ShapeRefNode(Rcol parent) : base(parent)
        {
            rn = new RenderableNode(null);
            bn = new BoundedNode(null);
            tn = new TransformNode(null);

            itemsa = new ShapeRefNodeItem_A[0];
            itemsb = new ShapeRefNodeItem_B[0];

            data = new byte[0];

            version  = 0x15;
            unknown1 = 1;
            unknown2 = 1;
            unknown4 = 1;
            unknown5 = 0x10;
            unknown6 = -1;
            name     = "Practical";
            BlockID  = 0x65245517;
        }
コード例 #6
0
        /// <summary>
        /// Build the Parent Map
        /// </summary>
        /// <param name="parentmap">Hasttable that will contain the Child (key) -> Parent (value) Relation</param>
        /// <param name="parent">the current Parent id (-1=none)</param>
        /// <param name="c">the current Block we process</param>
        protected void LoadJointRelationRec(System.Collections.Hashtable parentmap, int parent, SimPe.Interfaces.Scenegraph.ICresChildren c)
        {
            if (c == null)
            {
                return;
            }

            if (c.GetType() == typeof(TransformNode))
            {
                TransformNode tn = (TransformNode)c;
                if (tn.JointReference != TransformNode.NO_JOINT)
                {
                    parentmap[tn.JointReference] = parent;
                    parent = tn.JointReference;
                }
            }

            //process the childs of this Block
            foreach (int i in c.ChildBlocks)
            {
                SimPe.Interfaces.Scenegraph.ICresChildren cl = c.GetBlock(i);
                LoadJointRelationRec(parentmap, parent, cl);
            }
        }