Skip to content

Add cpSegmentShapeSetNeighbors() support #20

@ClockVapor

Description

@ClockVapor

It would be nice to have official support for this function in the Ruby gem. I keep having issues with "seams" when using adjacent, parallel segment shapes, resulting in objects getting stuck and hitting "bumps."

I forked and added the function myself, but I'm not sure if it's even working. I'm using it like this for line segments in a square shape:

# top of box, from left to right
segments[:top].set_neighbors!(
  segments[:top].a + CP::Vec2.new(-1, 0),
  segments[:top].b + CP::Vec2.new(1, 0)
)

# right side of box, from top to bottom
segments[:right].set_neighbors!(
  segments[:right].a + CP::Vec2.new(0, -1),
  segments[:right].b + CP::Vec2.new(0, 1)
)
# etc. etc.

I don't notice any effects after doing this. This and this are my only two modifications to add the cpSegmentShapeSetNeighbors function. Any ideas on this?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions