Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F633579
frustum.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
frustum.h
View Options
#pragma once
#include
"plane.h"
#include
"line3d.h"
#include
"aabbox.h"
struct
frustum
{
//Planes are: Near, Left, Right, Top, Bottom, Far
planed
planes
[
6
];
AABBoxd
bound
;
frustum
()
{}
frustum
(
const
line3dd
&
topLeft
,
const
line3dd
&
topRight
,
const
line3dd
&
botLeft
,
const
line3dd
&
botRight
)
{
planes
[
0
]
=
planed
(
topLeft
.
start
,
botLeft
.
start
,
topRight
.
start
);
planes
[
1
]
=
planed
(
topLeft
.
start
,
topLeft
.
end
,
botLeft
.
start
);
planes
[
2
]
=
planed
(
topRight
.
end
,
topRight
.
start
,
botRight
.
start
);
planes
[
3
]
=
planed
(
topLeft
.
start
,
topRight
.
start
,
topRight
.
end
);
planes
[
4
]
=
planed
(
botRight
.
start
,
botLeft
.
start
,
botRight
.
end
);
planes
[
5
]
=
planed
(
topLeft
.
end
,
topRight
.
end
,
botLeft
.
end
);
bound
.
reset
(
topLeft
);
bound
.
addLine
(
topRight
);
bound
.
addLine
(
botLeft
);
bound
.
addLine
(
botRight
);
}
void
operator
=
(
const
frustum
&
other
)
{
memcpy
(
this
,
&
other
,
sizeof
(
frustum
));
}
bool
overlaps
(
const
vec3d
&
center
,
double
radius
)
const
{
for
(
unsigned
i
=
0
;
i
<
6
;
++
i
)
if
(
planes
[
i
].
distanceFromPlane
(
center
)
<=
-
radius
)
return
false
;
return
true
;
}
};
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sun, Nov 15, 5:13 PM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
152502
Default Alt Text
frustum.h (1 KB)
Attached To
Mode
R80 StarRuler2-Source
Attached
Detach File
Event Timeline