[ODE] triangle collider surface
p.terdiman at wanadoo.fr
Sat May 11 03:44:02 2002
> I can link and run with __forceinline removed from TransformPoint and one
> other function whose name I've now forgotten. There is no logical reason
> for this that I can see, but it works. I guess I'll just hope the
> optimizer is smart enough to inline it anyhow.
I wouldn't bet on this. Try compiling with "Level warning 4" and look for
messages saying it hasn't been inlined.
Else remove TransformPoint from the header and simply copy it (with the
inline) at the top of each CPP using it.
Else check the header has an Include Guard (#ifndef HEADER / #define HEADER
/ #endif), or try a "pragma once" within.
> You should not delete the arrays. They are passed into the tricollider,
> it uses them. If you delete them its pretty 'unsafe'. In other words.. It
> very likely to crash.
I'd like to add I chose the "unsafe" way simply to be memory-efficient. This
was done on purpose after a discussion with Stefan Gottschalk : in RAPID he
consciously kept a copy of user-provided vertices/faces, just to prevent a
lot of bugs such as the one reported here. In the same way I consciously did
the opposite, so that the users can manage vertices/faces the way they want
(sharing them with other processes, storing their indices in words or dwords
as appropriate, depacking their vertices on-the-fly, whatever they like).
Please note that's one of the reason I chose callbacks in the first place :
that way I don't keep user-pointers all around, he's responsible for feeding
Opcode when needed. And if he deletes the arrays, it crashes in user
callbacks so people know they've done something wrong..... :)