Issues

Issue #614 invalid

rayCast() on a ChainShape only detects the first edge.

garrett_brown
created an issue

I tried creating a chainshape with

self.body = love.physics.newBody(world.phys, 0, 0, "static") self.shape = love.physics.newChainShape(true, unpack(bounding_verts)) self.fixture = love.physics.newFixture(self.body, self.shape, 100)

and doing a raycast with

self.fixture:rayCast(x,y,x2,y2,1)

but it only hits the ChainShape if it passes through the first edge.

Comments (6)

  1. garrett_brown reporter

    Apparently Child Shapes must each be ray-tested manually, this is what the final parameter in the rayCast() function is used for. I wish the wiki had explained this before I put in about 2 hours trying to find a fix.

  2. garrett_brown reporter

    It should work. The reason doing a raycast on a ChainShape only tested the first side is because the child-index parameter defaults to 1, and each side must be tested manually with the various child-index values. Could somebody add this information to the RayCast wiki page?

  3. Log in to comment