|
@ -40,54 +40,25 @@ class Scene extends BaseCfg |
|
|
|
|
|
|
|
|
public function addobjects($obj) |
|
|
public function addobjects($obj) |
|
|
{ |
|
|
{ |
|
|
$temp = null; |
|
|
|
|
|
$attributeArr = get_object_vars($obj); |
|
|
|
|
|
|
|
|
|
|
|
$className = get_class($obj); |
|
|
|
|
|
$className = array_reverse(explode('\\', $className))[0]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch($className) |
|
|
|
|
|
{ |
|
|
|
|
|
case 'Objects': |
|
|
|
|
|
|
|
|
$temp = null; |
|
|
$temp = sprintf("%014d",count($this->objects)+1); |
|
|
$temp = sprintf("%014d",count($this->objects)+1); |
|
|
$this->objects[$temp] = $obj; |
|
|
$this->objects[$temp] = $obj; |
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'MaterialsBase': |
|
|
|
|
|
$temp = $obj->type.'_'.sprintf("%014d",count($this->materials)+1); |
|
|
|
|
|
$this->materials[$temp] = $obj; |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'VolumesBase': |
|
|
|
|
|
$temp = $obj->type.'_'.sprintf("%014d",count($this->volumes)+1); |
|
|
|
|
|
$this->volumes[$temp] = $obj; |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'TextureBase': |
|
|
|
|
|
$temp = $obj->type.'_'.sprintf("%014d",count($this->textures)+1); |
|
|
|
|
|
$this->textures[$temp] = $obj; |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
foreach( $attributeArr as $key => $value) |
|
|
|
|
|
{ |
|
|
|
|
|
if( $value instanceof texture\TextureBase || $value instanceof materials\MaterialsBase || $value instanceof volumes\VolumesBase ) |
|
|
|
|
|
|
|
|
public function addmaterial($material) |
|
|
{ |
|
|
{ |
|
|
$obj->$key = $this->addobjects( $value ); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$temp = null; |
|
|
|
|
|
$temp = $material->type.'_'.sprintf("%014d",count($this->materials)+1); |
|
|
|
|
|
$this->materials[$temp] = $material; |
|
|
return $temp; |
|
|
return $temp; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
|
public function addObject( object $object ) |
|
|
public function addObject( object $object ) |
|
|
{ |
|
|
{ |
|
|