[ODE] New stuff

Erwin de Vries erwin at vo.com
Wed Sep 4 03:00:03 2002


> >> - opcode 1.2 wraps the Point and other math classes in a IceMath
namespace.  you assume they are in the Opcode namespace.
> > But what is the problem here?
>
> i made a mistake. this is not a problem.
>
> >> - dRay.cpp: dGeomRayGet/Set() use " * 4" instead of " * 3" on the
Rotation[] matrix and cause illegal access violations
> >
> > I dont think the * 4 is an error. What i did to fix it is this:
> > Right[3] = REAL(0.0);
> > Up[3] = REAL(0.0);
> > Direction[3] = REAL(0.0);
> >
> > Now it is fine.
>
> not sure i understand what to change. the 4x3 matrix has 12 entries.  in
dGeomRaySet/Get...
>
> Rotation[3 * 4 + 0] = REAL(0.0);  <<-- illegal access
> Rotation[3 * 4 + 1] = REAL(0.0);  <<-- illegal access
> Rotation[3 * 4 + 2] = REAL(0.0);  <<-- illegal access
> Direction[3] = Rotation[3 * 4 + 2];  <<-- illegal access

You can comment these lines out.

> > If you're using the vertexstride; could you tell me if it really works
as desired? (Strided indices dont work yet, and strided vertices arent
really tested as well)
>
> In Include/dTriList.h...
>
> ---
> /* Setting data */
> void dGeomTriListBuild(dGeomID g, const dcVector3* Vertices, int
VertexStide, int VertexCount, const int* Indices, int IndexStride, int
indexCount, int TriStride);
>
> /*struct StridedVertex{
>         dcVector3 Vertex;
>         // Userdata
> };
>
> int VertexStride = sizeof(StridedVertex);
>
> struct StridedTri{
>         struct StridedIndex{
>                 int Index;
>                 // Userdata
>         };
>         StridedIndex Indices[3];
>         // Userdata
> };
>
> int IndexStride = sizeof(StridedIndex);
> int TriStride = sizeof(StridedTri);*/
> ---
>
> Why do you need TriStride?

It would be useful to store per-triangle data in it, such as a material, or
whatever.

>You only need the offset to the next index or vertex.  IndexStride and
VertexStride are sufficient.

I thought it would be nice to be able to store data per vertex, index AND
triangle. But it doesnt work yet.. :-(

>Also, since if VertexStride != sizeof(dcVector3) you do a copy to match
opcode, it doesn't seem worth using.  Do you really need the array copy now
that you have callbacks into opcode instead of pointers?

Look more closely. This copy is allocated in stack memory, meaning it will
be gone when dcGeomTriListBuild() returns. It is only needed to generate the
trees in Opcode.

> I should also remark that you have two versions of dTriList.h in the zip.
one in the Include folder and an old out-of-date one in the main folder for
dTriList.

Yikes..

Erwin