sead
Loading...
Searching...
No Matches
seadSphere.h
Go to the documentation of this file.
1#ifndef SEAD_SPHERE_H_
2#define SEAD_SPHERE_H_
3
4#include <math/seadVector.h>
5
6namespace sead {
7
8template <typename VectorType>
9class Sphere
10{
11public:
12 typedef typename VectorType::ValueType T;
13
14public:
16 : mCenter(VectorType::zero)
17 , mRadius(0.0f)
18 {
19 }
20
21 Sphere(const VectorType& center, T radius)
22 {
23 mCenter.set(center);
24 mRadius = radius;
25 }
26
27 const VectorType& getCenter() const { return mCenter; }
28 T getRadius() const { return mRadius; }
29
30 void setCenter(const VectorType& center)
31 {
32 mCenter.set(center);
33 }
34
35 void setRadius(T radius)
36 {
37 mRadius = radius;
38 }
39
40private:
41 VectorType mCenter;
43};
44
47
48#ifdef cafe
49static_assert(sizeof(Sphere2f) == 0xC, "sead::Sphere<T> size mismatch");
50static_assert(sizeof(Sphere3f) == 0x10, "sead::Sphere<T> size mismatch");
51#endif // cafe
52
53} // namespace sead
54
55#endif // #define SEAD_SPHERE_H_
Definition seadSphere.h:10
void setRadius(T radius)
Definition seadSphere.h:35
Sphere(const VectorType &center, T radius)
Definition seadSphere.h:21
const VectorType & getCenter() const
Definition seadSphere.h:27
T mRadius
Definition seadSphere.h:42
VectorType::ValueType T
Definition seadSphere.h:12
Sphere()
Definition seadSphere.h:15
T getRadius() const
Definition seadSphere.h:28
VectorType mCenter
Definition seadSphere.h:41
void setCenter(const VectorType &center)
Definition seadSphere.h:30
Definition seadAssert.h:44
Sphere< Vector2f > Sphere2f
Definition seadSphere.h:45
Vector2< f32 > Vector2f
Definition seadVector.h:238
Sphere< Vector3f > Sphere3f
Definition seadSphere.h:46
Vector3< f32 > Vector3f
Definition seadVector.h:239