Exemplo n.º 1
0
void BoxLightGob::Update(float dt)
{
    UpdateWorldTransform();
    if(m_boundsDirty)
    {
        m_localBounds = m_mesh->bounds;        
        UpdateWorldAABB();
    }
    m_light->min = m_bounds.Min();
    m_light->max = m_bounds.Max();
}
Exemplo n.º 2
0
void Spatial::GeometricStateUpdate()
{
	UpdateWorldTransform();
	//Propogate World Bounds To Root {
	Spatial * parent = GetParentAs<Spatial>();
	while (parent != NULL)
	{
		parent->UpdateWorldBound();
		parent = parent->GetParentAs<Spatial>();
	}
	//Propogate World Bounds To Root }
}
Exemplo n.º 3
0
    void GameObject::Update(const FrameTime& fr, UpdateTypeEnum updateType)
    {        
        m_worldXformUpdated = false;
        m_worldBoundUpdated = false;

        for( auto it = m_components.begin(); it != m_components.end(); ++it)
        {
            (*it)->Update(fr,updateType);
        }
        UpdateWorldTransform();
        UpdateWorldAABB();
    }
Exemplo n.º 4
0
void lcNode::Update()
{
	UpdateWorldTransform();

	if(m_uiChildCount > 0)
	{
		for(unsigned int i = 0;i < m_uiChildCount;i++)
		{
			lcNode* pChild = GetAt(i);
			pChild->Update();
		}
	}
}
Exemplo n.º 5
0
    void Locator::Update(float dt)
    {       
        bool udpateXforms = m_worldDirty;
        UpdateWorldTransform();
        Model* model = m_resource ? (Model*)m_resource->GetTarget() : NULL;                     
        if( model && model->IsReady())
        {
            if(m_modelTransforms.empty() || udpateXforms)
            {
                 const MatrixList& matrices = model->AbsoluteTransforms();
                 m_modelTransforms.resize(matrices.size());
                 for( unsigned int i = 0; i < m_modelTransforms.size(); ++i)
                 {
                     m_modelTransforms[i] = matrices[i] * m_world; // transform matrix array now holds complete world transform.
                 }
                 BuildRenderables();
                 m_boundsDirty = true;
            }                               
        }

        if(m_boundsDirty)        
        {                  
            if(!m_modelTransforms.empty())
            {                
               // assert(model && model->IsReady());
                m_localBounds = model->GetBounds();                                
                if(m_parent) m_parent->InvalidateBounds();                
            }
            else
            {
                m_localBounds = AABB(float3(-0.5f,-0.5f,-0.5f), float3(0.5f,0.5f,0.5f));                
            }      
            this->UpdateWorldAABB();            
        }

        if(RenderContext::Inst()->LightEnvDirty)
        {
            // update light env.
            for(auto  renderNode = m_renderables.begin(); renderNode != m_renderables.end(); renderNode++)
            {
                LightingState::Inst()->UpdateLightEnvironment(*renderNode);
            }
        }         
    }
Exemplo n.º 6
0
void tBillboardBatch::Normalize( const tVector3d& camPosition )
{
    tWriteLocker lock(&m_BatchLock);

    tVector3d geoOffset(m_Offset);    

    if (Mapping::NormalizePosition(geoOffset, camPosition) == true)
    {
        m_Offset = tVector2d(geoOffset.x, geoOffset.y);

        UpdateWorldTransform();

        for(int i = 0; i < m_Billboards.size(); ++i)
        {
            m_Billboards[i].xBillboard->Normalize(camPosition);
        }

        Commit();
    }
}
Exemplo n.º 7
0
tBillboardBatch::tBillboardBatch(
        const tVector2d& offset, 
        boost::shared_ptr<tTextureAtlas> xTextureAtlas,
        QList<tBillboardBatchItem>& billboards)
    : m_Billboards(billboards)
    , m_xTextureAtlas(xTextureAtlas)
    , m_xTextureUnitSettings(new tTextureUnitSettings())
    , m_Offset(offset)
    , m_WorldTransform()
    , m_NumVertices(0)
    , m_xVBAccess()
    , m_xRenderOperation()
    , m_BatchLock("tGeoBillboardBatch::m_BatchLock")
{
    m_xTextureUnitSettings->SetBlendSettings(tTextureUnitSettings::eTBP_Replace);

    UpdateWorldTransform();

    m_InstanceCount++;
}
Exemplo n.º 8
0
	cMatrixf& iEntity3D::GetWorldMatrix()
	{
		UpdateWorldTransform();
		
		return m_mtxWorldTransform;
	}
Exemplo n.º 9
0
	cVector3f iEntity3D::GetWorldPosition()
	{
		UpdateWorldTransform();

		return m_mtxWorldTransform.GetTranslation();
	}
Exemplo n.º 10
0
void ControlPointGob::Update(float dt)
{
    UpdateWorldTransform();
    UpdateWorldAABB();
}
Exemplo n.º 11
0
	cMatrixf& cNode3D::GetWorldMatrix()
	{
		UpdateWorldTransform();

		return m_mtxWorldTransform;
	}