2020-07-28 20:21:55 -07:00
|
|
|
|
[Planck.js API Doc](../README.md) › [Globals](../globals.md) › [FixtureOpt](fixtureopt.md)
|
|
|
|
|
|
|
|
|
|
|
|
# Interface: FixtureOpt
|
|
|
|
|
|
|
2021-04-16 17:10:15 +02:00
|
|
|
|
A fixture definition is used to create a fixture. This class defines an
|
|
|
|
|
|
abstract fixture definition. You can reuse fixture definitions safely.
|
|
|
|
|
|
|
2020-07-28 20:21:55 -07:00
|
|
|
|
## Hierarchy
|
|
|
|
|
|
|
|
|
|
|
|
* **FixtureOpt**
|
|
|
|
|
|
|
|
|
|
|
|
↳ [FixtureDef](fixturedef.md)
|
|
|
|
|
|
|
|
|
|
|
|
## Index
|
|
|
|
|
|
|
|
|
|
|
|
### Properties
|
|
|
|
|
|
|
2021-04-16 17:10:15 +02:00
|
|
|
|
* [density](fixtureopt.md#optional-density)
|
|
|
|
|
|
* [filterCategoryBits](fixtureopt.md#optional-filtercategorybits)
|
|
|
|
|
|
* [filterGroupIndex](fixtureopt.md#optional-filtergroupindex)
|
|
|
|
|
|
* [filterMaskBits](fixtureopt.md#optional-filtermaskbits)
|
|
|
|
|
|
* [friction](fixtureopt.md#optional-friction)
|
|
|
|
|
|
* [isSensor](fixtureopt.md#optional-issensor)
|
|
|
|
|
|
* [restitution](fixtureopt.md#optional-restitution)
|
|
|
|
|
|
* [userData](fixtureopt.md#optional-userdata)
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
|
|
|
|
|
## Properties
|
|
|
|
|
|
|
2021-04-16 17:10:15 +02:00
|
|
|
|
### `Optional` density
|
|
|
|
|
|
|
|
|
|
|
|
• **density**? : *number*
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Fixture.ts:56](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Fixture.ts#L56)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
The density, usually in kg/m^2
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
2021-04-16 17:10:15 +02:00
|
|
|
|
### `Optional` filterCategoryBits
|
|
|
|
|
|
|
|
|
|
|
|
• **filterCategoryBits**? : *number*
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Fixture.ts:70](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Fixture.ts#L70)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
Collision category bit or bits that this fixture belongs to.
|
|
|
|
|
|
If groupIndex is zero or not matching, then at least one bit in this fixture categoryBits should match other fixture maskBits and vice versa.
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
2021-04-16 17:10:15 +02:00
|
|
|
|
### `Optional` filterGroupIndex
|
|
|
|
|
|
|
|
|
|
|
|
• **filterGroupIndex**? : *number*
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Fixture.ts:65](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Fixture.ts#L65)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
Zero, positive or negative collision group.
|
|
|
|
|
|
Fixtures with same positive groupIndex always collide and fixtures with same negative groupIndex never collide.
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
2021-04-16 17:10:15 +02:00
|
|
|
|
### `Optional` filterMaskBits
|
|
|
|
|
|
|
|
|
|
|
|
• **filterMaskBits**? : *number*
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Fixture.ts:74](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Fixture.ts#L74)*
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
2021-04-16 17:10:15 +02:00
|
|
|
|
Collision category bit or bits that this fixture accept for collision.
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
2021-04-16 17:10:15 +02:00
|
|
|
|
### `Optional` friction
|
|
|
|
|
|
|
|
|
|
|
|
• **friction**? : *number*
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Fixture.ts:48](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Fixture.ts#L48)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
The friction coefficient, usually in the range [0,1]
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
2021-04-16 17:10:15 +02:00
|
|
|
|
### `Optional` isSensor
|
|
|
|
|
|
|
|
|
|
|
|
• **isSensor**? : *boolean*
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Fixture.ts:60](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Fixture.ts#L60)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
A sensor shape collects contact information but never generates a collision response.
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
2021-04-16 17:10:15 +02:00
|
|
|
|
### `Optional` restitution
|
|
|
|
|
|
|
|
|
|
|
|
• **restitution**? : *number*
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Fixture.ts:52](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Fixture.ts#L52)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
The restitution (elasticity) usually in the range [0,1]
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
2021-04-16 17:10:15 +02:00
|
|
|
|
### `Optional` userData
|
|
|
|
|
|
|
|
|
|
|
|
• **userData**? : *unknown*
|
2020-07-28 20:21:55 -07:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Fixture.ts:44](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Fixture.ts#L44)*
|