Struct feo_oop_engine::scene::game_object::obj::Obj
source · [−]pub struct Obj {
pub id: ID,
pub name: String,
pub parent: ParentWrapper,
pub visible: bool,
pub subspace: Space,
pub triangle_mesh: Vec<Arc<TriangleMesh>>,
pub script: Option<Box<Script<Self>>>,
pub children: Vec<Arc<RwLock<dyn GameObject>>>,
}Fields
id: IDname: Stringparent: ParentWrappervisible: boolsubspace: Spacetriangle_mesh: Vec<Arc<TriangleMesh>>script: Option<Box<Script<Self>>>children: Vec<Arc<RwLock<dyn GameObject>>>Implementations
pub fn new_empty(
name: Option<&str>,
parent: Option<Arc<RwLock<dyn GameObject>>>,
position: Option<Vector3<f32>>,
rotation: Option<Quaternion<f32>>,
scale_factor: Option<Vector3<f32>>,
visible: bool,
engine_globals: EngineGlobals,
script: Option<Box<Script<Self>>>
) -> Arc<RwLock<Self>>
pub fn from_triangle_mesh_vec(
name: Option<&str>,
triangle_mesh_vec: Vec<Arc<TriangleMesh>>,
parent: Option<Arc<RwLock<dyn GameObject>>>,
position: Option<Vector3<f32>>,
rotation: Option<Quaternion<f32>>,
scale_factor: Option<Vector3<f32>>,
visible: bool,
engine_globals: EngineGlobals,
script: Option<Box<Script<Self>>>
) -> Arc<RwLock<Self>>
pub fn from_obj<'a>(
name: Option<&str>,
path: &str,
parent: Option<Arc<RwLock<dyn GameObject>>>,
position: Option<Vector3<f32>>,
rotation: Option<Quaternion<f32>>,
scale_factor: Option<Vector3<f32>>,
visible: bool,
engine_globals: EngineGlobals,
script: Option<Box<Script<Self>>>
) -> Result<Arc<RwLock<Self>>, &'a str>
Trait Implementations
Safety Read more
Adds self’s visible characteristics and its children to the draw pass.
fn load_into_managers(
&self,
this: ParentWrapper,
draw_pass_manager: &mut DrawPassManager,
lighting_pass_manager: &mut LightingPassManager
)
fn load_into_managers(
&self,
this: ParentWrapper,
draw_pass_manager: &mut DrawPassManager,
lighting_pass_manager: &mut LightingPassManager
)
Adds self’s relevant characteristics and its children to the pass managers.
Adds a triangle mesh to the Drawable struct
Checks if an object is visible
fn get_texture_indices_buffer(
&self
) -> Vec<Option<Arc<CpuAccessibleBuffer<[TextureIndex]>>>>
fn cast_camera_arc_rwlock(
&self,
this: Arc<RwLock<dyn GameObject>>
) -> Result<Arc<RwLock<dyn Camera>>, ()>
fn cast_light_arc_rwlock(
&self,
this: Arc<RwLock<dyn GameObject>>
) -> Result<Arc<RwLock<dyn Light>>, ()>
Safety Read more
unsafe fn replace_child(
&mut self,
old: Arc<RwLock<dyn GameObject>>,
new: Arc<RwLock<dyn GameObject>>
) -> Result<(), ()>
unsafe fn replace_child(
&mut self,
old: Arc<RwLock<dyn GameObject>>,
new: Arc<RwLock<dyn GameObject>>
) -> Result<(), ()>
Safety Read more
Auto Trait Implementations
impl !RefUnwindSafe for Obj
impl !UnwindSafe for Obj
Blanket Implementations
Mutably borrows from an owned value. Read more
Builds a pointer to this type from a raw pointer.
Returns true if the size is suitable to store a type like this.
Returns the size of an individual element.