Sensor Scaling Problem

Hi, 

I’m using sensors for initial collisions.  I’m having a problem when I turn on 'physics.setDrawMode( “hybrid” )., which shows the boundaries of my sensors.  Collisions aren’t being detected until I am well inside the sensor, (see image)  shouldn’t they be detected as soon as the two bodies touch?

I define my sensors as follows:

physics.addBody( object,   { density = 4.0, friction = 1, bounce = 0.1, radius=48 } , {radius=500 , isSensor = true})

and for my player:

physics.addBody( player, { density = 5.0, friction = 1.0, bounce = 0.0, radius = 60 } )

Thanks, Greg

Greg,

Hi.  Some questions.

  • Corona build?
  • How fast is that object moving?
  • Can you share a small test case as a link to a zipped sample?
  • Does that object have two bodies?  I ask, because although your code says no, the image looks like the answer is “Yes”.
    • Update Doh, nevermind!  the code says YES.  My bad. :slight_smile:

Answer: Yes, the collision should be detected as soon as the bodies are co-linear or overlapping.

Hi Greg,

I agree with Ed, this sounds weird. If your “physics.addBody()” commands are exactly like that, and you’re not scaling something or delaying the reaction somehow, then the collision response should be instant. As Ed suggests, it could be that one object is moving at a super fast rate, but I think it would need to be moving at a sheerly ridiculous rate to get deeply inside the sensor before triggering a reaction.

Brent

Hi Brent and Ed,

It was my mistake, the group scaling was scaling down the sprites, but the physics as we know don’t scale.  The only strange part, is that I would have expected the collisions to occur instantly as opposed to half way into the sensors, regardless of the scaling.  

Thanks for the responses, Greg

Greg,

Hi.  Some questions.

  • Corona build?
  • How fast is that object moving?
  • Can you share a small test case as a link to a zipped sample?
  • Does that object have two bodies?  I ask, because although your code says no, the image looks like the answer is “Yes”.
    • Update Doh, nevermind!  the code says YES.  My bad. :slight_smile:

Answer: Yes, the collision should be detected as soon as the bodies are co-linear or overlapping.

Hi Greg,

I agree with Ed, this sounds weird. If your “physics.addBody()” commands are exactly like that, and you’re not scaling something or delaying the reaction somehow, then the collision response should be instant. As Ed suggests, it could be that one object is moving at a super fast rate, but I think it would need to be moving at a sheerly ridiculous rate to get deeply inside the sensor before triggering a reaction.

Brent

Hi Brent and Ed,

It was my mistake, the group scaling was scaling down the sprites, but the physics as we know don’t scale.  The only strange part, is that I would have expected the collisions to occur instantly as opposed to half way into the sensors, regardless of the scaling.  

Thanks for the responses, Greg