Exemple #1
0
    /// <summary>
    /// Sets up a toric manifold object with alpha, theta and phi.
    /// </summary>
    /// <remarks>
    /// alpha [ 1 - 180]°
    /// theta [ 1 - 2 * (180-alpha)]°
    ///  phi [ -180 - 180]°
    /// </remarks>
    /// <param name="alpha"> alpha</param>
    /// <param name="theta"> theta</param>
    /// <param name="phi"> phi</param>
    /// <param name="target1"> the first, left-most target</param>
    /// <param name="target2">the second target</param>
    public Toricmanifold(float alpha, float theta, float phi, GameObject target1, GameObject target2)
    {
        _target1 = target1;
        _target2 = target2;
        A        = _target1.transform.position;
        B        = _target2.transform.position;
        vecAB    = B - A;

        _alpha = new FixAngle(alpha);
        _phi   = new FixAngle(phi);
        theta  = Mathf.Clamp(theta, 1, getMaxTheta());
        _theta = new FixAngle(theta);

        _mainCamera = Camera.main;
    }
Exemple #2
0
    private Quaternion computeTiltAngle(float tilt)
    {
        FixAngle phi = new FixAngle(tilt);

        return(Quaternion.AngleAxis(phi.angle(), _mainCamera.transform.forward));
    }