Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
Signed-off-by: Hannah Bollar <[email protected]>
  • Loading branch information
hanbollar committed Nov 14, 2023
1 parent 40af46b commit 53fa58e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/component-systems/RapierPhysicsSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class RapierPhysicsSystem extends System {
this.touchDelta.subVectors(this.tempLocalPosition, this.tempPreviousPosition)

entity.dispatchEvent(
new CustomEvent(`touch`, {
new CustomEvent('touch', {
bubbles: true,
detail: {
joint,
Expand Down Expand Up @@ -157,7 +157,7 @@ export class RapierPhysicsSystem extends System {

// Contact information can be read from `manifold`.
entity.dispatchEvent(
new CustomEvent(`click`, {
new CustomEvent('click', {
bubbles: true,
detail: {
worldPosition: this.tempWorldPosition,
Expand All @@ -166,7 +166,7 @@ export class RapierPhysicsSystem extends System {
})
)
entity.dispatchEvent(
new CustomEvent(`touch-start`, {
new CustomEvent('touch-start', {
bubbles: true,
detail: {
worldPosition: this.tempWorldPosition,
Expand All @@ -185,7 +185,7 @@ export class RapierPhysicsSystem extends System {
this.tempWorldPosition.set(0, 0, 0)
entity.touch = false
entity.dispatchEvent(
new CustomEvent(`touch-end`, {
new CustomEvent('touch-end', {
bubbles: true,
})
)
Expand All @@ -197,7 +197,7 @@ export class RapierPhysicsSystem extends System {
this.tempWorldPosition.copy(manifold.localContactPoint2(0))
entity.object3D.localToWorld(this.tempWorldPosition)
entity.dispatchEvent(
new CustomEvent(`hover-start`, {
new CustomEvent('hover-start', {
bubbles: true,
detail: {
worldPosition: this.tempWorldPosition,
Expand All @@ -210,7 +210,7 @@ export class RapierPhysicsSystem extends System {

hoverEnd = (entity) => {
entity.dispatchEvent(
new CustomEvent(`hover-end`, {
new CustomEvent('hover-end', {
bubbles: true,
})
)
Expand Down
1 change: 1 addition & 0 deletions src/core/MRApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { parseAttributeString, parseVector } from '../utils/parser.js'
import { SurfaceSystem } from '../component-systems/SurfaceSystem.js'
import { ClippingSystem } from '../component-systems/ClippingSystem'
import { StyleSystem } from '../component-systems/StyleSystem'

;('use strict')

window.mobileCheck = function () {
Expand Down
4 changes: 2 additions & 2 deletions src/core/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default class Entity extends MRElement {
this.connected()

document.addEventListener('engine-started', (event) => {
this.dispatchEvent(new CustomEvent(`new-entity`, { bubbles: true }))
this.dispatchEvent(new CustomEvent('new-entity', { bubbles: true }))
})

this.addEventListener('touch-start', (event) => {
Expand All @@ -168,7 +168,7 @@ export default class Entity extends MRElement {
this.onHover(event)
})

this.dispatchEvent(new CustomEvent(`new-entity`, { bubbles: true }))
this.dispatchEvent(new CustomEvent('new-entity', { bubbles: true }))
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/core/rapier.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ export let RAPIER = null

import('@dimforge/rapier3d').then((rap) => {
RAPIER = rap
document.dispatchEvent(new CustomEvent(`engine-started`, { bubbles: true }))
document.dispatchEvent(new CustomEvent('engine-started', { bubbles: true }))
})
2 changes: 1 addition & 1 deletion src/entities/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class Model extends Entity {

this.object3D.add(mesh)

this.dispatchEvent(new CustomEvent(`new-entity`, { bubbles: true }))
this.dispatchEvent(new CustomEvent('new-entity', { bubbles: true }))
})
}

Expand Down

0 comments on commit 53fa58e

Please sign in to comment.