40 void set(
const mat4& invViewProj);
42 void set(
const bbox& box,
const mat4& boxTransform);
54 template<
typename T> T
as()
const;
83 this->
set(invViewProj);
108 for (i = 0; i < 8; i++)
110 vec4 p = invViewProj * projPoints[i];
112 worldPoints[i] =
xyz(p);
135 for (i = 0; i < 8; i++)
150 worldPoints[i] =
xyz(boxTransform * localPoint);
232 uint andFlags = 0xffff;
236 for (i = 0; i < 8; i++)
242 case 0: p = box.
pmin;
break;
246 case 4: p = box.
pmax;
break;
254 andFlags &= clipMask;
269 uint andFlags = 0xffff;
271 vec4 localPoint, transformedPoint;
273 for (i = 0; i < 8; i++)
279 case 0: localPoint = box.
pmin;
break;
283 case 4: localPoint = box.
pmax;
break;
290 transformedPoint = boxTransform * localPoint;
294 andFlags &= clipMask;
Type
Definition clipstatus.h:22
@ Outside
Definition clipstatus.h:24
@ Inside
Definition clipstatus.h:23
@ Clipped
Definition clipstatus.h:25
Nebula's bounding box class.
Definition bbox.h:24
point pmax
Definition bbox.h:93
point pmin
Definition bbox.h:92
Defines a clipping frustum made of 6 planes.
Definition frustum.h:20
static const int BottomLeftFar
Definition frustum.h:58
ClipStatus::Type clip(const line &l, line &clippedLine) const
clip line against view frustum
Definition frustum.h:203
bool inside(const point &p) const
test if point is inside frustum
Definition frustum.h:167
static const int BottomRightFar
Definition frustum.h:59
static const int TopLeftFar
Definition frustum.h:56
ClipStatus::Type clipstatus(const bbox &box) const
get clip status of a local bounding box
Definition frustum.h:230
static const int BottomLeftNear
Definition frustum.h:62
static const int TopRightNear
Definition frustum.h:61
void set(const mat4 &invViewProj)
setup from view and proj matrix
Definition frustum.h:92
static const int TopLeftNear
Definition frustum.h:60
T as() const
convert to any type
PlaneIndex
plane indices
Definition frustum.h:24
@ Right
Definition frustum.h:28
@ Top
Definition frustum.h:29
@ Left
Definition frustum.h:27
@ NumPlanes
Definition frustum.h:32
@ Bottom
Definition frustum.h:30
@ Far
Definition frustum.h:26
@ Near
Definition frustum.h:25
static const int BottomRightNear
Definition frustum.h:63
plane planes[NumPlanes]
Definition frustum.h:65
frustum()
default constructor
Definition frustum.h:72
uint clipmask(const point &p) const
get clip bitmask of point (0 if inside, (1<<PlaneIndex) if outside)
Definition frustum.h:185
static const int TopRightFar
Definition frustum.h:57
A line in 3d space.
Definition line.h:22
Different curves.
Definition angularpfeedbackloop.h:17
__forceinline scalar dot(const plane &p, const vec4 &v1)
Definition plane.h:246
ClipStatus::Type clip(const plane &plane, const line &l, line &outClippedLine)
Definition plane.h:208
__forceinline vec3 xyz(const point &v)
Definition point.h:528
A 4x4 single point precision float matrix.
Definition mat4.h:49
A mathematical plane represented by a normal and a distance from origin.
Definition plane.h:22
Represents a 3D point in space.
Definition point.h:22
void set(scalar x, scalar y, scalar z)
set content
Definition point.h:332
float z
Definition point.h:78
float x
Definition point.h:78
float y
Definition point.h:78
A 3D vector.
Definition vec3.h:40
A 4D vector.
Definition vec4.h:24
float w
Definition vec4.h:93
void set(scalar x, scalar y, scalar z, scalar w)
set content
Definition vec4.h:301
unsigned int uint
Definition types.h:31
int IndexT
Definition types.h:48