Skip to content

Conversation

@ThierryBerger
Copy link
Contributor

@ThierryBerger ThierryBerger commented Jun 24, 2024

TODO: I'll want a changelog line once #54 is merged

To be noted instant is still used somewhere in the dependencies, mostly optionally and through rapier_testbed

Details

$ cargo tree -i instant
instant v0.1.13
├── rapier2d v0.21.0
│   ├── examples2d v0.1.0 (C:\Users\thier\Documents\pro\clients\foresight\projects\salva\examples2d)
│   ├── rapier_testbed2d v0.21.0
│   │   ├── examples2d v0.1.0 (C:\Users\thier\Documents\pro\clients\foresight\projects\salva\examples2d)
│   │   └── salva2d v0.9.0 (C:\Users\thier\Documents\pro\clients\foresight\projects\salva\build\salva2d)
│   │       └── examples2d v0.1.0 (C:\Users\thier\Documents\pro\clients\foresight\projects\salva\examples2d)
│   └── salva2d v0.9.0 (C:\Users\thier\Documents\pro\clients\foresight\projects\salva\build\salva2d) (*)
├── rapier3d v0.21.0
│   ├── examples3d v0.1.0 (C:\Users\thier\Documents\pro\clients\foresight\projects\salva\examples3d)
│   ├── rapier_testbed3d v0.21.0
│   │   ├── examples3d v0.1.0 (C:\Users\thier\Documents\pro\clients\foresight\projects\salva\examples3d)
│   │   └── salva3d v0.9.0 (C:\Users\thier\Documents\pro\clients\foresight\projects\salva\build\salva3d)
│   │       └── examples3d v0.1.0 (C:\Users\thier\Documents\pro\clients\foresight\projects\salva\examples3d)
│   └── salva3d v0.9.0 (C:\Users\thier\Documents\pro\clients\foresight\projects\salva\build\salva3d) (*)
├── rapier_testbed2d v0.21.0 (*)
└── rapier_testbed3d v0.21.0 (*)

pub fn resume(&mut self) {
if self.enabled {
self.start = Some(instant::now());
self.start = Some(Instant::now().elapsed().as_secs_f64());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if there's a less verbose way to get that.

@ekalosak
Copy link

ekalosak commented Jul 3, 2024

Why make this change?

@ThierryBerger
Copy link
Contributor Author

Short answer is that instant is no longer maintained and makes web target difficult to compile.

Copy link
Member

@sebcrozet sebcrozet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

pub fn resume(&mut self) {
if self.enabled {
self.start = Some(instant::now());
self.start = Some(Instant::now().elapsed().as_secs_f64());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.start = Some(Instant::now().elapsed().as_secs_f64());
self.start = Some(Instant::now());


fn step(&mut self, physics: &mut PhysicsState, _run_state: &RunState) {
let step_time = instant::now();
let step_time = Instant::now().elapsed().as_secs_f64();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let step_time = Instant::now().elapsed().as_secs_f64();
let step_time = Instant::now();

Copy link
Member

@sebcrozet sebcrozet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good now, thanks!

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

Successfully merging this pull request may close these issues.

3 participants