pub struct PrefabJson {
pub pivots: PrefabPivots,
pub added_global_grid_offset: PrefabIntVec3,
pub is_physics_grid: bool,
pub freeze_physics_grid: bool,
pub freeze_global_grid: bool,
pub is_microchip_prefab: bool,
}Expand description
Meta/Prefab.json — present only for type: "Prefab" bundles. Describes
the prefab’s bounds/pivots and grid flags so the game can preview and place
it. Build one from a brick bounding box with PrefabJson::from_bounds.
Fields§
§pivots: PrefabPivots§added_global_grid_offset: PrefabIntVec3§is_physics_grid: bool§freeze_physics_grid: bool§freeze_global_grid: bool§is_microchip_prefab: boolImplementations§
Source§impl PrefabJson
impl PrefabJson
Sourcepub fn from_bounds(min: Position, max: Position) -> Self
pub fn from_bounds(min: Position, max: Position) -> Self
Build a prefab from an inclusive brick bounding box (in brick units). All four pivots are set to the bounds box; refine the stud pivots later if precise snapping is needed.
Trait Implementations§
Source§impl Clone for PrefabJson
impl Clone for PrefabJson
Source§fn clone(&self) -> PrefabJson
fn clone(&self) -> PrefabJson
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrefabJson
impl Debug for PrefabJson
Source§impl Default for PrefabJson
impl Default for PrefabJson
Source§impl<'de> Deserialize<'de> for PrefabJson
impl<'de> Deserialize<'de> for PrefabJson
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PrefabJson
impl RefUnwindSafe for PrefabJson
impl Send for PrefabJson
impl Sync for PrefabJson
impl Unpin for PrefabJson
impl UnsafeUnpin for PrefabJson
impl UnwindSafe for PrefabJson
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