oyk

OYK is ODE (Open Dynamics Engine) bindings for Rust yaw kinetics

ODE * https://github.com/nomissbowling/oyk/blob/master/img/oyk_512x100.png?raw=true

Now this crate is tested on ode-0.16.2 dll version.

ode.dll drawstuff.dll for x64 Windows binary compiled with -DdDOUBLE by mingw

(It may work with VC, or other platforms.)

Requirements

to build dll

in the running directory

Samples

```rust use oyk::ode::*;

use implsim::{implsimfn, implsim_derive};

pub struct SimApp { }

[implsimderive(drawobjects, nearcallback, stepcallback, stopcallback)]

impl Sim for SimApp {

fn startcallback(&mut self) { let tdelta = &mut self.supermut().tdelta; *tdelta = 0.002; let obgs = &mut self.supermut().obgs; let m: dReal = 1.0; let r: dReal = 0.2; for i in 0..16 { let c: dVector4 = vec4fromu32(COLORS[i]); let p: dVector3 = [(i%4) as dReal - 1.5, (i/4) as dReal - 1.5, 2.0, 1.0]; obgs.push(ODE::mksphere(m, r, &c, &p)); } let c: dVector4 = [1.0, 1.0, 0.0, 0.8]; let p: dVector3 = [0.0, 0.0, 10.0, 1.0]; obgs.push(ODE::mksphere(0.1, 1.0, &c, &p)); self.supermut().startcallback(); }

fn commandcallback(&mut self, cmd: i32) { match cmd as u8 as char { 'a' => { println!("anything to do"); }, _ => {} } self.supermut().command_callback(cmd); }

} // impl Sim for SimApp

fn main() { ODE::open(); ODE::sim_loop( 640, 480, // 800, 600, Some(Box::new(SimApp{})), b"./resources"); ODE::close(); } ```

see also

License

MIT License