aabb merge, picked compare

This commit is contained in:
turanszkij
2016-06-18 21:27:13 +02:00
parent 366e5f163c
commit 4ce22a9ca2
4 changed files with 17 additions and 1 deletions
+4
View File
@@ -2215,6 +2215,10 @@ AABB AABB::operator* (float a)
max.z*=a;
return AABB(min,max);
}
AABB AABB::Merge(const AABB& a, const AABB& b)
{
return AABB(wiMath::Min(a.getMin(), b.getMin()), wiMath::Max(a.getMax(), b.getMax()));
}
#pragma endregion
#pragma region SPHERE
+1
View File
@@ -261,6 +261,7 @@ struct AABB{
bool intersects(const XMFLOAT3& p) const;
bool intersects(const RAY& ray) const;
AABB operator* (float a);
static AABB Merge(const AABB& a, const AABB& b);
};
struct SPHERE{
float radius;
+11
View File
@@ -455,6 +455,17 @@ public:
SAFE_INIT(light);
SAFE_INIT(decal);
}
// Subset index, position, normal, distance don't distinguish between pickeds!
bool operator==(const Picked& other)
{
return
transform == other.transform &&
object == other.object &&
light == other.light &&
decal == other.decal
;
}
};
// Pick closest object in the world
+1 -1
View File
@@ -7,7 +7,7 @@ namespace wiVersion
// minor features, major bug fixes
const int minor = 8;
// minor bug fixes, alterations, refactors
const int revision = 13;
const int revision = 14;
long GetVersion()