MotherShip.PitchFor C# (CSharp) 메소드

PitchFor() 공개 메소드

public PitchFor ( Planet, p ) : float
p Planet,
리턴 float
    public float PitchFor(Planet p)
    {
        Vector3 zero = Vector3.Cross (this.transform.right, (this.transform.position - p.transform.position));
        float pitchAngle = Vector3.Angle (this.transform.forward, zero);
        if (Vector3.Dot (this.transform.up, zero) < 0) {
            pitchAngle = - pitchAngle;
        }
        return pitchAngle;
    }