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:35:15 +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=OAeLH85CIdO95gaRHD9XCdgrmS33PZ+Bi6Lv39EuWmc=; b=n9K4bHoqGTxKY4jIK7Bpo37KNSF0mBybdJgiXYQRnKnyPOkBjsb0vTl2PGm+bx7eeH FqFFlfgPMmRV2TPVfRWoOJWf+0WgI619pE/0H4LeTbH1MzywzHKWOv4CIarFps1C/tcu 5tH4lehAHA2kYB0joNylvO+L5SNXECXga4CgA=
- 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=BtXrNb2TM/akx2mlpruXRw5pMnscN3inJcRWGRx7rdQzwPDTG8EJLaCZv9Kb8TXVWZ UUb44rvz6OWZY33RSgyWNQkMUXDq7jxs5JNpNA9fsTApwKOHIi34mr+Gg1k8Y2A1DtGZ UQM+VbogDOxAUsym7Upzdt93OjrLCLj4v28zM=
hm, there is another problem the choice of "union" as a replacement of
operator| is of course not possible (union is a keyword). It's getting
hard to have a consistent naming scheme, at least using operators &,
|, &=, and |= would solve all these issues, so perhaps it is still
worth reconsidering them ?
On Wed, Mar 11, 2009 at 10:09 AM, Gael Guennebaud
<gael.guennebaud@xxxxxxxxx> wrote:
> 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
>>>
>>>
>>>
>>
>>
>>
>