コード例 #1
0
    private void UpdateLayout(GraphSceneComponents sceneComponents, float time)
    {
        float sphRadius             = GraphRenderer.Singleton.nodePhysXForceSphereRadius;
        float sphRadiusSqr          = sphRadius * sphRadius;
        float intendedLinkLengthSqr = GraphRenderer.Singleton.linkIntendedLinkLength * GraphRenderer.Singleton.linkIntendedLinkLength;
        bool  repulseActive         = GraphRenderer.Singleton.RepulseActive;

        foreach (var n in sceneComponents.nodeComponents)
        {
            doGravity(n.Rb);
            if (repulseActive)
            {
                doRepulse(n.Rb, n.aoundColliders, sphRadiusSqr);
            }
        }

        foreach (var e in sceneComponents.edgeComponents)
        {
            doAttraction(e.sourceRb, e.targetRb, intendedLinkLengthSqr);
        }
    }
コード例 #2
0
 public ForceDirectedGraphLayout(GraphSceneComponents sceneComponents)
 {
     this.sceneComponents = sceneComponents;
 }
コード例 #3
0
 public AbstractGraphLayout(GraphSceneComponents sceneComponents)
 {
     this.sceneComponents = sceneComponents;
 }
コード例 #4
0
 protected abstract void UpdateGraphLayout(GraphSceneComponents sceneComponents, float time);