2020-07-28 20:21:55 -07:00
|
|
|
|
[Planck.js API Doc](../README.md) › [Globals](../globals.md) › [Position](position.md)
|
2020-07-27 00:12:01 -07:00
|
|
|
|
|
2020-07-28 20:21:55 -07:00
|
|
|
|
# Class: Position
|
2020-07-27 00:12:01 -07:00
|
|
|
|
|
|
|
|
|
|
## Hierarchy
|
|
|
|
|
|
|
|
|
|
|
|
* **Position**
|
|
|
|
|
|
|
|
|
|
|
|
## Index
|
|
|
|
|
|
|
2021-04-16 17:10:15 +02:00
|
|
|
|
### Constructors
|
|
|
|
|
|
|
|
|
|
|
|
* [constructor](position.md#constructor)
|
|
|
|
|
|
|
2020-07-27 00:12:01 -07:00
|
|
|
|
### Properties
|
|
|
|
|
|
|
|
|
|
|
|
* [a](position.md#a)
|
|
|
|
|
|
* [c](position.md#c)
|
|
|
|
|
|
|
|
|
|
|
|
### Methods
|
|
|
|
|
|
|
|
|
|
|
|
* [getTransform](position.md#gettransform)
|
|
|
|
|
|
|
2021-04-16 17:10:15 +02:00
|
|
|
|
## Constructors
|
|
|
|
|
|
|
|
|
|
|
|
### constructor
|
|
|
|
|
|
|
|
|
|
|
|
\+ **new Position**(): *[Position](position.md)*
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Position.ts:35](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Position.ts#L35)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
**Returns:** *[Position](position.md)*
|
|
|
|
|
|
|
2020-07-27 00:12:01 -07:00
|
|
|
|
## Properties
|
|
|
|
|
|
|
|
|
|
|
|
### a
|
|
|
|
|
|
|
|
|
|
|
|
• **a**: *number*
|
|
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Position.ts:35](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Position.ts#L35)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
angle
|
2020-07-27 00:12:01 -07:00
|
|
|
|
|
|
|
|
|
|
___
|
|
|
|
|
|
|
|
|
|
|
|
### c
|
|
|
|
|
|
|
2021-05-02 17:18:33 -07:00
|
|
|
|
• **c**: *[Vec2](vec2.md)*
|
2021-04-16 17:10:15 +02:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Position.ts:32](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Position.ts#L32)*
|
2020-07-27 00:12:01 -07:00
|
|
|
|
|
2021-04-16 17:10:15 +02:00
|
|
|
|
location
|
2020-07-27 00:12:01 -07:00
|
|
|
|
|
|
|
|
|
|
## Methods
|
|
|
|
|
|
|
|
|
|
|
|
### getTransform
|
|
|
|
|
|
|
2021-05-02 17:18:33 -07:00
|
|
|
|
▸ **getTransform**(`xf`: [Transform](transform.md), `p`: [Vec2](vec2.md)): *[Transform](transform.md)*
|
2020-07-27 00:12:01 -07:00
|
|
|
|
|
2021-05-11 18:30:36 -07:00
|
|
|
|
*Defined in [src/dynamics/Position.ts:42](https://github.com/shakiba/planck.js/blob/acc3bd8/src/dynamics/Position.ts#L42)*
|
2020-07-27 00:12:01 -07:00
|
|
|
|
|
|
|
|
|
|
**Parameters:**
|
|
|
|
|
|
|
|
|
|
|
|
Name | Type |
|
|
|
|
|
|
------ | ------ |
|
2021-05-02 17:18:33 -07:00
|
|
|
|
`xf` | [Transform](transform.md) |
|
|
|
|
|
|
`p` | [Vec2](vec2.md) |
|
2020-07-27 00:12:01 -07:00
|
|
|
|
|
2021-05-02 17:18:33 -07:00
|
|
|
|
**Returns:** *[Transform](transform.md)*
|