Skip to content

Commit db0a1a4

Browse files
committed
fix(typo): correct physic to physics
1 parent e087f60 commit db0a1a4

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

examples/jsm/physics/RapierPhysics.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ let RAPIER = null;
3838
/**
3939
* @initial_author mrdoob | [email protected]
4040
*
41-
* @description Physic helper based on `Rapier`
41+
* @description Physics helper based on `Rapier`
4242
*
4343
* @docs https://rapier.rs/docs/api/javascript/JavaScript3D/
4444
*/
@@ -104,8 +104,8 @@ export class Physics {
104104

105105
const physicsProperties =
106106
object instanceof InstancedMesh
107-
? this.createInstancedPhysicProperties(object, colliderDesc, mass)
108-
: this.createPhysicProperties(
107+
? this.createInstancedPhysicsProperties(object, colliderDesc, mass)
108+
: this.createPhysicsProperties(
109109
colliderDesc,
110110
object.position,
111111
object.quaternion,
@@ -257,14 +257,14 @@ export class Physics {
257257
* @param {Rapier.ColliderDesc} colliderDesc {@link Rapier.ColliderDesc}
258258
* @param {number | undefined} mass
259259
*/
260-
createInstancedPhysicProperties(mesh, colliderDesc, mass) {
260+
createInstancedPhysicsProperties(mesh, colliderDesc, mass) {
261261
const array = mesh.instanceMatrix.array;
262262
const bodies = [];
263263

264264
for (let i = 0; i < mesh.count; i++) {
265265
const position = this._vector.fromArray(array, i * 16 + 12);
266266
bodies.push(
267-
this.createPhysicProperties(colliderDesc, position, null, mass)
267+
this.createPhysicsProperties(colliderDesc, position, null, mass)
268268
);
269269
}
270270

@@ -279,7 +279,7 @@ export class Physics {
279279
* @param {Rapier.Rotation} rotation {@link Rapier.Rotation}
280280
* @param {number | null | undefined} mass
281281
*/
282-
createPhysicProperties(colliderDesc, position, rotation, mass = 0) {
282+
createPhysicsProperties(colliderDesc, position, rotation, mass = 0) {
283283
const rigidBodyDesc =
284284
mass > 0
285285
? this.rapier.RigidBodyDesc.dynamic()
@@ -297,7 +297,7 @@ export class Physics {
297297
* @param {Object3DWithGeometry} object
298298
* @param {number | number} index
299299
*/
300-
getPhysicPropertiesFromObject(object, index = 0) {
300+
getPhysicsPropertiesFromObject(object, index = 0) {
301301
const _physicsProperties = this.dynamicObjectMap.get(object);
302302
/** @type {PhysicsProperties} */
303303
let body;
@@ -322,7 +322,7 @@ export class Physics {
322322
*/
323323
setObjectPosition(object, position, index = 0) {
324324
/** @description Object physics properties (rigid body, collider, ...). */
325-
const physicsProperties = this.getPhysicPropertiesFromObject(object, index);
325+
const physicsProperties = this.getPhysicsPropertiesFromObject(object, index);
326326
if (!physicsProperties) return;
327327

328328
const _vectorZero = new this.rapier.Vector3(0, 0, 0);
@@ -340,7 +340,7 @@ export class Physics {
340340
* @param {number | undefined} index
341341
*/
342342
setObjectVelocity(object, velocity, index = 0) {
343-
const physicsProperties = this.getPhysicPropertiesFromObject(object, index);
343+
const physicsProperties = this.getPhysicsPropertiesFromObject(object, index);
344344
if (!physicsProperties) return;
345345

346346
physicsProperties.rigidBody.setLinvel(velocity, true);
@@ -366,7 +366,7 @@ export class Physics {
366366
const bodies = this.dynamicObjectMap.get(object);
367367

368368
for (let j = 0; j < bodies.length; j++) {
369-
const physicProperties = bodies[j];
369+
const physicsProperties = bodies[j];
370370

371371
/** @type {Vector3} */
372372
let position = this._position;
@@ -379,10 +379,10 @@ export class Physics {
379379
this._matrix.decompose(position, quaternion, scale);
380380

381381
position = this._position.copy(
382-
physicProperties.rigidBody.translation()
382+
physicsProperties.rigidBody.translation()
383383
);
384384
quaternion = this._quaternion.copy(
385-
physicProperties.rigidBody.rotation()
385+
physicsProperties.rigidBody.rotation()
386386
);
387387
scale = this._scale.copy(scale);
388388

@@ -404,7 +404,7 @@ export class Physics {
404404
}
405405

406406
/**
407-
* @description Remove the specified object to the physic `world`.
407+
* @description Remove the specified object to the physics `world`.
408408
*
409409
* @param {Object3D} object Object3D based.
410410
*/

examples/physics_rapier_instancing.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
let physics, position;
3434

3535
let boxes, spheres;
36-
let physicBoxes = [], physicSpheres = [];
36+
let physicsBoxes = [], physicsSpheres = [];
3737

3838
init();
3939

@@ -113,8 +113,8 @@
113113
}
114114

115115
physics.addToWorld( floor, 0 );
116-
physicBoxes = physics.addToWorld( boxes, 1 );
117-
physicSpheres = physics.addToWorld( spheres, 1 );
116+
physicsBoxes = physics.addToWorld( boxes, 1 );
117+
physicsSpheres = physics.addToWorld( spheres, 1 );
118118

119119
//
120120

@@ -131,7 +131,7 @@
131131

132132
document.querySelector( 'button#shake' ).addEventListener( 'click', () => {
133133

134-
[ ...physicBoxes, ...physicSpheres ].map( ( item ) => {
134+
[ ...physicsBoxes, ...physicsSpheres ].map( ( item ) => {
135135

136136
item.rigidBody.applyImpulse(
137137
{

0 commit comments

Comments
 (0)