aabb merge, picked compare
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user