|
|
@ -116,13 +116,19 @@ class Scene extends BaseCfg |
|
|
|
*/ |
|
|
|
public function registerCamera(&$camera) |
|
|
|
{ |
|
|
|
$id = $camera->type.'_'.sprintf("%014d",$camera->id); |
|
|
|
$camera->registerId = $id; |
|
|
|
$this->cameras[$id] = $camera; |
|
|
|
$this->cameras = []; |
|
|
|
foreach( get_object_vars($camera) as $key => $value ) |
|
|
|
{ |
|
|
|
if($value != null) |
|
|
|
{ |
|
|
|
$key = implode(".", array_map('strtolower', StringHelper::camelStrToArray($key))); |
|
|
|
$this->cameras[$key] = $value; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param object $camera 接收一个相机类对象,为其颁发一个注册信息,并将其存到Scene |
|
|
|
* @param object $camera 接收一个World类对象,为其颁发一个注册信息,并将其存到Scene |
|
|
|
*/ |
|
|
|
public function registerWorld(&$world) |
|
|
|
{ |
|
|
|