| | |
| | | |
| | | if (end.x > start.x) |
| | | { |
| | | _centerX = (end.x - start.x) * .5f + _width * .5f; |
| | | _centerX = (end.x * .5f - start.x * .5f) * .5f + start.x * .5f; |
| | | } |
| | | else |
| | | { |
| | | _centerX = (end.x - start.x) * .5f - _width * .5f; |
| | | _centerX = (end.x * .5f - start.x * .5f) * .5f + end.x * .5f; |
| | | } |
| | | |
| | | if (end.z > start.z) |
| | | { |
| | | _centerZ = (end.z - start.z) * .5f + _length * .5f; |
| | | _centerZ = (end.z * .5f - start.z * .5f) * .5f + start.z * .5f; |
| | | } |
| | | else |
| | | { |
| | | _centerZ = (start.z - end.z) * .5f - _length * .5f; |
| | | _centerZ = (start.z * .5f - end.z * .5f) * .5f + end.z * .5f; |
| | | } |
| | | |
| | | |