|
|
|
|
|
|
var angleA = settings.spotAngle.floatValue * Mathf.Deg2Rad; |
|
|
|
|
|
|
|
var halfAngle = angleA * 0.5f; // half of the smallest angle
|
|
|
|
var length = Mathf.Sin(halfAngle); // half length of the smallest side of the rectangle
|
|
|
|
var length = Mathf.Tan(halfAngle); // half length of the smallest side of the rectangle
|
|
|
|
length *= aspectRatio; // half length of the bigest side of the rectangle
|
|
|
|
halfAngle = Mathf.Atan(length); // half of the bigest angle
|
|
|
|
|
|
|
|