2021-04-16 17:10:15 +02:00
|
|
|
|
[Planck.js API Doc](../README.md) › [Globals](../globals.md) › [SeparationFunction](separationfunction.md)
|
|
|
|
|
|
|
|
|
|
|
|
# Class: SeparationFunction
|
|
|
|
|
|
|
|
|
|
|
|
## Hierarchy
|
|
|
|
|
|
|
|
|
|
|
|
* **SeparationFunction**
|
|
|
|
|
|
|
|
|
|
|
|
## Index
|
|
|
|
|
|
|
|
|
|
|
|
### Properties
|
|
|
|
|
|
|
|
|
|
|
|
* [indexA](separationfunction.md#indexa)
|
|
|
|
|
|
* [indexB](separationfunction.md#indexb)
|
|
|
|
|
|
* [m_axis](separationfunction.md#m_axis)
|
|
|
|
|
|
* [m_localPoint](separationfunction.md#m_localpoint)
|
|
|
|
|
|
* [m_proxyA](separationfunction.md#m_proxya)
|
|
|
|
|
|
* [m_proxyB](separationfunction.md#m_proxyb)
|
|
|
|
|
|
* [m_sweepA](separationfunction.md#m_sweepa)
|
|
|
|
|
|
* [m_sweepB](separationfunction.md#m_sweepb)
|
|
|
|
|
|
* [m_type](separationfunction.md#m_type)
|
|
|
|
|
|
|
|
|
|
|
|
### Methods
|
|
|
|
|
|
|
|
|
|
|
|
* [compute](separationfunction.md#compute)
|
|
|
|
|
|
* [evaluate](separationfunction.md#evaluate)
|
|
|
|
|
|
* [findMinSeparation](separationfunction.md#findminseparation)
|
|
|
|
|
|
* [initialize](separationfunction.md#initialize)
|
|
|
|
|
|
|
|
|
|
|
|
## Properties
|
|
|
|
|
|
|
|
|
|
|
|
### indexA
|
|
|
|
|
|
|
|
|
|
|
|
• **indexA**: *number*
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/collision/TimeOfImpact.ts:316](https://github.com/shakiba/planck.js/blob/acc3bd8/src/collision/TimeOfImpact.ts#L316)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### indexB
|
|
|
|
|
|
|
|
|
|
|
|
• **indexB**: *number*
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/collision/TimeOfImpact.ts:317](https://github.com/shakiba/planck.js/blob/acc3bd8/src/collision/TimeOfImpact.ts#L317)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### m_axis
|
|
|
|
|
|
|
2021-05-02 17:18:33 -07:00
|
|
|
|
• **m_axis**: *[Vec2](vec2.md)‹›* = Vec2.zero()
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/collision/TimeOfImpact.ts:320](https://github.com/shakiba/planck.js/blob/acc3bd8/src/collision/TimeOfImpact.ts#L320)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### m_localPoint
|
|
|
|
|
|
|
2021-05-02 17:18:33 -07:00
|
|
|
|
• **m_localPoint**: *[Vec2](vec2.md)‹›* = Vec2.zero()
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/collision/TimeOfImpact.ts:319](https://github.com/shakiba/planck.js/blob/acc3bd8/src/collision/TimeOfImpact.ts#L319)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### m_proxyA
|
|
|
|
|
|
|
2021-05-02 17:18:33 -07:00
|
|
|
|
• **m_proxyA**: *[DistanceProxy](distanceproxy.md)‹›* = new DistanceProxy()
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/collision/TimeOfImpact.ts:312](https://github.com/shakiba/planck.js/blob/acc3bd8/src/collision/TimeOfImpact.ts#L312)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### m_proxyB
|
|
|
|
|
|
|
2021-05-02 17:18:33 -07:00
|
|
|
|
• **m_proxyB**: *[DistanceProxy](distanceproxy.md)‹›* = new DistanceProxy()
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/collision/TimeOfImpact.ts:313](https://github.com/shakiba/planck.js/blob/acc3bd8/src/collision/TimeOfImpact.ts#L313)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### m_sweepA
|
|
|
|
|
|
|
2021-05-02 17:18:33 -07:00
|
|
|
|
• **m_sweepA**: *[Sweep](sweep.md)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/collision/TimeOfImpact.ts:314](https://github.com/shakiba/planck.js/blob/acc3bd8/src/collision/TimeOfImpact.ts#L314)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### m_sweepB
|
|
|
|
|
|
|
2021-05-02 17:18:33 -07:00
|
|
|
|
• **m_sweepB**: *[Sweep](sweep.md)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/collision/TimeOfImpact.ts:315](https://github.com/shakiba/planck.js/blob/acc3bd8/src/collision/TimeOfImpact.ts#L315)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### m_type
|
|
|
|
|
|
|
|
|
|
|
|
• **m_type**: *[SeparationFunctionType](../enums/separationfunctiontype.md)*
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/collision/TimeOfImpact.ts:318](https://github.com/shakiba/planck.js/blob/acc3bd8/src/collision/TimeOfImpact.ts#L318)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
## Methods
|
|
|
|
|
|
|
|
|
|
|
|
### compute
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
▸ **compute**(`find`: boolean, `t`: number): *number*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/collision/TimeOfImpact.ts:396](https://github.com/shakiba/planck.js/blob/acc3bd8/src/collision/TimeOfImpact.ts#L396)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
**Parameters:**
|
|
|
|
|
|
|
|
|
|
|
|
Name | Type |
|
|
|
|
|
|
------ | ------ |
|
2021-05-11 18:30:36 -07:00
|
|
|
|
`find` | boolean |
|
|
|
|
|
|
`t` | number |
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
**Returns:** *number*
|
|
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### evaluate
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
▸ **evaluate**(`t`: number): *number*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/collision/TimeOfImpact.ts:473](https://github.com/shakiba/planck.js/blob/acc3bd8/src/collision/TimeOfImpact.ts#L473)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
**Parameters:**
|
|
|
|
|
|
|
|
|
|
|
|
Name | Type |
|
|
|
|
|
|
------ | ------ |
|
2021-05-11 18:30:36 -07:00
|
|
|
|
`t` | number |
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
**Returns:** *number*
|
|
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### findMinSeparation
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
▸ **findMinSeparation**(`t`: number): *number*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/collision/TimeOfImpact.ts:469](https://github.com/shakiba/planck.js/blob/acc3bd8/src/collision/TimeOfImpact.ts#L469)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
**Parameters:**
|
|
|
|
|
|
|
|
|
|
|
|
Name | Type |
|
|
|
|
|
|
------ | ------ |
|
2021-05-11 18:30:36 -07:00
|
|
|
|
`t` | number |
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
**Returns:** *number*
|
|
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### initialize
|
|
|
|
|
|
|
2021-05-02 17:18:33 -07:00
|
|
|
|
▸ **initialize**(`cache`: [SimplexCache](simplexcache.md), `proxyA`: [DistanceProxy](distanceproxy.md), `sweepA`: [Sweep](sweep.md), `proxyB`: [DistanceProxy](distanceproxy.md), `sweepB`: [Sweep](sweep.md), `t1`: number): *number*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/collision/TimeOfImpact.ts:324](https://github.com/shakiba/planck.js/blob/acc3bd8/src/collision/TimeOfImpact.ts#L324)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
**Parameters:**
|
|
|
|
|
|
|
|
|
|
|
|
Name | Type |
|
|
|
|
|
|
------ | ------ |
|
2021-05-02 17:18:33 -07:00
|
|
|
|
`cache` | [SimplexCache](simplexcache.md) |
|
|
|
|
|
|
`proxyA` | [DistanceProxy](distanceproxy.md) |
|
|
|
|
|
|
`sweepA` | [Sweep](sweep.md) |
|
|
|
|
|
|
`proxyB` | [DistanceProxy](distanceproxy.md) |
|
|
|
|
|
|
`sweepB` | [Sweep](sweep.md) |
|
2021-04-16 17:10:15 +02:00
|
|
|
|
`t1` | number |
|
|
|
|
|
|
|
|
|
|
|
|
**Returns:** *number*
|