Ray cast and joint library.dll crash !

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Ray cast and joint library.dll crash !

Postby izissise » Mon Aug 02, 2010 7:30 am

Hello,

I have some problem with ray cast , it grab well, but when i release the joint sometime joint library.dll crash !maybe because newtonupdate is in another thread....

Here my code :

To pick :
Code: Select all
///variable globale pour les fonction de picking
static NewtonBody* pickedBody = NULL;
static CPhysique* class_body = NULL;

static float pickedParam = 1.0f;
static dVector rayLocalNormal;
static bool isPickedBodyDynamics;
static dVector attachmentPoint;
static NewtonUserJoint* bodyPickController;
static bool mousePickMode = false;
///


CPhysique* MousePick(NewtonWorld* nWorld,int x,int y,bool create_joint)
{


    dVector p0 (ScreenToWorld(dVector (x, y, 0.0f, 0.0f)));
    dVector p1 (ScreenToWorld(dVector (x, y, 1.0f, 0.0f)));


    class_body = NULL;

    NewtonWorldRayCast(nWorld, &p0[0], &p1[0], RayCastFilter, NULL, get_pointeur_class); //raycastfilter nous donne le body


    if (pickedBody&&create_joint)
    {
        dMatrix matrix;

        mousePickMode = true;

        NewtonBodyGetMatrix(pickedBody, &matrix[0][0]);
        dVector p (p0 + (p1 - p0).Scale (pickedParam));

        attachmentPoint = matrix.UntransformVector (p);

        // convert normal to local space
        rayLocalNormal = matrix.UnrotateVector(rayLocalNormal);

        // Create PickBody Joint
        bodyPickController = CreateCustomKinematicController (pickedBody, &p[0]);

        CustomKinematicControllerSetPickMode (bodyPickController, 1);
        CustomKinematicControllerSetMaxAngularFriction (bodyPickController, MAX_FRICTION_ANGULAR_GRAVITY);
        CustomKinematicControllerSetMaxLinearFriction (bodyPickController, MAX_FRICTION_LINEAR_ACCELERATION);

    }

    if(pickedBody)
    {
        return class_body;
    }
    else
    {
        return NULL;
    }



}


To release pick:

Code: Select all
void realese_picking(newtworld* world)
{
    if(mousePickMode)
    {
        if (pickedBody)
        {
            CustomKinematicControllerSetPickMode (bodyPickController, 0); //I don't really understand what these three line does ...
            CustomKinematicControllerSetMaxAngularFriction (bodyPickController, 10.0f);
            CustomKinematicControllerSetMaxLinearFriction (bodyPickController, MAX_FRICTION_LINEAR_ACCELERATION);


            if (bodyPickController)
            {
                CustomDestroyJoint (bodyPickController);
            }
            bodyPickController = NULL;
        }

        mousePickMode = false;
    }

}



Here the crash code of windows :
Nom d’événement de problème: APPCRASH
Nom de l’application: 34.exe
Version de l’application: 0.0.0.0
Horodatage de l’application: 4c56aa6d
Nom du module par défaut: JointLibrary.dll
Version du module par défaut: 0.0.0.0
Horodateur du module par défaut: 4a8436c9
Code de l’exception: c0000005
Décalage de l’exception: 00017ea8
Version du système: 6.1.7600.2.0.0.256.1
Identificateur de paramètres régionaux: 1036
Information supplémentaire n° 1: 0a9e
Information supplémentaire n° 2: 0a9e372d3b4ad19135b953a78882e789
Information supplémentaire n° 3: 0a9e
Information supplémentaire n° 4: 0a9e372d3b4ad19135b953a78882e789


Thank you to read me !
izissise
 
Posts: 23
Joined: Sat Jul 24, 2010 8:20 am

Re: Ray cast and joint library.dll crash !

Postby Julio Jerez » Mon Aug 02, 2010 9:10 am

put a break point in the destrucotr and see if it call it. Or if it call a different operator delete.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Ray cast and joint library.dll crash !

Postby izissise » Mon Aug 02, 2010 2:48 pm

So it stop at the break point at CustomDestroyJoint(bodyPickController); but the debugger received a Segmentation fault in JointLibrary!?SubmitConstraints@NewtonCustomJoint@@CAXPBUNewtonJoint@@MH@Z()
izissise
 
Posts: 23
Joined: Sat Jul 24, 2010 8:20 am

Re: Ray cast and joint library.dll crash !

Postby izissise » Thu Aug 05, 2010 6:32 am

?? It's been three day !
izissise
 
Posts: 23
Joined: Sat Jul 24, 2010 8:20 am

Re: Ray cast and joint library.dll crash !

Postby Julio Jerez » Thu Aug 05, 2010 9:39 am

I do not know what could that be, Ther is no reason fo eth engoien to crash in the constom joints.
can you link teh libary statically maybe you can see where crash happens?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Ray cast and joint library.dll crash !

Postby izissise » Thu Aug 05, 2010 5:46 pm

If you want I can upload the project ...
izissise
 
Posts: 23
Joined: Sat Jul 24, 2010 8:20 am

Re: Ray cast and joint library.dll crash !

Postby Julio Jerez » Thu Aug 05, 2010 6:00 pm

ok,
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Ray cast and joint library.dll crash !

Postby izissise » Thu Aug 05, 2010 6:34 pm

http://www.megaupload.com/?d=ILFBL1M4

The file is too large to be upload on the forum so i upload it on megaupload !

The picking function are in fonction2.cpp
-Press s or e to switch between space and earth simulation
-Press space to add cube !
izissise
 
Posts: 23
Joined: Sat Jul 24, 2010 8:20 am

Re: Ray cast and joint library.dll crash !

Postby izissise » Sun Aug 15, 2010 7:08 am

So do you find the problem ?
izissise
 
Posts: 23
Joined: Sat Jul 24, 2010 8:20 am

Re: Ray cast and joint library.dll crash !

Postby Julio Jerez » Sun Aug 15, 2010 11:39 am

I can not download the file.
It ask for a password, and I type it, the it take me back to teh download again, and each time the wait time increase it.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Ray cast and joint library.dll crash !

Postby izissise » Sun Aug 15, 2010 12:50 pm

For me it work great.......

so where i can upload it ?
izissise
 
Posts: 23
Joined: Sat Jul 24, 2010 8:20 am

Re: Ray cast and joint library.dll crash !

Postby Stucuk » Sun Aug 15, 2010 12:51 pm

Its a badly designed site. Basically you have to enter a capacha and then wait for about 50 seconds. Then it will say "Regular Download", which you then click. So you don't have to deal with Mega Upload's horrible website i have uploaded the guys file to http://www.stucuk.net/Newton project.rar for you so you can get a direct download.
User avatar
Stucuk
 
Posts: 801
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Re: Ray cast and joint library.dll crash !

Postby izissise » Sun Aug 15, 2010 1:33 pm

Thank you stucuk , I know megaupload is evil but it is the only one has not to remove file after a while....
izissise
 
Posts: 23
Joined: Sat Jul 24, 2010 8:20 am

Re: Ray cast and joint library.dll crash !

Postby Julio Jerez » Sun Aug 15, 2010 3:07 pm

is Newton project.cbp a code block project? this is all source code
can you make and EXE that link to the netwon DLL, I do not use code project.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Ray cast and joint library.dll crash !

Postby izissise » Sun Aug 15, 2010 4:03 pm

So I compiled a release version and the something strange happen with so i join you also the debug version to compare I don't join the texture so just add two png file named 1 and 2, I want also to say: all the cube have a mass but you'll see if you compare the two version.

So good luck to find the problem and thank you !!

http://www.fufox.com/?d=217562C6194A

ps: I hope this time you succeed to download the file !
izissise
 
Posts: 23
Joined: Sat Jul 24, 2010 8:20 am

Next

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 4 guests