pub struct Commands<'a> {
pub world: &'a mut World,
pub renderer: &'a Renderer,
pub asset_manager: Option<AssetManager>,
}Fields§
§world: &'a mut World§renderer: &'a Renderer§asset_manager: Option<AssetManager>Implementations§
Source§impl<'a> Commands<'a>
impl<'a> Commands<'a>
pub fn new(world: &'a mut World, renderer: &'a Renderer) -> Self
Sourcepub fn spawn_cube(&mut self, pos: Vec3, color: Color) -> EntityBuilder<'_, 'a>
pub fn spawn_cube(&mut self, pos: Vec3, color: Color) -> EntityBuilder<'_, 'a>
Tek satırda renkli bir küp spawn eder. Builder zinciriyle .with_name() eklenebilir.
Sourcepub fn spawn_sphere(
&mut self,
pos: Vec3,
radius: f32,
color: Color,
) -> EntityBuilder<'_, 'a>
pub fn spawn_sphere( &mut self, pos: Vec3, radius: f32, color: Color, ) -> EntityBuilder<'_, 'a>
Tek satırda renkli bir küre spawn eder.
Sourcepub fn spawn_plane(
&mut self,
pos: Vec3,
size: f32,
color: Color,
) -> EntityBuilder<'_, 'a>
pub fn spawn_plane( &mut self, pos: Vec3, size: f32, color: Color, ) -> EntityBuilder<'_, 'a>
Tek satırda düzlemsel bir zemin spawn eder.
Sourcepub fn spawn_model(&mut self, pos: Vec3, path: &str) -> EntityBuilder<'_, 'a>
pub fn spawn_model(&mut self, pos: Vec3, path: &str) -> EntityBuilder<'_, 'a>
Diskten bir .obj modeli yükler ve spawn eder.
Sourcepub fn spawn_camera(&mut self, pos: Vec3) -> EntityBuilder<'_, 'a>
pub fn spawn_camera(&mut self, pos: Vec3) -> EntityBuilder<'_, 'a>
Birincil (primary) 3D perspektif kamera spawn eder.
yaw = -π/2 (−X’e bakıyor), pitch = 0 (düz).
Sourcepub fn spawn_camera_with(
&mut self,
pos: Vec3,
fov_deg: f32,
near: f32,
far: f32,
) -> EntityBuilder<'_, 'a>
pub fn spawn_camera_with( &mut self, pos: Vec3, fov_deg: f32, near: f32, far: f32, ) -> EntityBuilder<'_, 'a>
fov (derece), near, far özelleştirilebilir kamera.
Sourcepub fn spawn_point_light(
&mut self,
pos: Vec3,
color: Color,
intensity: f32,
) -> EntityBuilder<'_, 'a>
pub fn spawn_point_light( &mut self, pos: Vec3, color: Color, intensity: f32, ) -> EntityBuilder<'_, 'a>
Point light (nokta ışık) spawn eder.
Sourcepub fn spawn_sun(
&mut self,
_direction: Vec3,
color: Color,
intensity: f32,
) -> EntityBuilder<'_, 'a>
pub fn spawn_sun( &mut self, _direction: Vec3, color: Color, intensity: f32, ) -> EntityBuilder<'_, 'a>
Directional light (güneş/ay) spawn eder.
direction: normallenmiş ışık yönü (aşağı bakan = negatif Y).
Sourcepub fn spawn_skybox(&mut self, color: Color) -> EntityBuilder<'_, 'a>
pub fn spawn_skybox(&mut self, color: Color) -> EntityBuilder<'_, 'a>
Skybox spawn eder (ters yüzlü çok büyük küp). Renk arka plan rengini belirler.
Sourcepub fn spawn_rigid_cube(
&mut self,
pos: Vec3,
half_extents: Vec3,
color: Color,
mass: f32,
) -> EntityBuilder<'_, 'a>
pub fn spawn_rigid_cube( &mut self, pos: Vec3, half_extents: Vec3, color: Color, mass: f32, ) -> EntityBuilder<'_, 'a>
Fizik simulasyonuna katılan dinamik bir küp spawn eder.
half_extents: Her eksende yarı boyut. mass: kg cinsinden kütle (0 = statik).
Sourcepub fn spawn_rigid_sphere(
&mut self,
pos: Vec3,
radius: f32,
color: Color,
mass: f32,
) -> EntityBuilder<'_, 'a>
pub fn spawn_rigid_sphere( &mut self, pos: Vec3, radius: f32, color: Color, mass: f32, ) -> EntityBuilder<'_, 'a>
Fizik simulasyonuna katılan dinamik bir küre spawn eder.
Sourcepub fn spawn_static_plane(
&mut self,
pos: Vec3,
size: f32,
color: Color,
) -> EntityBuilder<'_, 'a>
pub fn spawn_static_plane( &mut self, pos: Vec3, size: f32, color: Color, ) -> EntityBuilder<'_, 'a>
Statik (hareket etmeyen) zemin düzlemi spawn eder.
Sourcepub fn spawn_textured_cube(
&mut self,
pos: Vec3,
texture_path: &str,
) -> EntityBuilder<'_, 'a>
pub fn spawn_textured_cube( &mut self, pos: Vec3, texture_path: &str, ) -> EntityBuilder<'_, 'a>
Textureli bir materyal yükler ve bir küpe uygular.
Sourcepub fn spawn_textured_plane(
&mut self,
pos: Vec3,
size: f32,
texture_path: &str,
) -> EntityBuilder<'_, 'a>
pub fn spawn_textured_plane( &mut self, pos: Vec3, size: f32, texture_path: &str, ) -> EntityBuilder<'_, 'a>
Textureli bir materyal yükler ve bir düzleme uygular.
Sourcepub fn spawn_gltf(
&mut self,
pos: Vec3,
path: &str,
attach_colliders: bool,
) -> Result<EntityBuilder<'_, 'a>, String>
pub fn spawn_gltf( &mut self, pos: Vec3, path: &str, attach_colliders: bool, ) -> Result<EntityBuilder<'_, 'a>, String>
GLTF/GLB dosyasını yükler ve dünya içinde spawn eder. Animasyon ve iskelet hiyerarşisi otomatik oluşturulur.
Sourcepub fn spawn_gltf_async_completed(
&mut self,
completion: GltfImportCompletion,
pos: Vec3,
attach_colliders: bool,
) -> Result<EntityBuilder<'_, 'a>, String>
pub fn spawn_gltf_async_completed( &mut self, completion: GltfImportCompletion, pos: Vec3, attach_colliders: bool, ) -> Result<EntityBuilder<'_, 'a>, String>
Asenkron GLTF yükleme tamamlandığında çağrılacak metot.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Commands<'a>
impl<'a> !RefUnwindSafe for Commands<'a>
impl<'a> Send for Commands<'a>
impl<'a> Sync for Commands<'a>
impl<'a> Unpin for Commands<'a>
impl<'a> UnsafeUnpin for Commands<'a>
impl<'a> !UnwindSafe for Commands<'a>
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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