div / 0 in BuildJacobianMatrix

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Thu Sep 18, 2014 2:52 pm

it use critical section because newton is a multithreaded engine.
that function write to the body so to be save is belter to prevent other functions from use that body.

it turn out that in that example is no necessary, however if you run the engine on a separate thread then It may be that some other thread be try to read for a body that is being modified.

you can comment out the call.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Thu Sep 18, 2014 2:54 pm

Ok thanks.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Thu Sep 18, 2014 5:35 pm

arg :/ I can't add the callback directly to the script code. I should manage the threading everywhere.
I'l make this another way with a listener on body. but the mouse informations will be taken only one time per render frame.

can we check the scaling issue and go back on this later ? I'll have to think more on this.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Thu Sep 18, 2014 5:57 pm

F5 : (slow in debug) you can grab closes objects with mouse click
the right glass door have continuous collision enable
when you rush into it the bad thing happen ^^
t


what is the bad thing?
can you make a build that does no render all that debug wire frame stuff, it Is unplayable?

what do you mean rush into it, just walking into the door?
I see tow doors one is partially open, but is so slow that I do not know what is going on.
Make a build without debug lines.

also all newton call back are called from a separate thread, so if you can deal with force and torque and joint callback, the you can deal with the pre and post listener.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Thu Sep 18, 2014 6:25 pm

Yes just walking with the shift key int the doors.

to hide the lines edit the file partition\tools\os3dlib\v3dlib_physics.pkg
and comment the line 279
V3DphysShowDebug sessionstr 1;


Yes i'm dealing with forces with an another way. the values are setted in the main thread, and applied in the callback.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Thu Sep 18, 2014 6:58 pm

I did that, but it is still too slow.
anyway I when trough the door few time, and I did no see anything.
I see that the capsule veer to the left and if it was scraping the door.
what it is that I am suppose to see?
maybe compile it is release mode, because I can not move or do anything.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Thu Sep 18, 2014 7:35 pm

ok I'll make this tomorrow

sometime when the door make the contact with the camera body, the camera just fly away and i get an assert because of an enormous velocity on the camera. I really don't know how this can happen.
this thing must be related to the joints and it seems to happen with continuous collision.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Thu Sep 18, 2014 7:48 pm

when you made the change can you make so that on the test, there are only the relevant objects.
the doors and the player.
the rest of the stuff is no relevant for debugging the problem

how you make the player?
Is this another body that you are simple moving by setting the position or velocity?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Thu Sep 18, 2014 7:56 pm

Yes i will make a simplier sample.

Yes this is 2 bodies with slider joint to allow the croutch.
And yes i use velocity.

What is strange is that has works for years with this method using newton 2.
This is why i think something weird is missing
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Fri Sep 19, 2014 5:44 am

here a simplified scene showing the issue.
http://arkeon.dyndns.org/scol/physicjoints.rar

when you come close to a collision, with right click you send balls.
Then when the ball bounce on the wall and get back to the camera collision some times the camera just bounce away.

here a video that shows how I produce this :
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Fri Sep 19, 2014 8:26 am

I made the object mouse with forces working well.
what should I change in your function to also apply a quaternion for angle destination ?
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Fri Sep 19, 2014 9:37 am

what do you mean a quaternion for angle destination, can you give me an example?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Fri Sep 19, 2014 9:40 am

Almost the same function but giving a quaternion to rotate the body to a new orientation using omega.

A function to move a body with forces to a position and orientation in world.

This could be used to transform nodes animations into physics for example.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: div / 0 in BuildJacobianMatrix

Postby Julio Jerez » Fri Sep 19, 2014 11:09 am

Oh I see, Ok I will add a modified one.
does the new function works better?

you can make tweaks, for example you can take the angular damp which is hard code to 0.95 now
and make a parameter, that way you can control the amount of spin the body does when you drag it. 1.0 full spin, less that 1.0 form light to heavily damped.

I will make a function that takes a target matrix and tune into an angular impulse just like that one
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: div / 0 in BuildJacobianMatrix

Postby arkeon » Fri Sep 19, 2014 6:51 pm

Yes I already set the stiffness as a parameter, but I don't use the collision point yet.
I prefer the effect it does with a spring joint :) as I cant set more parameters on it. but I use this function to move the body added on the mouse position.

For the case discussed before about the camera body going crazy, I was able to make a very basic scene where the problem occur once it start and with only 2 bodies + the camera shell body and the camera body with the joint.

here a box collision just fall near the camera body and when it touch it the camera body go to heaven.

http://arkeon.dyndns.org/scol/camera_collision.rar
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

PreviousNext

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 4 guests