Gear calculation functionality no included in Box2D.
More...
|
float | pitchRadius |
| Calculate the closest possible pitch radius, number of teeth and resulting gear ratio for a new gear based on the current gear pitch radius, number of teeth, and a gear ratio.
|
|
Gear calculation functionality no included in Box2D.
◆ CreateInvoluteGear()
ReadOnlySpan< Shape > Box2D.Gears.CreateInvoluteGear |
( |
Body |
body, |
|
|
ShapeDef |
shapeDef, |
|
|
float |
pitchRadius, |
|
|
int |
teeth, |
|
|
float |
toothLength |
|
) |
| |
|
inline |
Create the shapes that represent an approximate Involute Gear on the supplied Body, situated at the Body's origin.
- Parameters
-
body | The Body to attach the shapes to. |
shapeDef | The ShapeDef to use for the shapes. |
pitchRadius | The pitch radius of the gear - that is, where the teeth engage. |
teeth | The number of teeth that the gear should have. |
toothLength | The length of the teeth - how far they stick out from the sprocket. |
- Returns
- A list of shapes that were added to the Body.
- Exceptions
-
ArgumentOutOfRangeException | >If teeth is less than 3 |
◆ pitchRadius
float Box2D.Gears.pitchRadius |
Calculate the closest possible pitch radius, number of teeth and resulting gear ratio for a new gear based on the current gear pitch radius, number of teeth, and a gear ratio.
Calculate compatible gear metrics for a second gear with matching circular pitch, based on a desired gear ratio and known tooth length of the first gear. This version clamps the tooth length of the second gear to ensure meshing clearance.
- Parameters
-
pitchRadius | The pitch radius of the first gear. |
teeth | The number of teeth on the first gear. |
ratio | The desired gear ratio. A ratio of 1 means the second gear is the same size as the first gear. A value below 1 means the second gear is smaller, and a value above 1 means the second gear is larger. |
- Returns
- The pitch radius, number of teeth and actual gear ratio for the new gear.
This method is intended to help find a size of gear that will mesh with the first gear, adjusting the ratio if necessary.
- Parameters
-
pitchRadius | The pitch radius of the first gear. |
teeth | The number of teeth on the first gear. |
toothLength | tooth length of the first gear. |
ratio | Desired gear ratio (second gear : first gear). |
- Returns
- The second gear's pitch radius, number of teeth, safe tooth length, and the distance between the gear centres.
This method is intended to help find a size of gear and tooth length that will mesh with the first gear, without adjusting the ratio.
The documentation for this class was generated from the following file:
- src/Box2DBindings/Gears.cs