MCPcopy
hub / github.com/piqnt/planck.js / constructor

Method constructor

src/collision/shape/EdgeShape.ts:54–72  ·  view source on GitHub ↗
(v1?: Vec2Value, v2?: Vec2Value)

Source from the content-addressed store, hash-verified

52 /** @hidden */ m_hasVertex3: boolean;
53
54 constructor(v1?: Vec2Value, v2?: Vec2Value) {
55 // @ts-ignore
56 if (_CONSTRUCTOR_FACTORY && !(this instanceof EdgeShape)) {
57 return new EdgeShape(v1, v2);
58 }
59
60 super();
61
62 this.m_type = EdgeShape.TYPE;
63 this.m_radius = Settings.polygonRadius;
64
65 this.m_vertex1 = v1 ? Vec2.clone(v1) : Vec2.zero();
66 this.m_vertex2 = v2 ? Vec2.clone(v2) : Vec2.zero();
67
68 this.m_vertex0 = Vec2.zero();
69 this.m_vertex3 = Vec2.zero();
70 this.m_hasVertex0 = false;
71 this.m_hasVertex3 = false;
72 }
73
74 /** @hidden */
75 _serialize(): object {

Callers

nothing calls this directly

Calls 2

cloneMethod · 0.45
zeroMethod · 0.45

Tested by

no test coverage detected