2021-04-16 17:10:15 +02:00
|
|
|
|
[Planck.js API Doc](../README.md) › [Globals](../globals.md) › [TimeStep](timestep.md)
|
|
|
|
|
|
|
|
|
|
|
|
# Class: TimeStep
|
|
|
|
|
|
|
|
|
|
|
|
## Hierarchy
|
|
|
|
|
|
|
|
|
|
|
|
* **TimeStep**
|
|
|
|
|
|
|
|
|
|
|
|
## Index
|
|
|
|
|
|
|
|
|
|
|
|
### Properties
|
|
|
|
|
|
|
|
|
|
|
|
* [blockSolve](timestep.md#blocksolve)
|
|
|
|
|
|
* [dt](timestep.md#dt)
|
|
|
|
|
|
* [dtRatio](timestep.md#dtratio)
|
|
|
|
|
|
* [inv_dt](timestep.md#inv_dt)
|
|
|
|
|
|
* [inv_dt0](timestep.md#inv_dt0)
|
|
|
|
|
|
* [positionIterations](timestep.md#positioniterations)
|
|
|
|
|
|
* [velocityIterations](timestep.md#velocityiterations)
|
|
|
|
|
|
* [warmStarting](timestep.md#warmstarting)
|
|
|
|
|
|
|
|
|
|
|
|
### Methods
|
|
|
|
|
|
|
|
|
|
|
|
* [reset](timestep.md#reset)
|
|
|
|
|
|
|
|
|
|
|
|
## Properties
|
|
|
|
|
|
|
|
|
|
|
|
### blockSolve
|
|
|
|
|
|
|
|
|
|
|
|
• **blockSolve**: *boolean* = true
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Solver.ts:49](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Solver.ts#L49)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### dt
|
|
|
|
|
|
|
|
|
|
|
|
• **dt**: *number* = 0
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Solver.ts:43](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Solver.ts#L43)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
time step
|
|
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### dtRatio
|
|
|
|
|
|
|
|
|
|
|
|
• **dtRatio**: *number* = 1
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Solver.ts:54](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Solver.ts#L54)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
dt * inv_dt0
|
|
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### inv_dt
|
|
|
|
|
|
|
|
|
|
|
|
• **inv_dt**: *number* = 0
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Solver.ts:45](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Solver.ts#L45)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
inverse time step (0 if dt == 0)
|
|
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### inv_dt0
|
|
|
|
|
|
|
|
|
|
|
|
• **inv_dt0**: *number* = 0
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Solver.ts:52](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Solver.ts#L52)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
timestep ratio for variable timestep
|
|
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### positionIterations
|
|
|
|
|
|
|
|
|
|
|
|
• **positionIterations**: *number* = 0
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Solver.ts:47](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Solver.ts#L47)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### velocityIterations
|
|
|
|
|
|
|
|
|
|
|
|
• **velocityIterations**: *number* = 0
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Solver.ts:46](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Solver.ts#L46)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### warmStarting
|
|
|
|
|
|
|
|
|
|
|
|
• **warmStarting**: *boolean* = false
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Solver.ts:48](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Solver.ts#L48)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
## Methods
|
|
|
|
|
|
|
|
|
|
|
|
### reset
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
▸ **reset**(`dt`: number): *void*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Solver.ts:56](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Solver.ts#L56)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
**Parameters:**
|
|
|
|
|
|
|
|
|
|
|
|
Name | Type |
|
|
|
|
|
|
------ | ------ |
|
2021-05-11 18:30:36 -07:00
|
|
|
|
`dt` | number |
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
**Returns:** *void*
|