Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
splines
Browse files Browse the repository at this point in the history
  • Loading branch information
HexaField committed May 24, 2024
1 parent cd1eabd commit 58ca210
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/Splines.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { VisibleComponent } from '@etherealengine/spatial/src/renderer/component
import { TransformComponent } from '@etherealengine/spatial/src/transform/components/TransformComponent'
import { BoxGeometry, Mesh, MeshBasicMaterial, Quaternion, SphereGeometry, Vector3 } from 'three'
import { Template } from './utils/template'
import { NodeID } from '@etherealengine/spatial/src/transform/components/NodeIDComponent'

const createSpline = (index = 0) => {
const entity = createEntity()
Expand Down Expand Up @@ -61,14 +62,14 @@ export default function Splines() {
}

setComponent(trackEntity, SplineTrackComponent, {
splineEntityUUID: `Spline: 0` as EntityUUID,
splineNodeID: `Spline: 0` as NodeID,
velocity: 5
})

setInterval(() => {
const spline = Math.floor(Math.random() * 4)
setComponent(trackEntity, SplineTrackComponent, {
splineEntityUUID: `Spline: ${spline}` as EntityUUID
splineNodeID: `Spline: ${spline}` as NodeID
})
}, 5000)
}, [])
Expand Down

0 comments on commit 58ca210

Please sign in to comment.