pub struct CharacterModel {
pub schema: String,
pub source: String,
pub skin_index: u32,
pub material: Option<MaterialHandle>,
pub position: [f32; 3],
pub rotation_deg: [f32; 3],
pub scale: [f32; 3],
pub lod_levels: u32,
pub lod_distances: Vec<f32>,
pub max_instances: u32,
pub capsule: Option<CharacterCapsule>,
}Expand description
A character body that conforms to a CharacterSchema.
The build validates the source against the schema (joint names and
parentage, complete + / - pairs for bipolar keys), imports it,
generates the schema’s synthesized targets, and emits one
SkinnedMesh under this asset’s name. A
CharacterShape or Animation targets the
model by this name exactly as it would a SkinnedMesh. Lower levels of
detail come from lod_levels, as on a SkinnedMesh.
The source’s extra shape keys (ones the schema does not list) are imported and appear under the editor panel’s “Other” section.
CharacterModel {
schema: "builtin:humanoid".into(),
source: "./base_humanoid.glb".into(),
lod_levels: 3,
..Default::default()
};Fields§
§schema: StringThe CharacterSchema the source conforms to, by
asset name or the reserved builtin:humanoid.
source: StringPath to the .glb / .gltf body.
skin_index: u32Which skinned mesh of source to import, in file order.
material: Option<MaterialHandle>Material of the emitted mesh.
position: [f32; 3]World-space position.
rotation_deg: [f32; 3]World rotation, Euler degrees [pitch, yaw, roll], YXZ order.
scale: [f32; 3]World scale.
lod_levels: u32Number of level-of-detail versions to generate, including the
original. 1 (the default) generates none; values are clamped to
[1, 8].
lod_distances: Vec<f32>Camera distances at which to switch to each lower-detail version.
When non-empty, must have exactly lod_levels - 1 entries; empty
lets the build choose defaults.
max_instances: u32Runtime copies the mesh may spawn beyond the authored one.
capsule: Option<CharacterCapsule>Character capsule of the emitted mesh.
Trait Implementations§
Source§impl Authored for CharacterModel
impl Authored for CharacterModel
impl BuildOnlyAsset for CharacterModel
Source§impl Clone for CharacterModel
impl Clone for CharacterModel
Source§fn clone(&self) -> CharacterModel
fn clone(&self) -> CharacterModel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CharacterModel
impl Debug for CharacterModel
Source§impl Default for CharacterModel
impl Default for CharacterModel
Source§fn default() -> CharacterModel
fn default() -> CharacterModel
Source§impl<'de> Deserialize<'de> for CharacterModelwhere
CharacterModel: Default,
impl<'de> Deserialize<'de> for CharacterModelwhere
CharacterModel: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CharacterModel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CharacterModel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for CharacterModel
impl Serialize for CharacterModel
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for CharacterModel
impl RefUnwindSafe for CharacterModel
impl Send for CharacterModel
impl Sync for CharacterModel
impl Unpin for CharacterModel
impl UnsafeUnpin for CharacterModel
impl UnwindSafe for CharacterModel
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more