예제 #1
0
        internal static void AddPointBillboard(string material,
                                               Color color, Vector3D origin, float radius, float angle, int priority = 0, int customViewProjection = -1)
        {
            if (!MyRender11.DebugOverrides.BillboardsDynamic)
            {
                return;
            }
            Debug.Assert(material != null);

            origin.AssertIsValid();
            angle.AssertIsValid();

            MyQuadD quad;

            if (MyUtils.GetBillboardQuadAdvancedRotated(out quad, origin, radius, angle, MyRender11.Environment.Matrices.CameraPosition) != false)
            {
                MyBillboard billboard = MyBillboardRenderer.AddBillboardOnce();
                if (billboard == null)
                {
                    return;
                }

                billboard.Priority             = priority;
                billboard.CustomViewProjection = customViewProjection;
                CreateBillboard(billboard, ref quad, material, ref color, ref origin);
            }
        }
예제 #2
0
        internal static void AddBillboardOriented(string material,
                                                  Color color, Vector3D origin, Vector3 leftVector, Vector3 upVector, float radius, int priority = 0, float softParticleDistanceScale = 1.0f,
                                                  int customViewProjection = -1)
        {
            if (!MyRender11.DebugOverrides.BillboardsDynamic)
            {
                return;
            }

            Debug.Assert(material != null);

            origin.AssertIsValid();
            leftVector.AssertIsValid();
            upVector.AssertIsValid();
            radius.AssertIsValid();
            MyDebug.AssertDebug(radius > 0);

            MyBillboard billboard = MyBillboardRenderer.AddBillboardOnce();

            if (billboard == null)
            {
                return;
            }

            billboard.Priority             = priority;
            billboard.CustomViewProjection = customViewProjection;

            MyQuadD quad;

            MyUtils.GetBillboardQuadOriented(out quad, ref origin, radius, ref leftVector, ref upVector);

            CreateBillboard(billboard, ref quad, material, ref color, ref origin, softParticleDistanceScale);
        }