Example #1
0
 /**
  * Add all used primitevs to the scene
  *
  * @return void
  */
 protected function preparePrimitives()
 {
     /* Primitive collections */
     $this->aframeDomObj->appendEntities($this->childrens);
     /* Primitives which only one can be present */
     !$this->sky ?: $this->aframeDomObj->appendEntity($this->sky);
     !$this->videosphere ?: $this->aframeDomObj->appendEntity($this->videosphere);
 }
Example #2
0
 /**
  * Add everyting to DOM
  *
  * @return void
  */
 protected function prepare()
 {
     if ($this->prepared) {
         return;
     }
     /* Append all assets */
     $assets = $this->assets->getAssets();
     !$assets ?: $this->aframeDomObj->appendAssets($assets);
     /* Append all primitives */
     $this->preparePrimitives();
     /* Append all entities */
     $this->aframeDomObj->appendEntities($this->entities);
     $this->aframeDomObj->appendSceneComponents($this->components);
     $this->prepared = true;
 }