Skip to content

Create paths for your apps using just an array of points.

License

Notifications You must be signed in to change notification settings

mrzilvis/RealityKit-Path-Maker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RKPath

This package makes it easy to generate paths in RealityKit. There is an example project included in this repo to show you how to use it. After you add the swift package and import RKPath,

  1. Initialize a new path entity like this:
     var pathEntity = RKPathEntity(path: [])

or like this:

     var pathEntity = RKPathEntity(path: [],
                                 width: 0.35,
                                 materials: [UnlitMaterial.init(color: .blue)])
  1. Add your path entity to an anchor that is anchored in the scene like this;
        let worldAnchor = AnchorEntity() //point 0,0,0
        self.scene.addAnchor(worldAnchor)
        worldAnchor.addChild(pathEntity)
  1. Add points to your path and it will automatically update:
        let myNewPoint = SIMD3<Float>()
        self.pathEntity.pathPoints.append(myNewPoint)

About

Create paths for your apps using just an array of points.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 100.0%