pub struct ODE {
pub cams: BTreeMap<usize, Cam>,
pub t_delta: f64,
/* private fields */
}
Expand description
ODE singleton
Fields§
§cams: BTreeMap<usize, Cam>
viewpoint(s)
t_delta: f64
step
Implementations§
Source§impl ODE
singleton interface
impl ODE
singleton interface
Sourcepub fn ds_as_ref() -> &'static Box<dyn Tdrawstuff>
pub fn ds_as_ref() -> &'static Box<dyn Tdrawstuff>
ds trait Tdrawstuff getter
Sourcepub fn open(
drawstuff: impl Tdrawstuff + 'static,
delta: f64,
qsw: f64,
qsni: usize,
cmcv: f64,
csl: f64,
num_contact: usize,
)
pub fn open( drawstuff: impl Tdrawstuff + 'static, delta: f64, qsw: f64, qsni: usize, cmcv: f64, csl: f64, num_contact: usize, )
ODE initialize
- drawstuff: change drawstuff
- delta: default 0.002
- num_contact: default 12
Sourcepub fn create_world(
qsw: f64,
qsni: usize,
cmcv: f64,
csl: f64,
num_contact: usize,
)
pub fn create_world( qsw: f64, qsni: usize, cmcv: f64, csl: f64, num_contact: usize, )
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: *mut dxGeom, mi: Box<dyn MetaInf>) -> [f64; 4]
pub fn reg_mgm(&mut self, geom: *mut dxGeom, mi: Box<dyn MetaInf>) -> [f64; 4]
reg mgm (MetaInf, TCMaterial) (geom to HashMap) returns color
Sourcepub fn reg_obg(&mut self, obg: Obg) -> *mut dxBody
pub fn reg_obg(&mut self, obg: Obg) -> *mut dxBody
reg obg (body to HashMap, BTreeMap, and VecDeque) returns body
Sourcepub fn creator_dm(
&mut self,
key: &str,
mi: Box<dyn MetaInf>,
fmdm: bool,
) -> (*mut dxBody, *mut dxGeom, Box<dMass>)
pub fn creator_dm( &mut self, key: &str, mi: Box<dyn MetaInf>, fmdm: bool, ) -> (*mut dxBody, *mut dxGeom, Box<dMass>)
create primitive object (register it to show on the ODE space world)
- fmdm: true as m, false as dm
Sourcepub fn creator_m(
&mut self,
key: &str,
mi: Box<dyn MetaInf>,
) -> (*mut dxBody, *mut dxGeom, Box<dMass>)
pub fn creator_m( &mut self, key: &str, mi: Box<dyn MetaInf>, ) -> (*mut dxBody, *mut dxGeom, 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>,
) -> (*mut dxBody, *mut dxGeom, Box<dMass>)
pub fn creator( &mut self, key: &str, mi: Box<dyn MetaInf>, ) -> (*mut dxBody, *mut dxGeom, 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>,
) -> (*mut dxBody, *mut dxGeom, Box<dMass>)
pub fn creator_composite( &mut self, key: &str, mi: Box<dyn MetaInf>, ) -> (*mut dxBody, *mut dxGeom, Box<dMass>)
create composite object (register it to show on the ODE space world)
Sourcepub fn get_grand_parent(&self, id: *mut dxGeom) -> *mut dxBody
pub fn get_grand_parent(&self, id: *mut dxGeom) -> *mut dxBody
search grand parent body (must check 0 as dBodyID later on the receiver)
Sourcepub fn get_ancestor(&self, id: *mut dxGeom) -> (*mut dxBody, *mut dxBody)
pub fn get_ancestor(&self, id: *mut dxGeom) -> (*mut dxBody, *mut dxBody)
search ancestor (parent and grand parent) body (must check 0 as dBodyID later on the receiver)
Sourcepub fn get_ground(&self) -> *mut dxGeom
pub fn get_ground(&self) -> *mut dxGeom
get ground (from Gws)
Sourcepub fn get_contactgroup(&self) -> *mut dxJointGroup
pub fn get_contactgroup(&self) -> *mut dxJointGroup
get contactgroup (from Gws)
Sourcepub fn ref_contacts_mut(&mut self) -> &mut Vec<dContact>
pub fn ref_contacts_mut(&mut self) -> &mut Vec<dContact>
ref contacts mut
Sourcepub fn ref_contacts(&self) -> &Vec<dContact>
pub fn ref_contacts(&self) -> &Vec<dContact>
ref contacts
Sourcepub fn get_body_num_joints(&self, b: *mut dxBody) -> usize
pub fn get_body_num_joints(&self, b: *mut dxBody) -> usize
get body num joints
Sourcepub fn get_joint_num_bodies(&self, joint: *mut dxJoint) -> usize
pub fn get_joint_num_bodies(&self, joint: *mut dxJoint) -> usize
get joint num bodies
Sourcepub fn is_joint_enabled(&self, joint: *mut dxJoint) -> bool
pub fn is_joint_enabled(&self, joint: *mut dxJoint) -> bool
is joint enabled
Sourcepub fn get_joint_type(&self, joint: *mut dxJoint) -> i32
pub fn get_joint_type(&self, joint: *mut dxJoint) -> i32
get joint type
Sourcepub fn get_bounce(&self, id: *mut dxGeom) -> f64
pub fn get_bounce(&self, id: *mut dxGeom) -> f64
search bounce (especially support GeomTransform)
Sourcepub fn get_krp_mut(&mut self, id: *mut dxGeom) -> &mut Krp
pub fn get_krp_mut(&mut self, id: *mut dxGeom) -> &mut Krp
search Krp mut (from HashMap)
Sourcepub fn get_mgm_mut(
&mut self,
id: *mut dxGeom,
) -> Result<&mut Box<dyn MetaInf>, Box<dyn Error>>
pub fn get_mgm_mut( &mut self, id: *mut dxGeom, ) -> Result<&mut Box<dyn MetaInf>, Box<dyn Error>>
search MetaInf, TCMaterial mut (from HashMap)
Sourcepub fn get_mgm(
&self,
id: *mut dxGeom,
) -> Result<&Box<dyn MetaInf>, Box<dyn Error>>
pub fn get_mgm( &self, id: *mut dxGeom, ) -> Result<&Box<dyn MetaInf>, Box<dyn Error>>
search MetaInf, TCMaterial (from HashMap)
Sourcepub fn get_id(&self, k: String) -> Result<*mut dxBody, Box<dyn Error>>
pub fn get_id(&self, k: String) -> Result<*mut dxBody, Box<dyn Error>>
search id (from BTreeMap)
Sourcepub fn get_mut(&mut self, id: *mut dxBody) -> Result<&mut Obg, Box<dyn Error>>
pub fn get_mut(&mut self, id: *mut dxBody) -> 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 get(&self, id: *mut dxBody) -> Result<&Obg, Box<dyn Error>>
pub fn get(&self, id: *mut dxBody) -> Result<&Obg, Box<dyn Error>>
search object (from 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<F>(&self, la: F) -> Vec<*mut dxBody>
pub fn each_id<F>(&self, la: F) -> Vec<*mut dxBody>
each_id (may use immutable result with get_mut to avoid dup mutable borrow)
- la: FnMut(key: &str, id: dBodyID) -> bool
Sourcepub fn each<F>(&self, la: F) -> bool
pub fn each<F>(&self, la: F) -> bool
each (can break by result of lambda)
- la: FnMut(key: &str, id: dBodyID, obg: &Obg) -> bool
Sourcepub fn each_geom<F>(&self, obg: &Obg, la: F) -> bool
pub fn each_geom<F>(&self, obg: &Obg, la: F) -> bool
each geom in body (can break by result of lambda)
- la: FnMut(g: dGeomID, obg: &Obg) -> bool
Sourcepub fn destroy_obg(obg: &Obg)
pub fn destroy_obg(obg: &Obg)
destroy object (not unregister)
Sourcepub fn unregister_obg(&mut self, obg: &Obg, f: bool) -> Option<Obg>
pub fn unregister_obg(&mut self, obg: &Obg, f: bool) -> Option<Obg>
unregister object
- f: true with destroy
Sourcepub fn unregister_obg_by_id(&mut self, id: *mut dxBody, f: bool) -> Option<Obg>
pub fn unregister_obg_by_id(&mut self, id: *mut dxBody, f: bool) -> Option<Obg>
unregister object by id (not destroy)
- f: true with destroy
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
trait Sim must have callback functions
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: *mut dxGeom,
pos: Option<*const f64>,
rot: Option<*const f64>,
ws: i32,
)
fn draw_geom( &self, geom: *mut dxGeom, pos: Option<*const f64>, rot: Option<*const f64>, 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: *mut dxGeom, o2: *mut dxGeom)
fn near_callback(&mut self, dat: *mut c_void, o1: *mut dxGeom, o2: *mut dxGeom)
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
Source§impl TdrawstuffSetter for ODE
TdrawstuffSetter for ODE
impl TdrawstuffSetter for ODE
TdrawstuffSetter for ODE