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
impl ODE
singleton interface
sourcepub fn new(delta: dReal) -> ODE
pub fn new(delta: dReal) -> ODE
construct (must not call it, auto instanciate by once_cell lazy)
sourcepub fn create_world()
pub fn create_world()
auto called by ODE::open() (custom start callback to create your objects)
sourcepub fn destroy_world()
pub fn destroy_world()
auto called by ODE::close()
sourcepub fn is_modified(&mut self, f: bool) -> bool
pub fn is_modified(&mut self, f: bool) -> bool
is modified (set false when f is false, otherwise through)
sourcepub fn reg_mgm(&mut self, geom: dGeomID, mi: Box<dyn MetaInf>) -> dVector4
pub fn reg_mgm(&mut self, geom: dGeomID, mi: Box<dyn MetaInf>) -> dVector4
reg mgm (MetaInf, TCMaterial) (geom to HashMap) returns color
sourcepub fn reg_obg(&mut self, obg: Obg) -> dBodyID
pub fn reg_obg(&mut self, obg: Obg) -> dBodyID
reg obg (body to HashMap, BTreeMap, and VecDeque) returns body
sourcepub fn creator_dm(
&mut self,
key: &str,
mi: Box<dyn MetaInf>,
fmdm: bool
) -> (dBodyID, dGeomID, Box<dMass>)
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)
sourcepub fn creator_m(
&mut self,
key: &str,
mi: Box<dyn MetaInf>
) -> (dBodyID, dGeomID, Box<dMass>)
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)
sourcepub fn creator(
&mut self,
key: &str,
mi: Box<dyn MetaInf>
) -> (dBodyID, dGeomID, Box<dMass>)
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)
sourcepub fn creator_composite(
&mut self,
key: &str,
mi: Box<dyn MetaInf>
) -> (dBodyID, dGeomID, Box<dMass>)
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)
sourcepub fn get_grand_parent(&self, id: dGeomID) -> dBodyID
pub fn get_grand_parent(&self, id: dGeomID) -> dBodyID
search grand parent body
sourcepub fn get_bounce(&self, id: dGeomID) -> dReal
pub fn get_bounce(&self, id: dGeomID) -> dReal
search bounce (especially support GeomTransform)
sourcepub fn get_mgm_mut(
&mut self,
id: dGeomID
) -> Result<&mut Box<dyn MetaInf>, Box<dyn Error>>
pub fn get_mgm_mut( &mut self, id: dGeomID ) -> Result<&mut Box<dyn MetaInf>, Box<dyn Error>>
search MetaInf, TCMaterial mut (from HashMap)
sourcepub fn get_mgm(&self, id: dGeomID) -> Result<&Box<dyn MetaInf>, Box<dyn Error>>
pub fn get_mgm(&self, id: dGeomID) -> Result<&Box<dyn MetaInf>, Box<dyn Error>>
search MetaInf, TCMaterial (from HashMap)
sourcepub fn get_mut(&mut self, id: dBodyID) -> Result<&mut Obg, Box<dyn Error>>
pub fn get_mut(&mut self, id: dBodyID) -> Result<&mut Obg, Box<dyn Error>>
search object mut (from HashMap)
sourcepub fn find_mut(&mut self, k: String) -> Result<&mut Obg, Box<dyn Error>>
pub fn find_mut(&mut self, k: String) -> Result<&mut Obg, Box<dyn Error>>
search object mut (from BTreeMap and HashMap)
sourcepub fn find(&self, k: String) -> Result<&Obg, Box<dyn Error>>
pub fn find(&self, k: String) -> Result<&Obg, Box<dyn Error>>
search object (from BTreeMap and HashMap)
sourcepub fn each_id(&self, la: fn(key: &str, id: dBodyID) -> bool) -> Vec<dBodyID>
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)
sourcepub fn each(&self, la: fn(key: &str, id: dBodyID, obg: &Obg) -> bool) -> bool
pub fn each(&self, la: fn(key: &str, id: dBodyID, obg: &Obg) -> bool) -> bool
each (can break by result of lambda)
sourcepub fn destroy_obg(obg: &Obg)
pub fn destroy_obg(obg: &Obg)
destroy object (not unregister)
sourcepub fn clear_obgs()
pub fn clear_obgs()
destroy and unregister all objects
sourcepub fn clear_contactgroup()
pub fn clear_contactgroup()
destroy contact group and re initialize it
sourcepub fn viewpoint_()
pub fn viewpoint_()
set viewpoint (from the current viewpoint Cam[sw_viewpoint])
Trait Implementations§
source§impl Sim for ODE
impl Sim for ODE
trait Sim must have callback functions
source§fn draw_objects(&mut self)
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
)
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)
fn start_callback(&mut self)
start default callback function
source§fn near_callback(&mut self, dat: *mut c_void, o1: dGeomID, o2: dGeomID)
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)
fn step_callback(&mut self, pause: i32)
step default callback function
source§fn command_callback(&mut self, cmd: i32)
fn command_callback(&mut self, cmd: i32)
command default callback function
source§fn stop_callback(&mut self)
fn stop_callback(&mut self)
stop default callback function