|
resonance 1.0.1
|
Bounding sphere. More...
#include <sphere.h>

Public Member Functions | |
| Sphere & | GrowToContain (const Sphere &other) |
| Grow this sphere to the smallest sphere that encloses both it and other. | |
Static Public Member Functions | |
| static Sphere | Circumscribe (const Vector3 &first, const Vector3 &second) |
| Build the sphere whose diameter is the segment between two points. | |
| static Sphere | Circumscribe (const Vector3 &first, const Vector3 &second, const Vector3 &third) |
| Build the sphere through three points, as the binary computes it. | |
| static Sphere | Circumscribe (const Vector3 &first, const Vector3 &second, const Vector3 &third, const Vector3 &fourth) |
| Build the sphere through four points. | |
Public Attributes | |
| Vector3 | mCenter |
| float | mRadius |
Bounding sphere.
The class is not polymorphic and emits no RTTI descriptor, so the name is inferred. Its text dump writes the two members under the labels "\n\tcenter:" and " radius:".
The centre is quadword aligned on the PlayStation 2, which gives the whole structure 16-byte alignment and a size of 0x20 bytes. Rnd::Mesh::CopyFrom() relies on that size and moves the sphere as two quadwords.
Grow this sphere to the smallest sphere that encloses both it and other.
A zero-radius other changes nothing, and neither does an other already inside this sphere. This sphere becomes other when other encloses it. A distinct centre otherwise places the new centre halfway between the two far points along the line of the centres. The shipped program does not call it, and the name is inferred.
| other | The sphere to enclose. |
Build the sphere whose diameter is the segment between two points.
The shipped program does not call it, and the name is inferred.
| first | One end of the diameter. |
| second | The other end. |
|
static |
Build the sphere through three points, as the binary computes it.
The centre is where the plane of the triangle, the bisector plane of the first two points, and a third plane meet. The third plane is the same bisector again rather than the bisector of the first and third points, and the radius is the distance from the first point. The result is the circumscribed sphere only by accident. The shipped program does not call it, and the name is inferred.
| first | The first point. |
| second | The second point. |
| third | The third point. |
|
static |
Build the sphere through four points.
The centre is where the bisector planes of the first point with each of the other three meet, and the radius is the distance from the first point. The shipped program does not call it, and the name is inferred.
| first | The first point. |
| second | The second point. |
| third | The third point. |
| fourth | The fourth point. |
| Vector3 Sphere::mCenter |
| float Sphere::mRadius |