Re: [eigen] Bounding Volume Hierarchies |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Bounding Volume Hierarchies
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Wed, 11 Mar 2009 10:09:01 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=aDKpnRaHq2sgAjJcU7QBDkw3juyjn4ndltkkps+vjVk=; b=LjKuLXkusYYDTdIExy699KE97BBECCRyfSXiqOm4TAqQlt/Dgvt/zC4JMvbtGtxdsF sM+MDHioAjv53HeZEDF88ofuv+7ydFZctGvsl2/i1VjqV7b9cIvGJHhwhkvJwfyTBiHg ajLpJu2kG9JcATSROYk7fiCk4rdBkK8UAsS5g=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=h2BdXT8vlfFADwmsasrYQ4SiWAbJ3Q7yIhd46cfs85vbVp63JLOaOkNcWkukAPOmZe DZhmACy0H9scYpMnf67qLWFgq4qjgOv/R6o6buFZtKQnMqBDftb6Erilu4k9/kU0utBn 5bPGla5pBD4Ql8yf2f9sTnRoFJy1sj/FXZ2S4=
ok, I see two options:
options 1:
a.makeUnion(b);
a.makeIntersection(b);
if (a.intersects(b)) blabla;
option 2:
a.unite(b);
a.intersect(b);
if (a.isIntersecting(b)) blabla;
any preference ? (I vote for opt. 2)
gael.
On Fri, Mar 6, 2009 at 10:03 PM, Ilya Baran <baran37@xxxxxxxxx> wrote:
> I think that "AlignedBox &intersect" vs. "bool intersects" would
> usually be OK: it should be clear from the context which is intended
> and because AlignedBox is not implicitly convertible to bool,
> accidentally overwriting a box is likely to be caught by the compiler.
> That still leaves room for the following bug (for which existing
> compilers, I guess, wouldn't issue a warning):
>
> a.intersects(b); //this has no effect: a.intersect(b) was intended
>
> If you think this is a problem, perhaps "overlaps" should be the
> predicate? (although that's also somehow nonstandard).
>
> -Ilya
>
> On Fri, Mar 6, 2009 at 3:42 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
>>> "union" and "intersection" are the obvious choices, "unite" is good
>>> too. However, "intersect" is confusing because in my brain it would
>>> return true or false whether the two boxes intersect or not. This is
>>> why I used "clamp". There is also "crop" , yeah, I know that's not
>>> better... (about unite vs extend, that's because I did not thought
>>> about unite)
>>>
>>> gael
>>
>> Ah yes, right. Well, in proper english, that would be "intersects" but
>> I agree that this little s is a too small difference...
>>
>> Benoit
>>
>>
>>
>
>
>