Пример #1
0
 public SCNVector4(Vector4 v)
 {
     X = v.X;
     Y = v.Y;
     Z = v.Z;
     W = v.W;
 }
Пример #2
0
 public SKUniform(string name, Vector4 value)
 {
     if (CheckSystemVersion())
     {
         InitializeHandle(InitWithNameVectorFloat4(name, value), "initWithName:vectorFloat4:");
     }
     else
     {
         InitializeHandle(InitWithNameFloatVector4(name, value), "initWithName:floatVector4:");
     }
 }
        public virtual Vector4 [] GetVector4Values()
        {
            var count    = TimeSampleCount;
            var timesArr = new Vector4 [(int)count];

            unsafe {
                int typeSize = sizeof(Vector4);

                fixed(Vector4 *arrptr = timesArr)
                MDLMemoryHelper.FetchValues(typeSize, (IntPtr)arrptr, count, _GetFloat4Array);
            }

            return(timesArr);
        }
Пример #4
0
 public NMatrix4(VectorFloat4 row0, VectorFloat4 row1, VectorFloat4 row2, VectorFloat4 row3)
 {
     M11 = row0.X;
     M21 = row1.X;
     M31 = row2.X;
     M41 = row3.X;
     M12 = row0.Y;
     M22 = row1.Y;
     M32 = row2.Y;
     M42 = row3.Y;
     M13 = row0.Z;
     M23 = row1.Z;
     M33 = row2.Z;
     M43 = row3.Z;
     M14 = row0.W;
     M24 = row1.W;
     M34 = row2.W;
     M44 = row3.W;
 }
Пример #5
0
 public void SetVector4Parameter(string key, global::System.Numerics.Vector4 value)
 {
     global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.UI.Composition.CompositionAnimation", "void CompositionAnimation.SetVector4Parameter(string key, Vector4 value)");
 }
