Exemple #1
0
        private void SelectLight(LightAttributes light)
        {
            if (light == null)
            {
                selectedLight           = null;
                ModelForm.selectedLight = null;
                UpdateUI();
            }
            else
            {
                selectedLight           = light;
                ModelForm.selectedLight = light;
                UpdateUI();

                var  pos  = light.Position;
                Bone bone = null;
                ModelForm.Skeleton?.BonesMap?.TryGetValue(light.BoneId, out bone);
                if (bone != null)
                {
                    var xform = bone.AbsTransform;
                    pos = xform.Multiply(pos);
                    //TODO:? handle bone's rotation correctly for widget??
                }

                ModelForm.SetWidgetTransform(pos, light.Orientation, new Vector3(light.Falloff));
            }
        }
 private void SelectLight(LightAttributes light)
 {
     if (light == null)
     {
         selectedLight           = null;
         ModelForm.selectedLight = null;
         UpdateUI();
     }
     else
     {
         selectedLight           = light;
         ModelForm.selectedLight = light;
         UpdateUI();
         ModelForm.SetWidgetTransform(light.Position, light.Orientation, new Vector3(light.Falloff));
     }
 }