public void DrawPrim(Matrix world, bool isForce) { bool generalDummyPolyDraw = DBG.CategoryEnableDraw[DbgPrimCategory.DummyPoly] || isForce; bool hasSpawnStuff = !(SFXSpawnIDs.Count == 0 && BulletSpawnIDs.Count == 0 && MiscSpawnTexts.Count == 0); if (!generalDummyPolyDraw && !hasSpawnStuff) { return; } Vector3 currentPos = Vector3.Transform(Vector3.Zero, CurrentMatrix); //Vector3 currentDir = Vector3.TransformNormal(Vector3.Forward, CurrentMatrix); Quaternion currentRot = Quaternion.Normalize(Quaternion.CreateFromRotationMatrix(CurrentMatrix)); Matrix unscaledCurrentMatrix = Matrix.CreateFromQuaternion(currentRot) * Matrix.CreateTranslation(currentPos); if (hasSpawnStuff && !isForce) { ArrowPrimitive.OverrideColor = GetCurrentSpawnColor(); ArrowPrimitive.Draw(null, Matrix.CreateScale(0.4f) * unscaledCurrentMatrix * world); } else if (generalDummyPolyDraw) { ArrowPrimitive.OverrideColor = DBG.COLOR_DUMMY_POLY; ArrowPrimitive.Draw(null, Matrix.CreateScale(isForce ? 0.4f : 0.2f) * unscaledCurrentMatrix * world); } }
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(); } }
public void DrawOverPrims() { if (PivotPrimIsEnabled) { PivotPrim_DrawOver.Draw(null, Matrix_World); } }
public void DrawPrim(Matrix world) { if (BonePrim != null && BoundingBoxPrim != null) { BonePrim.Transform = new Transform(Matrix.CreateScale(Length) * CurrentMatrix); BonePrim.Draw(null, world); BoundingBoxPrim.UpdateTransform(new Transform(CurrentMatrix)); BoundingBoxPrim.Draw(null, world); } }