Пример #6
0
        private static void BuildComponentPropertiesList(IComponent component, Entity entity, ref object clipboard)
        {
            var isAlive = true;

            if (component != null && ImGui.CollapsingHeader(component.GetType().Name, ref isAlive))
            {
                if (ImGui.IsItemHovered())
                {
                    var io = ImGui.GetIO();

                    if (io.KeyCtrl && ImGui.IsKeyDown(ImGui.GetKeyIndex(ImGuiKey.C)))
                    {
                        ImGui.BeginTooltip();
                        ImGui.Text("Copied: " + component.GetHashCode());
                        clipboard = component;
                        ImGui.EndTooltip();
                    }
                }
                foreach (var property in component.GetType().GetProperties())
                {
                    var propertyValue = property.GetValue(component, null);

                    if (ImGui.TreeNode(property.Name))
                    {
                        if (property.CanWrite)
                        {
                            switch (propertyValue)
                            {
                            case Vector3 vector:
                            {
                                var x = vector.X;
                                var y = vector.Y;
                                var z = vector.Z;

                                ImGui.InputFloat("x###" + "PropertyVector3X:" + property.Name + ":" + component.GetType().Name, ref x);
                                ImGui.InputFloat("y###" + "PropertyVector3Y:" + property.Name + ":" + component.GetType().Name, ref y);
                                ImGui.InputFloat("z###" + "PropertyVector3Z:" + property.Name + ":" + component.GetType().Name, ref z);

                                propertyValue = new Vector3(x, y, z);
                                property.SetValue(component, propertyValue);
                                break;
                            }

                            case Quaternion quaternion:
                            {
                                var x = quaternion.X;
                                var y = quaternion.Y;
                                var z = quaternion.Z;
                                var w = quaternion.W;

                                ImGui.InputFloat("x###" + "PropertyQuaternionX:" + property.Name + ":" + component.GetType().Name, ref x);
                                ImGui.InputFloat("y###" + "PropertyQuaternionY:" + property.Name + ":" + component.GetType().Name, ref y);
                                ImGui.InputFloat("z###" + "PropertyQuaternionZ:" + property.Name + ":" + component.GetType().Name, ref z);
                                ImGui.InputFloat("w###" + "PropertyQuaternionW:" + property.Name + ":" + component.GetType().Name, ref w);

                                propertyValue = new Quaternion(x, y, z, w);
                                property.SetValue(component, propertyValue);
                                break;
                            }

                            case PrimitiveType type:
                            {
                                var intType = (int)type;
                                ImGui.SliderInt("Type###PropertyPrimitiveType:" + property.Name + ":" + component.GetType().Name, ref intType, 0, 2, type.ToString());

                                propertyValue = (PrimitiveType)intType;
                                property.SetValue(component, propertyValue);
                                break;
                            }

                            case Color color:
                            {
                                var vec4Color = color.ToVector4();
                                var inColor   = new global::System.Numerics.Vector4(vec4Color.X, vec4Color.Y, vec4Color.Z, vec4Color.W);

                                ImGui.ColorEdit4("Color###PropertyColor:" + property.Name + ":" + component.GetType().Name, ref inColor);

                                propertyValue = new Color(inColor.X, inColor.Y, inColor.Z, inColor.W);
                                property.SetValue(component, propertyValue);
                                break;
                            }

                            case float value:
                            {
                                var floatValue = value;

                                ImGui.InputFloat("value###" + "PropertyFloatValue:" + property.Name + ":" + component.GetType().Name, ref floatValue);

                                property.SetValue(component, floatValue);
                                break;
                            }

                            case Model model:
                                ImGui.Text("Root: " + model.Root.Name);
                                ImGui.Text("Hash: " + model.GetHashCode());
                                break;

                            case bool boolean:
                            {
                                var boolValue = boolean;
                                ImGui.Checkbox("###PropertyBooleanValue:" + property.Name + ":" + component.GetType().Name, ref boolValue);
                                property.SetValue(component, boolValue);
                                break;
                            }

                            case DPModel dpModel:
                                ImGui.Text("Name: " + dpModel.Name);
                                ImGui.Text("Triangle Count: " + dpModel.PrimitiveCount);
                                ImGui.Text("BoundingBox: " + dpModel.BoundingBox);
                                break;

                            case TransformComponent transformComponent:
                            {
                                if (property.PropertyType == typeof(TransformComponent) && clipboard != null && clipboard.GetType() == typeof(TransformComponent) && component != clipboard)
                                {
                                    if (ImGui.Button("Replace with clipboard"))
                                    {
                                        property.SetValue(component, clipboard);
                                    }
                                }
                                ImGui.Text("Position: " + transformComponent.Position);
                                ImGui.Text("Scale: " + transformComponent.Scale);
                                ImGui.Text("Rotation: " + transformComponent.Rotation);
                                break;
                            }

                            case null when property.PropertyType == typeof(TransformComponent) && clipboard != null && clipboard.GetType() == typeof(TransformComponent) && component != clipboard:
                            {
                                if (ImGui.Button("Paste TransformComponent"))
                                {
                                    property.SetValue(component, clipboard);
                                }
                                break;
                            }

                            case null:
                                ImGui.Text("None");
                                break;
                            }
                        }
                        else
                        {
                            ImGui.Text(propertyValue.ToString());
                        }

                        ImGui.TreePop();
                    }
                }
            }

            if (!isAlive)
            {
                var detachMethod        = typeof(Entity).GetMethod("Detach");
                var detachGenericMethod = detachMethod.MakeGenericMethod(component.GetType());
                detachGenericMethod.Invoke(entity, null);
            }
        }
Пример #7
0
 public void InsertKeyFrame(float normalizedProgressKey, global::System.Numerics.Vector4 value, global::Windows.UI.Composition.CompositionEasingFunction easingFunction)
 {
     global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.UI.Composition.Vector4KeyFrameAnimation", "void Vector4KeyFrameAnimation.InsertKeyFrame(float normalizedProgressKey, Vector4 value, CompositionEasingFunction easingFunction)");
 }
Пример #8
0
 public void InsertVector4(string propertyName, global::System.Numerics.Vector4 value)
 {
     global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.UI.Composition.CompositionPropertySet", "void CompositionPropertySet.InsertVector4(string propertyName, Vector4 value)");
 }
Пример #9
0
 public global::Windows.UI.Composition.CompositionGetValueStatus TryGetVector4(string propertyName, out global::System.Numerics.Vector4 value)
 {
     throw new global::System.NotImplementedException("The member CompositionGetValueStatus CompositionPropertySet.TryGetVector4(string propertyName, out Vector4 value) is not implemented in Uno.");
 }
Пример #10
0
 public MDLVoxelIndexExtent(Vector4 minimumExtent, Vector4 maximumExtent)
 {
     this.MinimumExtent = minimumExtent;
     this.MaximumExtent = maximumExtent;
 }