Skip to content

EveChildLineSet calculates screen size from a local-space bounding sphere #36

Description

@cppctamber

Status:
Confirmed from source

Source version:
Carbon v5.0.0, commit 342fbe595b572070e09b583a03e215011f5924e9

Notes
I do not have a runnable Carbon build, so this was not reproduced at runtime.

Source
Eve/SpaceObject/Children/EveChildLineSet.cpp:207-212:

Vector4 sphere = m_boundingSphere;
BoundingSphereTransform( m_worldTransform, sphere );

if( frustum.IsSphereVisible( &( sphere ) ) )
{
    m_currentScreenSize =
        frustum.GetPixelSizeAccross( &m_boundingSphere );

The transformed sphere is used for visibility, but pixel size is calculated from the original m_boundingSphere.

That sphere appears to be local-space: it is assigned before the world transform at :186, while the debug draw composes it with m_worldTransform at :540.

Consequently, screen size is calculated as though the local-space sphere were already in world space. Parent translation, rotation, and scale are ignored, so LOD can use the wrong camera distance and radius.

Related question

I also found no application of the scene lodFactor in EveChildLineSet. For comparison, EveChildCloud.cpp:224 scales its minimum screen size using GetLodFactor(). I could not determine whether line sets intentionally ignore that setting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions