30void CameraComponent::initialize() {
34 if ( !m_renderObjects.empty() )
return;
37 Ra::Core::Geometry::LineMesh triMesh;
39 { -.5_ra, -.5_ra, -1_ra },
40 { -.5_ra, .5_ra, -1_ra },
41 { .5_ra, .5_ra, -1_ra },
42 { .5_ra, -.5_ra, -1_ra },
43 { -.3_ra, .5_ra, -1_ra },
44 { 0_ra, .7_ra, -1_ra },
45 { .3_ra, .5_ra, -1_ra } } );
61 auto mat = Core::make_shared<PlainMaterial>( m_name +
"_Material" );
62 mat->setColor( { 1_ra, .5_ra, 0_ra, 1_ra } );
63 mat->setColoredByVertexAttrib(
false );
64 m_RO = Rendering::RenderObject::createRenderObject( m_name +
"_RO",
66 Rendering::RenderObjectType::Geometry,
70 m_RO->setLocalTransform( m_camera->getFrame() );
72 m_RO->setMaterial( mat );
74 m_RO->setPickable(
true );
75 addRenderObject( m_RO );
94 new CameraComponent { cloneEntity, cloneName, m_camera->getWidth(), m_camera->getHeight() };
95 cam->getCamera()->
setFrame( m_camera->getFrame() );
96 cam->getCamera()->setProjMatrix( m_camera->getProjMatrix() );
97 cam->getCamera()->setType( m_camera->getType() );
98 cam->getCamera()->setZoomFactor( m_camera->getZoomFactor() );
99 cam->getCamera()->setFOV( m_camera->getFOV() );
100 cam->getCamera()->setZNear( m_camera->getZNear() );
101 cam->getCamera()->setZFar( m_camera->getZFar() );