[ODE] GIMPACT / double precision

Remi Ricard remi.ricard at simlog.com
Fri Nov 2 06:53:42 MST 2007


Hi,
> Hi, GIMPACT is not currently supported when building ODE in double 
> precision - does anybody know what might be involved in getting it 
> working? I'm more interested in getting ODE working with extra precision 
> and wouldn't be too bothered if GIMPACT was operating in floating point.
>   

What I did is to leave gimpact in float and use ODE in double and write 
maybe 4 functions used as proxy that will do the conversion between 
gimpact and ODE.

Ex:

/// Copy an gimpact vec3f to a ODE dVector3d:   dVector3[i] = vec3f[i]
#define dVECTOR3_VEC3F_COPY(b,a) \
{                                \
   (b)[0] = (a)[0];              \
   (b)[1] = (a)[1];              \
   (b)[2] = (a)[2];              \
   (b)[3] = 0;                   \
}\

void GimFetchTriangle(GIM_TRIMESH * trimesh, GUINT triangle_index, 
dVector3 v1, dVector3 v2, dVector3 v3)
{
    vec3f * transformed_vertices = 
GIM_BUFFER_ARRAY_POINTER(vec3f,trimesh->m_transformed_vertex_buffer,0);

    GUINT * triangle_indices = 
GIM_BUFFER_ARRAY_POINTER(GUINT,trimesh->m_tri_index_buffer,triangle_index*3);

    //Copy the vertices
        dVECTOR3_VEC3F_COPY(v1, transformed_vertices[triangle_indices[0]]);
        dVECTOR3_VEC3F_COPY(v2, transformed_vertices[triangle_indices[1]]);
        dVECTOR3_VEC3F_COPY(v3, transformed_vertices[triangle_indices[2]]);
}

and In collision_trimesh_box.cpp
        //gim_trimesh_get_triangle_vertices(ptrimesh, 
Triint,dv[0],dv[1],dv[2]);
        GimFetchTriangle(ptrimesh, Triint,dv[0],dv[1],dv[2]);

 

Remi
> Cheers,
> Mark
> _______________________________________________
> ODE mailing list
> ODE at ode.org
> http://ode.org/mailman/listinfo/ode
>
>   



More information about the ODE mailing list