Struct ode_rs::ode::ODE

source ·
pub struct ODE {
    pub cams: BTreeMap<usize, Cam>,
    pub t_delta: dReal,
    /* private fields */
}
Expand description

ODE singleton

Fields§

§cams: BTreeMap<usize, Cam>

viewpoint(s)

§t_delta: dReal

step

Implementations§

source§

impl ODE

singleton interface

source

pub fn new(delta: dReal) -> ODE

construct (must not call it, auto instanciate by once_cell lazy)

source

pub fn open()

ODE initialize

source

pub fn close()

ODE finalize

source

pub fn create_world()

auto called by ODE::open() (custom start callback to create your objects)

source

pub fn destroy_world()

auto called by ODE::close()

source

pub fn modify(&mut self)

modify

source

pub fn is_modified(&mut self, f: bool) -> bool

is modified (set false when f is false, otherwise through)

source

pub fn num(&self) -> usize

number of elements

source

pub fn reg_mgm(&mut self, geom: dGeomID, mi: Box<dyn MetaInf>) -> dVector4

reg mgm (MetaInf, TCMaterial) (geom to HashMap) returns color

source

pub fn reg_obg(&mut self, obg: Obg) -> dBodyID

reg obg (body to HashMap, BTreeMap, and VecDeque) returns body

source

pub fn creator_dm( &mut self, key: &str, mi: Box<dyn MetaInf>, fmdm: bool ) -> (dBodyID, dGeomID, Box<dMass>)

create primitive object (register it to show on the ODE space world)

source

pub fn creator_m( &mut self, key: &str, mi: Box<dyn MetaInf> ) -> (dBodyID, dGeomID, Box<dMass>)

create primitive object as m (register it to show on the ODE space world)

source

pub fn creator( &mut self, key: &str, mi: Box<dyn MetaInf> ) -> (dBodyID, dGeomID, Box<dMass>)

create primitive object as dm (register it to show on the ODE space world)

source

pub fn creator_composite( &mut self, key: &str, mi: Box<dyn MetaInf> ) -> (dBodyID, dGeomID, Box<dMass>)

create composite object (register it to show on the ODE space world)

source

pub fn get_grand_parent(&self, id: dGeomID) -> dBodyID

search grand parent body

source

pub fn get_bounce(&self, id: dGeomID) -> dReal

search bounce (especially support GeomTransform)

source

pub fn get_krp(&self, id: dGeomID) -> &Krp

search Krp (from HashMap)

source

pub fn get_mgm_mut( &mut self, id: dGeomID ) -> Result<&mut Box<dyn MetaInf>, Box<dyn Error>>

search MetaInf, TCMaterial mut (from HashMap)

source

pub fn get_mgm(&self, id: dGeomID) -> Result<&Box<dyn MetaInf>, Box<dyn Error>>

search MetaInf, TCMaterial (from HashMap)

source

pub fn get_id(&self, k: String) -> Result<dBodyID, Box<dyn Error>>

search id (from BTreeMap)

source

pub fn get_mut(&mut self, id: dBodyID) -> Result<&mut Obg, Box<dyn Error>>

search object mut (from HashMap)

source

pub fn find_mut(&mut self, k: String) -> Result<&mut Obg, Box<dyn Error>>

search object mut (from BTreeMap and HashMap)

source

pub fn get(&self, id: dBodyID) -> Result<&Obg, Box<dyn Error>>

search object (from HashMap)

source

pub fn find(&self, k: String) -> Result<&Obg, Box<dyn Error>>

search object (from BTreeMap and HashMap)

source

pub fn each_id(&self, la: fn(key: &str, id: dBodyID) -> bool) -> Vec<dBodyID>

each_id (may use immutable result with get_mut to avoid dup mutable borrow)

source

pub fn each(&self, la: fn(key: &str, id: dBodyID, obg: &Obg) -> bool) -> bool

each (can break by result of lambda)

source

pub fn destroy_obg(obg: &Obg)

destroy object (not unregister)

source

pub fn clear_obgs()

destroy and unregister all objects

source

pub fn clear_contactgroup()

destroy contact group and re initialize it

source

pub fn viewpoint_()

set viewpoint (from the current viewpoint Cam[sw_viewpoint])

source

pub fn viewpoint(f: bool)

get viewpoint (f: true, save to the current viewpoint Cam[sw_viewpoint])

source

pub fn sim_loop(width: i32, height: i32, r_sim: Option<Box<dyn Sim>>, a: &[u8])

default simulation loop

Trait Implementations§

source§

impl Drop for ODE

binding finalize ODE (auto called)

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Sim for ODE

trait Sim must have callback functions

source§

fn draw_objects(&mut self)

implements drawing composite wire_solid i32 false/true for bunny

source§

fn draw_geom( &self, geom: dGeomID, pos: Option<*const dReal>, rot: Option<*const dReal>, ws: i32 )

draw_geom (called by draw_objects and recursive)

source§

fn start_callback(&mut self)

start default callback function

source§

fn near_callback(&mut self, dat: *mut c_void, o1: dGeomID, o2: dGeomID)

near default callback function

source§

fn step_callback(&mut self, pause: i32)

step default callback function

source§

fn command_callback(&mut self, cmd: i32)

command default callback function

source§

fn stop_callback(&mut self)

stop default callback function

source§

fn super_mut(&mut self) -> &mut ODE

self.super mutable
source§

fn super_get(&self) -> &ODE

self.super immutable
source§

fn set_pos_R(&mut self, b: dBodyID, p: dVector3, m: dMatrix3)

set pos and rotation (dMatrix3)
source§

fn set_pos_Q(&mut self, b: dBodyID, p: dVector3, q: dQuaternion)

set pos and rotation (dQuaternion)

Auto Trait Implementations§

§

impl Freeze for ODE

§

impl !RefUnwindSafe for ODE

§

impl !Send for ODE

§

impl !Sync for ODE

§

impl Unpin for ODE

§

impl !UnwindSafe for ODE

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.