예제 #1
0
void AABB::SetFrom(const Sphere &s)
{
	vec d = DIR_VEC_SCALAR(s.r);
	minPoint = s.pos - d;
	maxPoint = s.pos + d;
}
예제 #2
0
bool AABB::Contains(const Sphere &sphere) const
{
	return Contains(sphere.pos - DIR_VEC_SCALAR(sphere.r), sphere.pos + DIR_VEC_SCALAR(sphere.r));
}
예제 #3
0
void AABB::Enclose(const Sphere &sphere)
{
	vec d = DIR_VEC_SCALAR(sphere.r);
	Enclose(sphere.pos - d, sphere.pos + d);
}
예제 #4
0
void AABB::Enclose(const Capsule &capsule)
{
	vec d = DIR_VEC_SCALAR(capsule.r);
	minPoint = Min(minPoint, Min(capsule.l.a, capsule.l.b) - d);
	maxPoint = Max(maxPoint, Max(capsule.l.a, capsule.l.b) + d);
}
예제 #5
0
void OBB::Scale(const vec &centerPoint, float scaleFactor)
{
	return Scale(centerPoint, DIR_VEC_SCALAR(scaleFactor));
}