Skip to content

Commit e1a2717

Browse files
committed
mark serialize and deserialize as hidden instead of internal
1 parent 3446820 commit e1a2717

21 files changed

+45
-40
lines changed

.changeset/swift-eyes-cheat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"planck": patch
3+
---
4+
5+
Mark serialize and deserialize functions as @hidden instead of @internal

src/collision/shape/ChainShape.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class ChainShape extends Shape {
8282
}
8383
}
8484

85-
/** @internal */
85+
/** @hidden */
8686
_serialize(): object {
8787
const data = {
8888
type: this.m_type,
@@ -102,7 +102,7 @@ export class ChainShape extends Shape {
102102
return data;
103103
}
104104

105-
/** @internal */
105+
/** @hidden */
106106
static _deserialize(data: any, fixture: any, restore: any): ChainShape {
107107
const vertices: Vec2[] = [];
108108
if (data.vertices) {

src/collision/shape/CircleShape.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class CircleShape extends Shape {
6868
}
6969
}
7070

71-
/** @internal */
71+
/** @hidden */
7272
_serialize(): object {
7373
return {
7474
type: this.m_type,
@@ -78,7 +78,7 @@ export class CircleShape extends Shape {
7878
};
7979
}
8080

81-
/** @internal */
81+
/** @hidden */
8282
static _deserialize(data: any): CircleShape {
8383
return new CircleShape(data.p, data.radius);
8484
}

src/collision/shape/EdgeShape.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class EdgeShape extends Shape {
7373
this.m_hasVertex3 = false;
7474
}
7575

76-
/** @internal */
76+
/** @hidden */
7777
_serialize(): object {
7878
return {
7979
type: this.m_type,
@@ -88,7 +88,7 @@ export class EdgeShape extends Shape {
8888
};
8989
}
9090

91-
/** @internal */
91+
/** @hidden */
9292
static _deserialize(data: any): EdgeShape {
9393
const shape = new EdgeShape(data.vertex1, data.vertex2);
9494
if (shape.m_hasVertex0) {

src/collision/shape/PolygonShape.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class PolygonShape extends Shape {
7474
}
7575
}
7676

77-
/** @internal */
77+
/** @hidden */
7878
_serialize(): object {
7979
return {
8080
type: this.m_type,
@@ -83,7 +83,7 @@ export class PolygonShape extends Shape {
8383
};
8484
}
8585

86-
/** @internal */
86+
/** @hidden */
8787
static _deserialize(data: any, fixture: any, restore: any): PolygonShape {
8888
const vertices: Vec2[] = [];
8989
if (data.vertices) {

src/common/Vec2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ export class Vec2 {
6363
if (_ASSERT) Vec2.assert(this);
6464
}
6565

66-
/** @internal */
66+
/** @hidden */
6767
_serialize(): object {
6868
return {
6969
x: this.x,
7070
y: this.y
7171
};
7272
}
7373

74-
/** @internal */
74+
/** @hidden */
7575
static _deserialize(data: any): Vec2 {
7676
const obj = Object.create(Vec2.prototype);
7777
obj.x = data.x;

src/common/Vec3.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class Vec3 {
6161
if (_ASSERT) Vec3.assert(this);
6262
}
6363

64-
/** @internal */
64+
/** @hidden */
6565
_serialize(): object {
6666
return {
6767
x: this.x,
@@ -70,7 +70,7 @@ export class Vec3 {
7070
};
7171
}
7272

73-
/** @internal */
73+
/** @hidden */
7474
static _deserialize(data: any): Vec3 {
7575
const obj = Object.create(Vec3.prototype);
7676
obj.x = data.x;

src/dynamics/Body.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ export class Body {
288288
}
289289
}
290290

291-
/** @internal */
291+
/** @hidden */
292292
_serialize(): object {
293293
const fixtures = [];
294294
for (let f = this.m_fixtureList; f; f = f.m_next) {
@@ -305,7 +305,7 @@ export class Body {
305305
};
306306
}
307307

308-
/** @internal */
308+
/** @hidden */
309309
static _deserialize(data: any, world: any, restore: any): Body {
310310
const body = new Body(world, data);
311311

src/dynamics/Fixture.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export class Fixture {
190190
body.resetMassData();
191191
}
192192

193-
/** @internal */
193+
/** @hidden */
194194
_serialize(): object {
195195
return {
196196
friction: this.m_friction,
@@ -206,7 +206,7 @@ export class Fixture {
206206
};
207207
}
208208

209-
/** @internal */
209+
/** @hidden */
210210
static _deserialize(data: any, body: any, restore: any): Fixture {
211211
const shape = restore(Shape, data.shape);
212212
const fixture = shape && new Fixture(body, shape, data);

src/dynamics/World.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export class World {
190190
this.m_step_callback = [];
191191
}
192192

193-
/** @internal */
193+
/** @hidden */
194194
_serialize(): object {
195195
const bodies = [];
196196
const joints = [];
@@ -213,7 +213,7 @@ export class World {
213213
};
214214
}
215215

216-
/** @internal */
216+
/** @hidden */
217217
static _deserialize(data: any, context: any, restore: any): World {
218218
if (!data) {
219219
return new World();

src/dynamics/joint/DistanceJoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export class DistanceJoint extends Joint {
164164
// = invMass1 + invI1 * cross(r1, u)^2 + invMass2 + invI2 * cross(r2, u)^2
165165
}
166166

167-
/** @internal */
167+
/** @hidden */
168168
_serialize(): object {
169169
return {
170170
type: this.m_type,
@@ -185,7 +185,7 @@ export class DistanceJoint extends Joint {
185185
};
186186
}
187187

188-
/** @internal */
188+
/** @hidden */
189189
static _deserialize(data: any, world: any, restore: any): DistanceJoint {
190190
data = {...data};
191191
data.bodyA = restore(Body, data.bodyA, world);

src/dynamics/joint/FrictionJoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export class FrictionJoint extends Joint {
137137
// K = invI1 + invI2
138138
}
139139

140-
/** @internal */
140+
/** @hidden */
141141
_serialize(): object {
142142
return {
143143
type: this.m_type,
@@ -153,7 +153,7 @@ export class FrictionJoint extends Joint {
153153
};
154154
}
155155

156-
/** @internal */
156+
/** @hidden */
157157
static _deserialize(data: any, world: any, restore: any): FrictionJoint {
158158
data = {...data};
159159
data.bodyA = restore(Body, data.bodyA, world);

src/dynamics/joint/GearJoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export class GearJoint extends Joint {
232232
// K = J * invM * JT = invMass + invI * cross(r, ug)^2
233233
}
234234

235-
/** @internal */
235+
/** @hidden */
236236
_serialize(): object {
237237
return {
238238
type: this.m_type,
@@ -248,7 +248,7 @@ export class GearJoint extends Joint {
248248
};
249249
}
250250

251-
/** @internal */
251+
/** @hidden */
252252
static _deserialize(data: any, world: any, restore: any): GearJoint {
253253
data = {...data};
254254
data.bodyA = restore(Body, data.bodyA, world);

src/dynamics/joint/MotorJoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export class MotorJoint extends Joint {
141141
// K = invI1 + invI2
142142
}
143143

144-
/** @internal */
144+
/** @hidden */
145145
_serialize(): object {
146146
return {
147147
type: this.m_type,
@@ -158,7 +158,7 @@ export class MotorJoint extends Joint {
158158
};
159159
}
160160

161-
/** @internal */
161+
/** @hidden */
162162
static _deserialize(data: any, world: any, restore: any): MotorJoint {
163163
data = {...data};
164164
data.bodyA = restore(Body, data.bodyA, world);

src/dynamics/joint/MouseJoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export class MouseJoint extends Joint {
160160
// w k % (rx i + ry j) = w * (-ry i + rx j)
161161
}
162162

163-
/** @internal */
163+
/** @hidden */
164164
_serialize(): object {
165165
return {
166166
type: this.m_type,
@@ -177,7 +177,7 @@ export class MouseJoint extends Joint {
177177
};
178178
}
179179

180-
/** @internal */
180+
/** @hidden */
181181
static _deserialize(data: any, world: any, restore: any): MouseJoint {
182182
data = {...data};
183183
data.bodyA = restore(Body, data.bodyA, world);

src/dynamics/joint/PrismaticJoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ export class PrismaticJoint extends Joint {
272272
// df = f2 - f1
273273
}
274274

275-
/** @internal */
275+
/** @hidden */
276276
_serialize(): object {
277277
return {
278278
type: this.m_type,
@@ -294,7 +294,7 @@ export class PrismaticJoint extends Joint {
294294
};
295295
}
296296

297-
/** @internal */
297+
/** @hidden */
298298
static _deserialize(data: any, world: any, restore: any): PrismaticJoint {
299299
data = {...data};
300300
data.bodyA = restore(Body, data.bodyA, world);

src/dynamics/joint/PulleyJoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class PulleyJoint extends Joint {
163163
// cross(r2, u2)^2)
164164
}
165165

166-
/** @internal */
166+
/** @hidden */
167167
_serialize(): object {
168168
return {
169169
type: this.m_type,
@@ -181,7 +181,7 @@ export class PulleyJoint extends Joint {
181181
};
182182
}
183183

184-
/** @internal */
184+
/** @hidden */
185185
static _deserialize(data: any, world: any, restore: any): PulleyJoint {
186186
data = {...data};
187187
data.bodyA = restore(Body, data.bodyA, world);

src/dynamics/joint/RevoluteJoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export class RevoluteJoint extends Joint {
224224
// K = invI1 + invI2
225225
}
226226

227-
/** @internal */
227+
/** @hidden */
228228
_serialize(): object {
229229
return {
230230
type: this.m_type,
@@ -245,7 +245,7 @@ export class RevoluteJoint extends Joint {
245245
};
246246
}
247247

248-
/** @internal */
248+
/** @hidden */
249249
static _deserialize(data: any, world: any, restore: any):RevoluteJoint {
250250
data = {...data};
251251
data.bodyA = restore(Body, data.bodyA, world);

src/dynamics/joint/RopeJoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class RopeJoint extends Joint {
139139
// = invMassA + invIA * cross(rA, u)^2 + invMassB + invIB * cross(rB, u)^2
140140
}
141141

142-
/** @internal */
142+
/** @hidden */
143143
_serialize(): object {
144144
return {
145145
type: this.m_type,
@@ -153,7 +153,7 @@ export class RopeJoint extends Joint {
153153
};
154154
}
155155

156-
/** @internal */
156+
/** @hidden */
157157
static _deserialize(data: any, world: any, restore: any): RopeJoint {
158158
data = {...data};
159159
data.bodyA = restore(Body, data.bodyA, world);

src/dynamics/joint/WeldJoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class WeldJoint extends Joint {
163163
// K = invI1 + invI2
164164
}
165165

166-
/** @internal */
166+
/** @hidden */
167167
_serialize(): object {
168168
return {
169169
type: this.m_type,
@@ -180,7 +180,7 @@ export class WeldJoint extends Joint {
180180
};
181181
}
182182

183-
/** @internal */
183+
/** @hidden */
184184
static _deserialize(data: any, world: any, restore: any): WeldJoint {
185185
data = {...data};
186186
data.bodyA = restore(Body, data.bodyA, world);

src/dynamics/joint/WheelJoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export class WheelJoint extends Joint {
218218
// J = [0 0 -1 0 0 1]
219219
}
220220

221-
/** @internal */
221+
/** @hidden */
222222
_serialize(): object {
223223
return {
224224
type: this.m_type,
@@ -238,7 +238,7 @@ export class WheelJoint extends Joint {
238238
};
239239
}
240240

241-
/** @internal */
241+
/** @hidden */
242242
static _deserialize(data: any, world: any, restore: any): WheelJoint {
243243
data = {...data};
244244
data.bodyA = restore(Body, data.bodyA, world);

0 commit comments

Comments
 (0)