Comments (2)
Ahh gotcha, it's because one of the goals you outlined was to not use unsafe.
I've forked the repo and removed the atomics, in case anyone is interested: https://github.com/tenetcomputer/box2d-rs
Closing the issue now.
from box2d-rs.
Wondering why Atomics are needed in Box2D? I dont see any other code spawning new threads, and thought Box2D was single threaded.
box2d-rs/src/b2_time_of_impact.rs
Line 5 in c6e0929
Hi, it is here only for safe way to use global static variables,
pub static B2_TOI_TIME: AtomicU64 = AtomicU64::new(0);
/// ns
pub static B2_TOI_MAX_TIME: AtomicU64 = AtomicU64::new(0);
pub static B2_TOI_CALLS: AtomicUsize = AtomicUsize::new(0);
pub static B2_TOI_ITERS: AtomicUsize = AtomicUsize::new(0);
pub static B2_TOI_MAX_ITERS: AtomicUsize = AtomicUsize::new(0);
pub static B2_TOI_ROOT_ITERS: AtomicUsize = AtomicUsize::new(0);
pub static B2_TOI_MAX_ROOT_ITERS: AtomicUsize = AtomicUsize::new(0);
example of changing value of it
B2_TOI_ROOT_ITERS.store(0, Ordering::SeqCst);
let load_b2_toi_root_iters = B2_TOI_ROOT_ITERS.load(Ordering::SeqCst);
B2_TOI_ROOT_ITERS.fetch_add(1, Ordering::SeqCst);
from box2d-rs.
Related Issues (6)
- Questions HOT 6
- Hello World HOT 2
- Cool project! Some questions/comments HOT 1
- B2contactEdge members are pub(crate) HOT 2
- Критический баг? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from box2d-rs.