这是indexloc提供的服务,不要输入任何密码
Skip to content

refactor, do we really need to despawn the editor camera on settings change? #93

@github-actions

Description

@github-actions

// TODO: refactor, do we really need to despawn the editor camera on settings change?

        return;
    }

    // TODO: refactor, do we really need to despawn the editor camera on settings change?
    let (
        focus,
        radius,
        yaw,
        pitch,
    ) = if let Some(existing_editor_cam) = existing_editor_cam {
        (
            existing_editor_cam.focus,
            existing_editor_cam.radius,
            existing_editor_cam.yaw,
            existing_editor_cam.pitch,
        )
    } else {
        let radius = match args.scene_type {
            ZeroverseSceneType::Room | ZeroverseSceneType::SemanticRoom => (
                match room_settings.room_size {
                    ScaleSampler::Bounded(_min, max) => max.max_element(),
                    ScaleSampler::Exact(size) => size.max_element(),
                }) * 2.0,
            _ => 3.5,
        }.into();

        let yaw = match args.scene_type {
            ZeroverseSceneType::Room | ZeroverseSceneType::SemanticRoom => 0.8,
            _ => 0.0,
        }.into();

        let pitch = match args.scene_type {
            ZeroverseSceneType::Room | ZeroverseSceneType::SemanticRoom => 0.8,
            _ => 0.0,
        }.into();

        (
            Vec3::ZERO.into(),
            radius,
            yaw,
            pitch,
        )
    };

    // TODO: refactor material grid reset, don't spawn editor camera outside viewer feature
    commands.spawn((
        EditorCameraMarker::default(),
        PanOrbitCamera {
            focus,
            radius,
            pitch,
            yaw,
            allow_upside_down: true,
            orbit_smoothness: args.orbit_smoothness,
            pan_smoothness: args.pan_smoothness,

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions