Skip to content

Missed collision detection during the simulation #154

@parazjx

Description

@parazjx

Thanks for all the great works! The project has been a great help in verifying my theories about playing pool on daily play.

But sometimes I found the ball went through with other ball in EightBall game when i put cue ball in 1/4 place and others in 3/4 place.

First change position In pooltool/layouts.py:

def _get_eight_ball_rack:
...
blueprint = ball_cluster_blueprint(
seed=BallPos([], (0.5, 0.75), solids),
...
cue = BallPos([], (0.5, 0.25), {"cue"})

Then with the test code follow:

shot = pt.System(
    cue=pt.Cue(cue_ball_id="cue"),
    table=(table := pt.Table.default()),
    balls=pt.get_rack(
        pt.GameType.EIGHTBALL, table
    ),
)
shot.strike(V0=3.262213, phi=81.83468, theta=0, a= 0, b=0)
pt.simulate(shot, inplace=True)   
pt.show(shot)

图片

The magic number of V0 and phi are just copied when i shot by hand.
I am not sure which step caused the problem, wether the time calculation error when solving the equation or the omission when querying the transition event.

Thanks again for all great works!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions