Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turn(0.0) does not stop turning #44

Open
lestofante opened this issue Oct 14, 2023 · 0 comments
Open

turn(0.0) does not stop turning #44

lestofante opened this issue Oct 14, 2023 · 0 comments

Comments

@lestofante
Copy link

if i use turn(0.0) to stop the rotation, it will oscillate between -0.00000000000000005551115123125783 and 0.1047197551196597

0.104 is significant error, as it is 6deg/s of rotation

use oort_api::prelude::*;

pub struct Ship {}

impl Ship {
    pub fn new() -> Ship {
        Ship {}
    }

    pub fn tick(&mut self) {
        debug!("tick: {0}", current_tick());
        let angular_velocity = angular_velocity();
        debug!("angular_velocity: {angular_velocity}");
        if current_tick() < 10{
            torque(1000.0);
            return;
        }
        debug!("BREAKING");
        turn(0.0); //this should stop us!
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant