Example #1
0
    private void JointInfoDisplay(JointInfoTable.JointInfoDefinition jointInfo)
    {
        EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
        if (jointInfo != null)
        {
            jointInfo.BoneName       = EditorGUILayout.TextField("Joint Name", jointInfo.BoneName);
            jointInfo.PositionVertID = EditorGUILayout.IntField("Position Vert ID", jointInfo.PositionVertID);
            jointInfo.AimVertID      = EditorGUILayout.IntField("Aim Vert ID", jointInfo.AimVertID);
            jointInfo.UpVector       = EditorGUILayout.Vector3Field("Up Vector", jointInfo.UpVector);

            EditorGUILayout.LabelField("Normal Vert ID Pairs");
            foreach (int[] pair in jointInfo.VertPairs)
            {
                EditorGUILayout.BeginHorizontal();
                pair[0] = EditorGUILayout.IntField("", pair[0]);
                pair[1] = EditorGUILayout.IntField("", pair[1]);
                EditorGUILayout.EndHorizontal();
            }

            if (GUILayout.Button("Add Pair"))
            {
                jointInfo.VertPairs.Add(new int[2]);
            }
        }
        EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
    }
Example #2
0
 public void RemoveJointInfo(JointInfoTable.JointInfoDefinition jointInfo)
 {
     m_config.RemoveJointInfo(jointInfo);
 }
Example #3
0
 public void AddJointInfo(JointInfoTable.JointInfoDefinition jointInfo)
 {
     m_config.AddJointInfo(jointInfo);
 }
Example #4
0
    public override void OnInspectorGUI()
    {
        DynamicParticleComponent dynamicParticle = (DynamicParticleComponent)target;
        ClothSimEntity           clothSimEntity  = dynamicParticle.ClothSimEntity;

        VertInfo vertInfo = dynamicParticle.ParticleInfo.VertInfo;

        JointInfoTable.JointInfoDefinition jointInfo = dynamicParticle.ParticleInfo.JointInfo;
        BodyShapeOffSetTable bodyShapesOffsetsTable  = dynamicParticle.ParticleInfo.VertInfo.BodyShapeOffsetTable;

        int vertID = vertInfo.VertID;

        vertInfo.VertID = EditorGUILayout.IntField("Vert ID", vertID);
        dynamicParticle.gameObject.name = vertInfo.VertID != vertID ? "Particle VertID : " + vertInfo.VertID.ToString() : dynamicParticle.gameObject.name;

        vertInfo.MassScale           = EditorGUILayout.FloatField("Mass Scale", vertInfo.MassScale);
        vertInfo.PullToSkinScale     = EditorGUILayout.FloatField("Pull To Skin Scale", vertInfo.PullToSkinScale);
        vertInfo.ColliderRadiusScale = EditorGUILayout.FloatField("Collider Radius Scale", vertInfo.ColliderRadiusScale);
        vertInfo.Position            = EditorGUILayout.Vector3Field("Position", vertInfo.Position);
        vertInfo.IsStatic            = EditorGUILayout.Toggle("Static", vertInfo.IsStatic);

        //update vert id.


        JointInfoDisplay(jointInfo);

        if (GUILayout.Button("Skin Weights Editor"))
        {
        }

        if (GUILayout.Button("Constraints Editor"))
        {
            ClothSimConstraintsEditorWindow constraintsWindow = EditorWindow.GetWindow <ClothSimConstraintsEditorWindow>();
            constraintsWindow.ParticleComponent = dynamicParticle;
            constraintsWindow.Show();
        }

        if (jointInfo == null)
        {
            if (GUILayout.Button("AddJointInfo"))
            {
                JointInfoTable.JointInfoDefinition newJointInfo = new JointInfoTable.JointInfoDefinition();

                clothSimEntity.AddJointInfo(newJointInfo);
                dynamicParticle.ParticleInfo.JointInfo = newJointInfo;
            }
        }
        else
        {
            if (GUILayout.Button("RemoveJointInfo"))
            {
                clothSimEntity.RemoveJointInfo(jointInfo);
                dynamicParticle.ParticleInfo.JointInfo = null;
            }
        }

        if (GUILayout.Button("Delete Patricle"))
        {
            clothSimEntity.DeleteParticle(dynamicParticle.gameObject);
        }

        BlendShapeEditor(clothSimEntity, dynamicParticle, dynamicParticle.ParticleInfo.VertInfo.BodyShapeOffsetTable);
    }