new ShapeWrapper(object3D, json, body)
Wrap Polygon
or Circle
of https://www.npmjs.com/package/detect-collisions
Parameters:
Name | Type | Description |
---|---|---|
object3D | object | object 3D parent of the controller collider |
json | PolygonJSON | | shapeJSON |
body | boolean | shape body |
- Source
Members
body :boolean
Type:
- boolean
- Source
json :PolygonJSON|CircleJSON
shape JSON
Type:
- Source
object3D :object
object3D parent of the controller collider
Type:
- object
- Source
shape :Polygon|Circle
Circle
or Polygon
of https://www.npmjs.com/package/detect-collisions
Type:
- Polygon |
Circle
- Source
Methods
getObject3D() → {object}
- Source
Returns:
- object3D of shape wrapper
- Type:
- object
getShape() → {Polygon|Circle}
- Source
Returns:
- Type:
- Polygon |
Circle
initShapeFromJSON(json)
Initialize shape of https://www.npmjs.com/package/detect-collisions and update method then attach a getter to the object3D to the shape
Parameters:
Name | Type | Description |
---|---|---|
json | PolygonJSON | | shape json |
- Source
isBody() → {boolean}
- Source
Returns:
- body
- Type:
- boolean
update(worldPosition, worldRotation, worldScale)
update world transform of shape
Parameters:
Name | Type | Description |
---|---|---|
worldPosition | Object | world position |
worldRotation | * | world rotation useless here since this is not an ellipse but a circle |
worldScale | Object | world scale |
- Source
update(worldPosition, worldRotation, worldScale)
update world transform of shape
Parameters:
Name | Type | Description |
---|---|---|
worldPosition | Object | world position |
worldRotation | Object | world rotation |
worldScale | Object | world scale |
- Source