pooltool.events.factory¶
Abstracted functions for easy event creation¶
This submodule provides a collection of factory functions for creating Event objects.
Each function is designed to encapsulate the creation of specific types of events, such as collisions between balls, collisions between balls and cushions, and various transitions in the ball’s state (e.g., from rolling to stationary, spinning to rolling).
Overview¶
|
Create a null event. |
|
Create a ball-ball collision. |
|
Create a ball-linear-cushion collision. |
|
Create a ball-circular-cushion collision. |
|
Create a ball-pocket collision. |
|
Create a cue stick-ball collision. |
|
Create a spinning-stationary transition. |
|
Create a rolling-stationary transition. |
|
Create a rolling-spinning transition. |
|
Create a sliding-rolling transition. |
Functions¶
- pooltool.events.factory.null_event(time: float, set_initial: bool = False) pooltool.events.datatypes.Event [source]¶
Create a null event.
- Return type:
- pooltool.events.factory.ball_ball_collision(ball1: pooltool.objects.ball.datatypes.Ball, ball2: pooltool.objects.ball.datatypes.Ball, time: float, set_initial: bool = False) pooltool.events.datatypes.Event [source]¶
Create a ball-ball collision.
- Return type:
- pooltool.events.factory.ball_linear_cushion_collision(ball: pooltool.objects.ball.datatypes.Ball, cushion: pooltool.objects.table.components.LinearCushionSegment, time: float, set_initial: bool = False) pooltool.events.datatypes.Event [source]¶
Create a ball-linear-cushion collision.
- Return type:
- pooltool.events.factory.ball_circular_cushion_collision(ball: pooltool.objects.ball.datatypes.Ball, cushion: pooltool.objects.table.components.CircularCushionSegment, time: float, set_initial: bool = False) pooltool.events.datatypes.Event [source]¶
Create a ball-circular-cushion collision.
- Return type:
- pooltool.events.factory.ball_pocket_collision(ball: pooltool.objects.ball.datatypes.Ball, pocket: pooltool.objects.table.components.Pocket, time: float, set_initial: bool = False) pooltool.events.datatypes.Event [source]¶
Create a ball-pocket collision.
- Return type:
- pooltool.events.factory.stick_ball_collision(stick: pooltool.objects.cue.datatypes.Cue, ball: pooltool.objects.ball.datatypes.Ball, time: float, set_initial: bool = False) pooltool.events.datatypes.Event [source]¶
Create a cue stick-ball collision.
- Return type:
- pooltool.events.factory.spinning_stationary_transition(ball: pooltool.objects.ball.datatypes.Ball, time: float, set_initial: bool = False) pooltool.events.datatypes.Event [source]¶
Create a spinning-stationary transition.
- Return type:
- pooltool.events.factory.rolling_stationary_transition(ball: pooltool.objects.ball.datatypes.Ball, time: float, set_initial: bool = False) pooltool.events.datatypes.Event [source]¶
Create a rolling-stationary transition.
- Return type:
- pooltool.events.factory.rolling_spinning_transition(ball: pooltool.objects.ball.datatypes.Ball, time: float, set_initial: bool = False) pooltool.events.datatypes.Event [source]¶
Create a rolling-spinning transition.
- Return type:
- pooltool.events.factory.sliding_rolling_transition(ball: pooltool.objects.ball.datatypes.Ball, time: float, set_initial: bool = False) pooltool.events.datatypes.Event [source]¶
Create a sliding-rolling transition.
- Return type: