AryanpurTech / BlueEngine

Blue Engine is a general-purpose and easy-to-use graphics engine written in rust.
Apache License 2.0
316 stars 14 forks source link

Sizing seems to be adding only #22

Closed rustylabs closed 1 year ago

rustylabs commented 1 year ago

inside objects_settings.rs:

            println!("object.1.size[0].value: {}", object.1.size[0].value);
            //square(object.0.label.0.clone(), header::ObjectSettings::default(), renderer, gameengine_objects).unwrap();
            square(
                object.0.label.0.clone(),
                header::ObjectSettings
                {
                    //size                : (100f32, 100f32, 100f32),
                    size                : (object.1.size[0].value, object.1.size[1].value, object.1.size[2].value),
                    scale               : (1f32, 1f32, 1f32),
                    position            : (object.1.position[0].value, object.1.position[1].value, object.1.position[2].value),
                    color               : Array4{data: utils::default_resources::DEFAULT_COLOR},
                    camera_effect       : true,
                    shader_settings     : ShaderSettings::default(),
                },
                renderer,
                gameengine_objects,
                ).unwrap();

so this should set the size. The default is set to 1f32, 1f32, 1f32.

so I might set the x size to 1.3 which sizes just fine. But after saving it and opening the file again while the value is at 1.3, it is back to the original size and when I move the slider, it will add to it. See the gif to see what is happening:

QLQ9PRnhcB

also by hardcoding it and setting the size like this size : (150f32, 100f32, 100f32), still draws a perfect square as shown in this image:

image

I have confirmed that my get_mut resize is not called until I modify the values

ElhamAryanpur commented 1 year ago

This is not an engine issue, it should be done through the resize function on your own program.

ElhamAryanpur commented 1 year ago

But the size parameter in setting, yes it is an engine issue there.

rustylabs commented 1 year ago

@ElhamAryanpur

But the size parameter in setting, yes it is an engine issue there.

I thought it was already solved, anyways looking forward for the fix.

ElhamAryanpur commented 1 year ago

yes, because it won't be solved, just pushed changes to remove it entirely. All transformation options in ObjectSettings are now removed.

Please use the functions with the object to have those changes.

rustylabs commented 1 year ago

@ElhamAryanpur I see thanks.