ShapeWrapper

new ShapeWrapper(object3D, json, body)

Parameters:
NameTypeDescription
object3Dobject

object 3D parent of the controller collider

jsonPolygonJSON | CircleJSON

shapeJSON

bodyboolean

shape body

Members

body :boolean

Type:
  • boolean

json :PolygonJSON|CircleJSON

shape JSON

object3D :object

object3D parent of the controller collider

Type:
  • object

shape :Polygon|Circle

Type:
  • Polygon | Circle

Methods

getObject3D() → {object}

Returns:
  • object3D of shape wrapper
Type: 
object

getShape() → {Polygon|Circle}

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:
NameTypeDescription
jsonPolygonJSON | CircleJSON

shape json

isBody() → {boolean}

Returns:
  • body
Type: 
boolean

update(worldPosition, worldRotation, worldScale)

update world transform of shape

Parameters:
NameTypeDescription
worldPositionObject

world position

worldRotation*

world rotation useless here since this is not an ellipse but a circle

worldScaleObject

world scale

update(worldPosition, worldRotation, worldScale)

update world transform of shape

Parameters:
NameTypeDescription
worldPositionObject

world position

worldRotationObject

world rotation

worldScaleObject

world scale