Exemple #1
0
bool Camera::InView(const vec3f& p, float radius) const {
	const vec3f t = (p - pos);

	return
		(t.dot3D(frustumR) < radius) &&
		(t.dot3D(frustumL) < radius) &&
		(t.dot3D(frustumB) < radius) &&
		(t.dot3D(frustumT) < radius);
}
Exemple #2
0
bool Camera::AABBInOriginPlane(const vec3f& plane, const vec3f& mins, const vec3f& maxs) const {
	vec3f fp;
		fp.x = (plane.x > 0.0f)? mins.x: maxs.x;
		fp.y = (plane.y > 0.0f)? mins.y: maxs.y;
		fp.z = (plane.z > 0.0f)? mins.z: maxs.z;
	return (plane.dot3D(fp - pos) < 0.0f);
}