| 172 | } |
| 173 | |
| 174 | void EveVirtualCamera::Update( float deltaTime ) |
| 175 | { |
| 176 | if( !m_isRunning ) |
| 177 | { |
| 178 | deltaTime = 0.0f; |
| 179 | } |
| 180 | |
| 181 | m_localElapsedTime += deltaTime; |
| 182 | |
| 183 | m_positionAnchorCenter = GetCenterOfAnchors( m_positionAnchors ); |
| 184 | m_positionAnchorForwardDirection = GetForwardDirectionOfAnchors( m_positionAnchors ); |
| 185 | m_positionAnchorRadius = GetAnchorsBoundingSphereRadius( m_positionAnchors, m_positionAnchorCenter ); |
| 186 | |
| 187 | m_pointOfInterestAnchorCenter = GetCenterOfAnchors( m_pointOfInterestAnchors ); |
| 188 | m_pointOfInterestAnchorForwardDirection = GetForwardDirectionOfAnchors( m_pointOfInterestAnchors ); |
| 189 | m_pointOfInterestAnchorRadius = GetAnchorsBoundingSphereRadius( m_pointOfInterestAnchors, m_pointOfInterestAnchorCenter ); |
| 190 | |
| 191 | auto position = m_positionAnchorCenter; |
| 192 | auto pointOfInterest = m_pointOfInterestAnchorCenter; |
| 193 | auto fov = 1.0f; |
| 194 | auto roll = 0.0f; |
| 195 | |
| 196 | for( auto it = m_positionBehaviours.begin(); it != m_positionBehaviours.end(); ++it ) |
| 197 | { |
| 198 | if( ( *it )->IsActive() ) |
| 199 | { |
| 200 | position += ( *it )->Update( *this, position, deltaTime, m_localElapsedTime, m_positionAnchorCenter, m_positionAnchorRadius, m_positionAnchorForwardDirection ); |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | for( auto it = m_pointOfInterestBehaviours.begin(); it != m_pointOfInterestBehaviours.end(); ++it ) |
| 205 | { |
| 206 | if( ( *it )->IsActive() ) |
| 207 | { |
| 208 | pointOfInterest += ( *it )->Update( *this, pointOfInterest, deltaTime, m_localElapsedTime, m_pointOfInterestAnchorCenter, m_pointOfInterestAnchorRadius, m_pointOfInterestAnchorForwardDirection ); |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | for( auto it = m_fovBehaviours.begin(); it != m_fovBehaviours.end(); ++it ) |
| 213 | { |
| 214 | if( ( *it )->IsActive() ) |
| 215 | { |
| 216 | fov += ( *it )->Update( *this, fov, deltaTime, m_localElapsedTime, m_positionAnchorCenter, m_positionAnchorRadius, m_positionAnchorForwardDirection ); |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | for( auto it = m_rollBehaviours.begin(); it != m_rollBehaviours.end(); ++it ) |
| 221 | { |
| 222 | if( ( *it )->IsActive() ) |
| 223 | { |
| 224 | roll += ( *it )->Update( *this, roll, deltaTime, m_localElapsedTime, m_positionAnchorCenter, m_positionAnchorRadius, m_positionAnchorForwardDirection ); |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | if( m_positionBehaviours.size() > 0 ) |
| 229 | { |
| 230 | m_position = position; |
| 231 | } |
nothing calls this directly
no test coverage detected