Trigger volumes and sleep state

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Trigger volumes and sleep state

Postby Cannos » Thu Mar 04, 2010 5:47 pm

I have a quick question regarding trigger volumes. When I have a rigid body intersecting a static trigger volume it appears to keep the body from going into sleep state even though it is at rest. Is this expected behavior? Is there a way to allow the body to go to sleep even if it is inside or intersecting the trigger volume?

Thanks for the help!
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm

Re: Trigger volumes and sleep state

Postby Cannos » Mon Mar 08, 2010 7:13 pm

Following up since I haven't seen any response. Was this a dumb question, or does nobody know?

Anyway, I want trigger volume behavior (detection of entering / leaving an arbitrary volume without generating contacts), but I want bodies to go to sleep if they reach equilibrium inside the volume. Since this doesn't appear to work, I'm just doing manual collision detection against non-collidable volumes using the NewtonCollision* functions. Is this what I need to do, or should I expect the trigger volumes to behave differently? Thank you for any info!
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm

Re: Trigger volumes and sleep state

Postby Julio Jerez » Tue Mar 09, 2010 8:52 am

Cannos wrote:I have a quick question regarding trigger volumes. When I have a rigid body intersecting a static trigger volume it appears to keep the body from going into sleep state even though it is at rest. Is this expected behavior? Is there a way to allow the body to go to sleep even if it is inside or intersecting the trigger volume?

Thanks for the help!

Sorry sometime I do no see question because thie status change in the forum

no is not expected behabbour it is does that, it is a bug.
change should to rest even if they are insize a triger volume,
a triger volme is a change that passes the broadphase collision, and the narrow collison test but does not calculate contacts.
are you sue theshape is at equelibrium?


do you have a small test to test this?
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Trigger volumes and sleep state

Postby Cannos » Tue Mar 09, 2010 4:32 pm

The simplest test I came up with is a modification of the basic restitution sample. In DebugDisplay.cpp, I changed the color of the body rendering to show as red if the body is awake and white if it is asleep.
Code: Select all
void DebugShowBodyCollision (const NewtonBody* body, void* yserData)
{
...
    int sleepState = NewtonBodyGetSleepState(body);
    if (sleepState == 1)
        glColor3f(1.0f, 1.0f, 1.0f);
    else
        glColor3f(1.0f, 0.0f, 0.0f);
...
}


Then I added a trigger volume to the end of BasicRestitution.cpp:
Code: Select all
void Restitution (SceneManager& system)
{
...
    // Create a trigger volume
    NewtonCollision* pTriggerVolumeCollision = NewtonCreateBox(world, 25.0f, 50.0f, 15.0f, 0, NULL);
    NewtonCollisionSetAsTriggerVolume(pTriggerVolumeCollision, 1);
    NewtonBody* pTriggerVolumeBody = NewtonCreateBody(world, pTriggerVolumeCollision);
    NewtonReleaseCollision (world, pTriggerVolumeCollision);
}


If you then turn on "show collision" in the restitution sample, you'll see that the bodies inside the trigger volume never go to sleep (rendered as red). Let me know if you want me to send the source files, or if you need any additional information. Thanks!
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm

Re: Trigger volumes and sleep state

Postby Cannos » Sat May 22, 2010 8:42 pm

I just wanted to follow up on this potential bug as it has been a couple months and I haven't heard anything. Has anyone else seen this issue?
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm

Re: Trigger volumes and sleep state

Postby Cannos » Fri Jul 02, 2010 5:26 pm

I just confirmed that bodies still don't go to sleep inside of trigger volumes in the latest version of Newton. It's very easy to reproduce. Is a fix possible for this?
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm

Re: Trigger volumes and sleep state

Postby Julio Jerez » Fri Jul 02, 2010 5:43 pm

I was looking for these pending reported bugs, last saturday and I new I forgot something.
I will veryy this tomorrow.

Than you.
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Trigger volumes and sleep state

Postby Julio Jerez » Fri Jul 02, 2010 5:46 pm

just to clarify, what is the behavior you are expecting to see?

are you saying that if you place a trigger volume and a box in inside it,
and the box does to rest one flloor, then the box will never go to sleep bacause the trigger volume does not let it?
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Trigger volumes and sleep state

Postby Cannos » Fri Jul 02, 2010 5:50 pm

When a body comes to equilibrium while inside or intersecting a trigger volume, I am expecting it to go to sleep (i.e. sleepState == 1).

Is this what it should be doing? Or will it always be awake when touching a trigger volume?
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm

Re: Trigger volumes and sleep state

Postby Cannos » Fri Jul 02, 2010 6:34 pm

Sorry I didn't see the last sentence in your previous post.

Yes, I am seeing what you described. Bodies that come to rest inside a trigger volume do not go to sleep. The sample code I have above is a modification of the restitution example. You can see that all the bodies inside the box do not go to sleep while the bodies outside the box will go to sleep.
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm

Re: Trigger volumes and sleep state

Postby Cannos » Mon Jul 12, 2010 10:03 pm

Just wanted to see if there was any update on this issue. Have you had a chance to check this out?
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm

Re: Trigger volumes and sleep state

Postby Julio Jerez » Tue Jul 13, 2010 7:55 am

no I have not checked that yet, I will this week and you get it with 2.24
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Trigger volumes and sleep state

Postby Julio Jerez » Tue Jul 27, 2010 12:00 pm

Oh jesus I keep forgetting this, I was going to publish 2.24 and I found this Bug in my list.

I will ckeck it tonight, I am sorry about that
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Trigger volumes and sleep state

Postby Cannos » Tue Jul 27, 2010 12:51 pm

heh, thanks for remembering. I was starting to feel bad about all the reminders. :)
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm

Re: Trigger volumes and sleep state

Postby Cannos » Mon Aug 02, 2010 5:29 pm

Hi Julio, I just tested this with 2.24 and it looks like its still a problem. Did you have a chance to look at this?
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 226 guests

cron