dCustomTriggerManager Triggers permanently

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: dCustomTriggerManager Triggers permanently

Postby Julio Jerez » Thu Jun 20, 2019 11:25 am

Some set up is really wrong.
The box is not supposed to collide with the trigger volume, after that the trigger is not longer working like is suppose to.

Do you have a repro demo that I can test?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: dCustomTriggerManager Triggers permanently

Postby Lax » Thu Jun 20, 2019 12:21 pm

Hi julio,

sorry, my Engine is not yet ready for easy checkout, compiling and starting.

But I found the issue! Its the collision hull.

I used from OgreNewt the TreeCollision:
Code: Select all
staticCollision = OgreNewt::CollisionPtr(new OgreNewt::CollisionPrimitives::TreeCollision(this->ogreNewt, entity, true, 0));

Internally functions like:
Code: Select all
m_col = NewtonCreateTreeCollision(m_world->getNewtonWorld(), id);
NewtonTreeCollisionBeginBuild(m_col);
...

are used.

This causes the weird behavior with enter/exit and collision detection!
When I change the collision hull to convex:
Code: Select all
staticCollision = OgreNewt::CollisionPtr(new OgreNewt::CollisionPrimitives::ConvexHull(this->ogreNewt, entity, 0));

Internally "NewtonCreateConvexHull" is used.
It will work!

So somehow creating a tree collision does cause the issue.

Thanks anyway for your patience!

Just another question: Is it possible to used trigger that are dynamic bodies, e.g. a trigger that is moving around in the world?
Please support SecondEarthTechnicBase built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd17-5ff5-40a0-ac6f-44b97b79be62
Image
Lax
 
Posts: 165
Joined: Sat Jan 08, 2011 8:24 am

Re: dCustomTriggerManager Triggers permanently

Postby Lax » Thu Jun 20, 2019 12:49 pm

Ah damn it, just found another weird behavior.
See the two attached videos:
http://www.lukas-kalinowski.com/Homepage/wp-content/uploads/Trigger2.mp4
http://www.lukas-kalinowski.com/Homepage/wp-content/uploads/Trigger3.mp4
http://www.lukas-kalinowski.com/Homepage/wp-content/uploads/Trigger4.mp4

In the first video I have no idea why that happens.

Also when the Bottle is bigger as the player (Trigger4.mp4) it will trigger permanently. But when I jump with the player or move a bit, the triggering stops for a short time.

What can that be??

Best Regards
Lax
Please support SecondEarthTechnicBase built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd17-5ff5-40a0-ac6f-44b97b79be62
Image
Lax
 
Posts: 165
Joined: Sat Jan 08, 2011 8:24 am

Re: dCustomTriggerManager Triggers permanently

Postby Julio Jerez » Thu Jun 20, 2019 3:26 pm

Lax I do not mean the source code, I mean an executable that like to the newton dlls that I can attach the debugger.

what kind of object is your player capsule?

on the first video, you mean that moving the mouse cursor is causing the trigger react?
as far as I know that is not possible, try showing debug display
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: dCustomTriggerManager Triggers permanently

Postby Lax » Sun Jun 23, 2019 6:03 am

Hi julio,

what kind of object is your player capsule?

Yes

Lax I do not mean the source code, I mean an executable that like to the newton dlls that I can attach the debugger.


Yeah I know. I created for a debug package of NOWA_Design, which can be downloaded from here:

http://www.lukas-kalinowski.com/Homepage/wp-content/uploads/GameDevelopment.7z

http://www.lukas-kalinowski.com/Homepage/wp-content/uploads/OpenAL11CoreSDK.exe

1. Install OpenAL11CoreSDK.exe
2. Unzip the GameDevelopment.7z package
3. Start ..\GameDevelopment\bin\Debug\NOWA_Design_d.exe
4. An Ogre graphics config dialog will appear: Choose DirectX 11 RenderSystem, set Fullscreen to "no" and Vsync to "yes", choose 1920x1080 resolution.
5. When NOWA_Design editor is loaded, go to file and choose from the recent file list "Trigger/TriggerTest1.scene"
6. You can move the camera via wasd keys, but attention, since its debug the scene will hang a little bit. Push in the toolbar below the camera button to reset the camera position
7. Push the "quader with the black line" button below in the toolbar to start simulation and grab-mode
8. Grab the case mesh like in the video inside the container. When the case is inside push the case at the floor with the mouse
9. Activate realtime logging by pressing the ^-character on your keyboard.
10. Try to attach the debugger

