pub struct PhysicsSceneWriter {
pub bodies: Vec<BodyDesc>,
pub joints: Vec<JointDesc>,
pub materials: Vec<MaterialDesc>,
}Expand description
Write a full physics scene (bodies, joints, materials) to JSON or binary.
Fields§
§bodies: Vec<BodyDesc>Bodies in the scene.
joints: Vec<JointDesc>Joints in the scene.
materials: Vec<MaterialDesc>Materials in the scene.
Implementations§
Source§impl PhysicsSceneWriter
impl PhysicsSceneWriter
Sourcepub fn add_material(&mut self, mat: MaterialDesc)
pub fn add_material(&mut self, mat: MaterialDesc)
Add a material to the scene.
Sourcepub fn write_json<W: Write>(&self, writer: &mut W) -> Result<()>
pub fn write_json<W: Write>(&self, writer: &mut W) -> Result<()>
Serialize the scene to JSON and write to writer.
Sourcepub fn write_to_file(&self, path: &str) -> Result<()>
pub fn write_to_file(&self, path: &str) -> Result<()>
Write to a file path.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PhysicsSceneWriter
impl RefUnwindSafe for PhysicsSceneWriter
impl Send for PhysicsSceneWriter
impl Sync for PhysicsSceneWriter
impl Unpin for PhysicsSceneWriter
impl UnsafeUnpin for PhysicsSceneWriter
impl UnwindSafe for PhysicsSceneWriter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.