Skip to content

Arguments in the update function in the Cube.kt file is swapped #643

@wilfredbtan

Description

@wilfredbtan

In the Cube::update function, size and center is swapped so if you call update it'll mess up the geometry.

The fix should be simple but didn't have time to make any tests to submit a proper PR so thought I'd flag this up first.

    fun update(
        engine: Engine,
        center: Position = this.center,
        size: Size = this.size
    ) = apply {
        update(engine = engine, vertices = getVertices(center, size)) // size and center are swapped

       // Fix should just be to swap them back i.e.
       // getVertices(size, center)

        this.center = center
        this.size = size
    }

https://github.com/SceneView/sceneview-android/blob/cb3e2645c747d606b4259f0df46639a8f936da9a/sceneview/src/main/java/io/github/sceneview/geometries/Cube.kt#L62

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