logo
pub struct Scene {
    pub graph: Graph,
    pub animations: AnimationContainer,
    pub render_target: Option<Texture>,
    pub drawing_context: SceneDrawingContext,
    pub navmeshes: NavMeshContainer,
    pub performance_statistics: PerformanceStatistics,
    pub ambient_lighting_color: Color,
    pub enabled: bool,
    pub animation_machines: AnimationMachineContainer,
    /* private fields */
}
Expand description

See module docs.

Fields

graph: Graph

Graph is main container for all scene nodes. It calculates global transforms for nodes, updates them and performs all other important work. See graph module docs for more info.

animations: AnimationContainer

Animations container controls all animation on scene. Each animation can have tracks which has handles to graph nodes. See animation module docs for more info.

render_target: Option<Texture>

Texture to draw scene to. If empty, scene will be drawn on screen directly. It is useful to “embed” some scene into other by drawing a quad with this texture. This can be used to make in-game video conference - you can make separate scene with your characters and draw scene into texture, then in main scene you can attach this texture to some quad which will be used as monitor. Other usage could be previewer of models, like pictogram of character in real-time strategies, in other words there are plenty of possible uses.

drawing_context: SceneDrawingContext

Drawing context for simple graphics.

navmeshes: NavMeshContainer

A container for navigational meshes.

performance_statistics: PerformanceStatistics

Performance statistics from last update call.

ambient_lighting_color: Color

Color of ambient lighting.

enabled: bool

Whether the scene will be updated and rendered or not. Default is true. This flag allowing you to build a scene manager for your game. For example, you may have a scene for menu and one per level. Menu’s scene is persistent, however you don’t want it to be updated and renderer while you have a level loaded and playing a game. When you’re start playing, just set enabled flag to false for menu’s scene and when you need to open a menu - set it to true and set enabled flag to false for level’s scene.

animation_machines: AnimationMachineContainer

A container for animation blending state machines.

Implementations

Property key constants

Creates new scene with single root node.

Notes

This method differs from Default trait implementation! Scene::default() creates empty graph with no nodes.

Removes node from scene with all associated entities, like animations etc. This method should be used all times instead of Graph::remove_node.

Panics

Panics if handle is invalid.

Synchronizes the state of the scene with external resources.

Tries to set new lightmap to scene.

Performs single update tick with given delta time from last frame. Internally it updates physics, animations, and each graph node. In most cases there is no need to call it directly, engine automatically updates all available scenes.

Creates deep copy of a scene, filter predicate allows you to filter out nodes by your criteria.

Saves scene in a specified file.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Returns information about “public” properties.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert 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. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Casts self to a &dyn Any

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.