on the first video, you mean that moving the mouse cursor is causing the trigger react?

Yes because I pull the case against the ground, even it is on ground, this causes trigger enter/exit permanentely.

I'm using a picker from from old OgreNewt examples with a NewtonBodySetForceAndTorqueCallback.

Best Regards
Lax

Best Regards
Please support SecondEarthTechnicBase built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd17-5ff5-40a0-ac6f-44b97b79be62
Image
Lax
 
Posts: 165
Joined: Sat Jan 08, 2011 8:24 am

Re: dCustomTriggerManager Triggers permanently

Postby Julio Jerez » Tue Jun 25, 2019 6:31 am

I tried to download the demo, but after few seconds It freezes and I only get a partial download.
Untitled.png
Untitled.png (23.14 KiB) Viewed 8866 times
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: dCustomTriggerManager Triggers permanently

Postby Dave Gravel » Tue Jun 25, 2019 3:39 pm

Hi Lax,
The mouse pick from the dCustomKinematicController is very easy to use and setup.
Maybe you can give it a try, It can fix a lot problems.
The old mouse pick by force is deprecated and can cause problem with joints and more.
I don't think it have relation with the trigger problem but it can help for other things.

If you take a look inside DemoCameraManager.cpp file to see how it is implemented.
It is a lot simpler to implement and it have some usefull options for adjusting it.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: dCustomTriggerManager Triggers permanently

Postby Julio Jerez » Wed Jun 26, 2019 8:01 am

alright I try download again today and this time it went all the way.
I nwo can run the editor and I followed the instructions.

I can drag the brown box until I can place inside ethe trigger.
but I am no sure if I select the right action because as soon as I let go the mouse, I can no longer select the box again. I see in your video that you can pick even when is inside ethe trigger.

The button I push in the one wit teh red box and a small black line on top on the lower tool bar.

also I do not get the log to work. if by real time log you mean the trace on the screen that tell if the box was inside teh trigger.
is almost as simulation is not activated working. but that make no sence because dragging does works. anyway I will try to debug it using the trace to the text output in newton
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: dCustomTriggerManager Triggers permanently

Postby Julio Jerez » Wed Jun 26, 2019 9:40 am

ok I was able to reproduce it, you are right is seem as if under some conditions the lru is not updated and the body is removed form the trigger.

I added these trace and it seem as if when the cradle is inside the trigger resting on the ground, the update skip one frame and the lru us not updated,
I get these sequenced

    entering trigger body:4 lru:8252 frame:8252
    exiting trigger body:4 lru:8252 frame:8253

    entering trigger body:4 lru:8254 frame:8254
    exiting trigger body:4 lru:8254 frame:8255

    entering trigger body:4 lru:8257 frame:8257
    exiting trigger body:4 lru:8257 frame:8258

    entering trigger body:4 lru:8259 frame:8259
    exiting trigger body:4 lru:8259 frame:8260

    entering trigger body:4 lru:8261 frame:8261
    exiting trigger body:4 lru:8261 frame:8262

    entering trigger body:4 lru:8285 frame:8285
    exiting trigger body:4 lru:8285 frame:8286

as you can see the lru is registered in one frame, but on next frame the is not increased,
so the next stage interpret a is the trigger was remove.

My guess is that some cases you are skipping calling function
void dCustomTriggerManager::PreUpdate(dFloat timestep, int threadID)

which the one that update the lru counter.
if this is the case that would be teh reason, but I can see tha using a lru is kind of a as the state very is a weak way to update the state, is I will change it to no use trigger and instead to a collision test.

yes the trigger system is week and can fail, I will fix it. during the week and try again.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: dCustomTriggerManager Triggers permanently

Postby Julio Jerez » Wed Jun 26, 2019 10:52 am

Ok the good knew is that is also happens in the sandbox demos, basically if a body goes to rest inside a trigger the contact are deleted because contact joint does not have contact points.
if was this line here, in the broadphase that I add sometime ago to prune more contacts
Code: Select all
      //contact->m_killContact = contact->m_killContact | (body0->m_equilibrium & body1->m_equilibrium & !(contact->m_maxDOF && contact->m_isActive));
      contact->m_killContact = contact->m_killContact | (body0->m_equilibrium & body1->m_equilibrium & !contact->m_isActive);


I quickly changed so that only inactive contact are target for deletion, them the loop that get the active contacts to send to the solver can check If the joint has actual contact points.

please sync and try again.
I left the debug trace enabled so that you can see the output.
I will remove later after you verify that is working expected.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: dCustomTriggerManager Triggers permanently

Postby Lax » Wed Jun 26, 2019 4:47 pm

Cool thanks for spotting it out.
I integrated the newest Newton version and as you say, the trigger now behaves correctly!
One thing just: When I delete/stop the trigger, I get first another assert, besides the one you mentioned, but after that the application will crash, see:

http://www.lukas-kalinowski.com/Homepage/wp-content/uploads/Assert.png

Best Regards
Lax
Please support SecondEarthTechnicBase built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd17-5ff5-40a0-ac6f-44b97b79be62
Image
Lax
 
Posts: 165
Joined: Sat Jan 08, 2011 8:24 am

Re: dCustomTriggerManager Triggers permanently

Postby Julio Jerez » Wed Jun 26, 2019 5:34 pm

how do you delete or stop the trigger in the demo I have?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: dCustomTriggerManager Triggers permanently

Postby Lax » Thu Jun 27, 2019 4:23 pm

I call cleanUp of newton. Those asserts will trigger in debug mode. But in release mode the following happens now:

http://www.lukas-kalinowski.com/Homepage/wp-content/uploads/NoCollision.mp4
Please support SecondEarthTechnicBase built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd17-5ff5-40a0-ac6f-44b97b79be62
Image
Lax
 
Posts: 165
Joined: Sat Jan 08, 2011 8:24 am

Re: dCustomTriggerManager Triggers permanently

Postby Julio Jerez » Thu Jun 27, 2019 5:01 pm

does that happen by moving the cradle inside the trigger and moving out, or happens because the trigger was destroyed?

If the assert happen something is corrupted.
what do I do when playing your game to make a trigger go away.
I do not have a test that destroy triggers.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: dCustomTriggerManager Triggers permanently

Postby Lax » Fri Jun 28, 2019 11:41 am

Hi Julio,

I try to specify more clearly:
- I tested first in Debug Mode: Your new fix in newton does now work for the callback enter/exit, but when the simulation is stopped and started again, newton cleanUp is called and some asserts will throw (See the posted picture):
Code: Select all
void dgBodyMasterList::RemoveConstraint (dgConstraint* const constraint)
{
   dgAtomicExchangeAndAdd((dgInt32*) &m_constraintCount, -1);
   dgAssert (((dgInt32)m_constraintCount) >= 0);

   dgBody* const body0 = constraint->m_body0;
   dgBody* const body1 = constraint->m_body1;
   dgAssert (body0); // --> this body is null
   dgAssert (body1); // --> this body is null
   dgAssert (body0 == constraint->m_link1->GetInfo().m_bodyNode);
   dgAssert (body1 == constraint->m_link0->GetInfo().m_bodyNode);


- In Release mode, the behavior is different: At first everything is correct. Like in the video, the case does have collision with the plane. But as soon, as I pull the case inside the trigger and out, after the the collision system seems not to work anymore. The case will fall through the plane.
I tested several times, it seems to happen randomly, sometimes the collision with the plane worked again, but after a while of shaking the case inside/outside the trigger, my demo also does crash.

The demo I gave you, was without your trigger fix.
I could prepare a new demo with newest newton version, would that help?

Best Regards
Lax
Please support SecondEarthTechnicBase built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd17-5ff5-40a0-ac6f-44b97b79be62
Image
Lax
 
Posts: 165
Joined: Sat Jan 08, 2011 8:24 am

PreviousNext

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 8 guests