void DrawHardpoints(ICamera cam)
        {
            var matrix = GetModelMatrix();

            GizmoRender.Scale = gizmoScale;
            GizmoRender.Begin();

            foreach (var tr in gizmos)
            {
                if (tr.Enabled || tr.Override != null)
                {
                    var transform = tr.Override ?? tr.Definition.Transform;
                    //arc
                    if (tr.Definition is RevoluteHardpointDefinition)
                    {
                        var rev = (RevoluteHardpointDefinition)tr.Definition;
                        var min = tr.Override == null ? rev.Min : tr.EditingMin;
                        var max = tr.Override == null ? rev.Max : tr.EditingMax;
                        GizmoRender.AddGizmoArc(transform * (tr.Parent == null ? Matrix4.Identity : tr.Parent.Transform) * matrix, min, max);
                    }
                    //draw (red for editing, light pink for normal)
                    GizmoRender.AddGizmo(transform * (tr.Parent == null ? Matrix4.Identity : tr.Parent.Transform) * matrix, tr.Override != null ? Color4.Red : Color4.LightPink);
                }
            }
            GizmoRender.RenderGizmos(cam, rstate);
        }
Пример #2
0
        void DrawHardpoints(ICamera cam)
        {
            var matrix = GetModelMatrix();

            GizmoRender.Scale = gizmoScale;
            GizmoRender.Begin();

            foreach (var tr in gizmos)
            {
                if (tr.Enabled || tr.Override != null)
                {
                    var transform = tr.Override ?? tr.Definition.Transform;
                    //highlight edited cube
                    if (tr.Override != null)
                    {
                        GizmoRender.CubeColor = Color4.CornflowerBlue;
                        GizmoRender.CubeAlpha = 0.5f;
                    }
                    else
                    {
                        GizmoRender.CubeColor = Color4.Purple;
                        GizmoRender.CubeAlpha = 0.3f;
                    }
                    //arc
                    if (tr.Definition is RevoluteHardpointDefinition)
                    {
                        var rev = (RevoluteHardpointDefinition)tr.Definition;
                        var min = tr.Override == null ? rev.Min : tr.EditingMin;
                        var max = tr.Override == null ? rev.Max : tr.EditingMax;
                        GizmoRender.AddGizmoArc(transform * (tr.Parent == null ? Matrix4.Identity : tr.Parent.Transform) * matrix, min, max);
                    }
                    //
                    GizmoRender.AddGizmo(transform * (tr.Parent == null ? Matrix4.Identity : tr.Parent.Transform) * matrix);
                }
            }
            GizmoRender.RenderGizmos(cam, rstate);
        }