Ejemplo n.º 1
0
            public void DrawPrim(Matrix world)
            {
                if (BoundingBoxPrim != null)
                {
                    //BonePrim.Transform = new Transform(Matrix.CreateScale(Length) * CurrentMatrix);
                    //BonePrim.Draw(null, world);
                    BoundingBoxPrim.UpdateTransform(new Transform(CurrentMatrix));
                    BoundingBoxPrim.Draw(null, world);
                }

                Vector3 boneStart = Vector3.Transform(Vector3.Zero, CurrentMatrix);

                void DrawToEndPoint(Vector3 endPoint)
                {
                    var forward = -Vector3.Normalize(endPoint - boneStart);

                    Matrix hitboxMatrix = Matrix.CreateWorld(boneStart, forward, Vector3.Up);

                    if (forward.X == 0 && forward.Z == 0)
                    {
                        if (forward.Y >= 0)
                        {
                            hitboxMatrix = Matrix.CreateRotationX(MathHelper.PiOver2) * Matrix.CreateTranslation(boneStart);
                        }
                        else
                        {
                            hitboxMatrix = Matrix.CreateRotationX(-MathHelper.PiOver2) * Matrix.CreateTranslation(boneStart);
                        }
                    }

                    float boneLength = (endPoint - boneStart).Length();

                    GlobalBonePrim.Transform = new Transform(Matrix.CreateRotationY(-MathHelper.PiOver2) * Matrix.CreateScale(boneLength) * hitboxMatrix);
                    GlobalBonePrim.Draw(null, world);

                    //using (var tempBone = new DbgPrimWireBone(Name, new Transform(Matrix.CreateRotationY(-MathHelper.PiOver2) * hitboxMatrix), DBG.COLOR_FLVER_BONE, boneLength, boneLength * 0.2f))
                    //{
                    //    tempBone.Draw(null, world);
                    //}
                }

                if (DBG.CategoryEnableDraw[DbgPrimCategory.FlverBone])
                {
                    if (NubReferenceMatrix != null)
                    {
                        DrawToEndPoint(Vector3.Transform(Vector3.Zero, NubReferenceMatrix.Value * CurrentMatrix));
                    }

                    foreach (var cb in ChildBones)
                    {
                        DrawToEndPoint(Vector3.Transform(Vector3.Zero, cb.CurrentMatrix));
                    }
                }

                if (DBG.CategoryEnableNameDraw[DbgPrimCategory.FlverBone])
                {
                    SpawnPrinter.Position3D = Vector3.Transform(Vector3.Zero, CurrentMatrix * world);
                    SpawnPrinter.Draw();
                }
            }
Ejemplo n.º 2
0
            public void DrawPrimText(Matrix world, bool isForce, int globalIDOffset)
            {
                if (DisableTextDraw && !isForce)
                {
                    return;
                }

                SpawnPrinter.Clear();

                bool hasSpawnStuff = !(SFXSpawnIDs.Count == 0 && BulletSpawnIDs.Count == 0 && MiscSpawnTexts.Count == 0);

                //string dmyIDTxt = (ReferenceID == 200) ? $"[{ReferenceID} (All Over Body)]" : $"[{ReferenceID}]";
                string dmyIDTxt = $"{(ReferenceID + globalIDOffset)}";

                if (hasSpawnStuff && !isForce)
                {
                    SpawnPrinter.AppendLine(dmyIDTxt, GetCurrentSpawnColor());
                }
                else if (DBG.CategoryEnableNameDraw[DbgPrimCategory.DummyPoly] || isForce)
                {
                    SpawnPrinter.AppendLine(dmyIDTxt, DBG.COLOR_DUMMY_POLY);
                }


                Vector3 currentPos = Vector3.Transform(Vector3.Zero, CurrentMatrix * world);

                if (hasSpawnStuff && !isForce)
                {
                    foreach (var sfx in SFXSpawnIDs)
                    {
                        SpawnPrinter.AppendLine($"SFX {sfx}", ColorSpawnSFX);
                    }

                    foreach (var bullet in BulletSpawnIDs)
                    {
                        SpawnPrinter.AppendLine($"Bullet {bullet}", ColorSpawnBulletsMisc);
                    }

                    foreach (var misc in MiscSpawnTexts)
                    {
                        SpawnPrinter.AppendLine(misc, ColorSpawnBulletsMisc);
                    }
                }

                if (ShowAttack != null && !isForce)
                {
                    string atkName = ShowAttack.Name;
                    if (!string.IsNullOrWhiteSpace(atkName) && atkName.Length > 64)
                    {
                        atkName = atkName.Substring(0, 64) + "...";
                    }
                    SpawnPrinter.AppendLine($"ATK {ShowAttack.ID}"
                                            + (!string.IsNullOrWhiteSpace(atkName) ? $" {atkName}" : ""),
                                            ShowAttack.Hits[0].GetColor());
                }

                if (SpawnPrinter.LineCount > 0)
                {
                    SpawnPrinter.Position3D = currentPos;
                    SpawnPrinter.Draw();
                }
            }