예제 #1
0
            public DummyPolyInfo(FLVER.Dummy dmy, NewAnimSkeleton_FLVER skeleton)
            {
                dummy           = dmy;
                ReferenceID     = dmy.ReferenceID;
                ReferenceMatrix = Matrix.CreateWorld(
                    Vector3.Zero,
                    Vector3.Normalize(new Vector3(dmy.Forward.X, dmy.Forward.Y, dmy.Forward.Z)),
                    dmy.UseUpwardVector ? Vector3.Normalize(new Vector3(dmy.Upward.X, dmy.Upward.Y, dmy.Upward.Z)) : Vector3.Up)
                                  * Matrix.CreateTranslation(new Vector3(dmy.Position.X, dmy.Position.Y, dmy.Position.Z))
                                  * (dmy.ParentBoneIndex >= 0 ? skeleton.FlverSkeleton[dmy.ParentBoneIndex].ReferenceMatrix : Matrix.Identity);
                AttachMatrix = Matrix.Identity;

                ArrowPrimitive = new DbgPrimWireArrow("DummyPoly Spawns", Transform.Default, Color.White)
                {
                    //Wireframe = true,
                    //BackfaceCulling = true,
                    //DisableLighting = true,
                    Category      = DbgPrimCategory.DummyPolySpawnArrow,
                    OverrideColor = Color.Cyan,
                };
            }
예제 #2
0
        public void Draw(int lod, bool motionBlur, bool forceNoBackfaceCulling, bool isSkyboxLol, NewAnimSkeleton_FLVER skeleton = null, Action <Exception> onDrawFail = null)
        {
            if (TextureReloadQueued)
            {
                TryToLoadTextures();
                TextureReloadQueued = false;
            }

            lock (_lock_submeshes)
            {
                if (Submeshes == null)
                {
                    return;
                }

                foreach (var submesh in Submeshes)
                {
                    try
                    {
                        submesh.Draw(lod, motionBlur, DrawMask, forceNoBackfaceCulling, skeleton, onDrawFail);
                    }
                    catch (Exception ex)
                    {
                        onDrawFail?.Invoke(ex);
                    }
                }
            }
        }