sead
Loading...
Searching...
No Matches
seadLine.h
Go to the documentation of this file.
1#ifndef SEAD_LINE_H_
2#define SEAD_LINE_H_
3
4#include <math/seadVector.h>
5
6namespace sead {
7
8template <typename VectorType>
9class Segment
10{
11public:
12 typedef typename VectorType::ValueType T;
13
14public:
16 : mP0(VectorType::zero)
17 , mP1(VectorType::ex)
18 {
19 }
20
21 Segment(const VectorType& p0, const VectorType& p1)
22 : mP0(p0)
23 , mP1(p1)
24 {
25 }
26
27 const VectorType& getPos0() const
28 {
29 return mP0;
30 }
31
32 void setPos0(const VectorType& p0)
33 {
34 mP0 = p0;
35 }
36
37 const VectorType& getPos1() const
38 {
39 return mP1;
40 }
41
42 void setPos1(const VectorType& p1)
43 {
44 mP1 = p1;
45 }
46
47private:
48 VectorType mP0;
49 VectorType mP1;
50};
51
54
55#ifdef cafe
56static_assert(sizeof(Segment2f) == 0x10, "sead::Segment<T> size mismatch");
57static_assert(sizeof(Segment3f) == 0x18, "sead::Segment<T> size mismatch");
58#endif // cafe
59
60} // namespace sead
61
62#endif // #define SEAD_LINE_H_
Definition seadLine.h:10
Segment(const VectorType &p0, const VectorType &p1)
Definition seadLine.h:21
Segment()
Definition seadLine.h:15
void setPos0(const VectorType &p0)
Definition seadLine.h:32
VectorType mP1
Definition seadLine.h:49
const VectorType & getPos1() const
Definition seadLine.h:37
VectorType mP0
Definition seadLine.h:48
VectorType::ValueType T
Definition seadLine.h:12
void setPos1(const VectorType &p1)
Definition seadLine.h:42
const VectorType & getPos0() const
Definition seadLine.h:27
Definition seadAssert.h:44
Vector2< f32 > Vector2f
Definition seadVector.h:238
Vector3< f32 > Vector3f
Definition seadVector.h:239
Segment< Vector3f > Segment3f
Definition seadLine.h:53
Segment< Vector2f > Segment2f
Definition seadLine.h:52