[ODE] Ray - Cylinder collider submission

Jose Marin jose_marin2 at yahoo.com.br
Thu Jun 29 08:44:46 MST 2006


This is great!

Any chance of a Cylinder-Cylinder collider soon?

--- David Walters <hidden.asbestos at googlemail.com>
escreveu:

> > Thanks for this! I will get it into svn shortly.
> 
> Excellent.
> 
> One thing I've spotted is the rather untidy code at
> around line 117 of
> my ray.cpp.
> 
> I tidier solution is:
> 
> -------
> // Check if the ray lies completely inside or
> outside the cylinder.
> if ( ( ( uv > 0 ) && ( d + ( uvsign * ray->length )
> < half_length *
> internal ) ) ||
>    ( ( uv < 0 ) && ( d + ( uvsign * ray->length ) >
> half_length * internal ) ) )
> {
>   return 0; // No intersection with caps or curved
> surface.
> }
> 
> // Compute depth (distance from ray to cylinder)
> contact->depth = ( ( -uvsign * d ) - ( internal *
> half_length ) );
> -------
> 
> It's not really important to make this change, as I
> guess the first
> step in any development should be initial support
> for a feature, then
> bug fixing, then optimisation... but still, it
> seemed too messy to
> leave it without saying anything: - )
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
> 


__________________________________________________
Fale com seus amigos  de graça com o novo Yahoo! Messenger 
http://br.messenger.yahoo.com/ 


More information about the ODE mailing list