예제 #1
0
        public void OnEnable()
        {
            actor = (ObiRod)target;

            rodBlueprint = serializedObject.FindProperty("m_RodBlueprint");

            collisionMaterial = serializedObject.FindProperty("m_CollisionMaterial");
            selfCollisions    = serializedObject.FindProperty("m_SelfCollisions");
            surfaceCollisions = serializedObject.FindProperty("m_SurfaceCollisions");

            stretchShearConstraintsEnabled = serializedObject.FindProperty("_stretchShearConstraintsEnabled");
            stretchCompliance = serializedObject.FindProperty("_stretchCompliance");
            shear1Compliance  = serializedObject.FindProperty("_shear1Compliance");
            shear2Compliance  = serializedObject.FindProperty("_shear2Compliance");

            bendTwistConstraintsEnabled = serializedObject.FindProperty("_bendTwistConstraintsEnabled");
            torsionCompliance           = serializedObject.FindProperty("_torsionCompliance");
            bend1Compliance             = serializedObject.FindProperty("_bend1Compliance");
            bend2Compliance             = serializedObject.FindProperty("_bend2Compliance");
            plasticYield = serializedObject.FindProperty("_plasticYield");
            plasticCreep = serializedObject.FindProperty("_plasticCreep");

            chainConstraintsEnabled = serializedObject.FindProperty("_chainConstraintsEnabled");
            tightness = serializedObject.FindProperty("_tightness");
        }
예제 #2
0
        public override void OnEnable()
        {
            base.OnEnable();
            rod = (ObiRod)target;

            particlePropertyNames.AddRange(new string[] { "Rotational Mass" });
        }
예제 #3
0
 private static void DrawGizmos(ObiRod actor, GizmoType gizmoType)
 {
     Handles.color = Color.white;
     if (actor.rodBlueprint != null)
     {
         ObiPathHandles.DrawPathHandle(actor.rodBlueprint.path, actor.transform.localToWorldMatrix, actor.rodBlueprint.thickness, 20);
     }
 }
예제 #4
0
        static void CreateObiRope()
        {
            GameObject c = new GameObject("Obi Rod");

            Undo.RegisterCreatedObjectUndo(c, "Create Obi Rod");
            ObiRod    rope   = c.AddComponent <ObiRod>();
            ObiCurve  path   = c.AddComponent <ObiCurve>();
            ObiSolver solver = c.AddComponent <ObiSolver>();

            c.AddComponent <ObiRopeExtrudedRenderer>();

            rope.Solver   = solver;
            rope.ropePath = path;
        }