Urho.Scene Class

Root scene node, represents the whole scene.

See Also: Scene

Syntax

public class Scene : Node

Remarks

When you create a Scene, it is automatically attached to the specified context (or the default as exposed by Application.CurrentContext).   The Scene is just the toplevel Node and it holds the various nodes for your application.   

In general, you will want to add an Octree component to your scene, without it, none of the visual components will be shown.  The default Octree component volume goes from (-1000,-1000,-1000) to (1000,1000,1000) in world coordinates.

C# Example

scene.CreateComponent<Octree> ();

// Create a child scene node (at world origin) and a StaticModel
// component into it. Set the StaticModel to show a simple plane mesh
// with a "stone" material. Note that naming the scene nodes is
// optional. Scale the scene node larger (100 x 100 world units)
var planeNode = scene.CreateChild("Plane");
planeNode.Scale = new Vector3 (100, 1, 100);
var planeObject = planeNode.CreateComponent<StaticModel> ();
planeObject.Model = cache.GetModel ("Models/Plane.mdl");
planeObject.SetMaterial(cache.GetMaterial("Materials/StoneTiled.xml"));

// Create a directional light to the world so that we can see something. The
// light scene node's orientation controls the light direction; we will use
// the SetDirection() function which calculates the orientation from a forward
// direction vector.
// The light will use default settings (white light, no shadows)
var lightNode = scene.CreateChild("DirectionalLight");
lightNode.SetDirection (new Vector3(0.6f, -1.0f, 0.8f));

Requirements

Namespace: Urho
Assembly: Urho (in Urho.dll)
Assembly Versions: 1.0.0.0

The members of Urho.Scene are listed below.

See Also: Node

Public Constructors

Constructs a new instance of Urho.Scene which is tied to the Application.CurrentContext.
Constructs a new instance of Urho.Scene, given a raw pointer to an unmanaged object
Constructs a new instance of Urho.Scene linked to a specific Context.

Protected Constructors

Empty constructor, chain to this constructor when you provide your own constructor that sets the handle field.

Public Properties

[read-only]
AsyncLoadingBoolean. Return whether an asynchronous loading operation is in progress.
AsyncLoadingMsInt32. Return maximum milliseconds per frame to spend on async loading. Or Set maximum milliseconds per frame to spend on async scene loading.
[read-only]
AsyncLoadModeLoadMode. Return the load mode of the current asynchronous loading operation.
[read-only]
AsyncProgressSingle. Return asynchronous loading progress between 0.0 and 1.0, or 1.0 if not in progress.
[read-only]
ChecksumUInt32. Return source file checksum.
ElapsedTimeSingle. Return elapsed time in seconds. Or Set elapsed time in seconds. This can be used to prevent inaccuracy in the timer if the scene runs for a long time.
[read-only]
FileNameString. Return source file name.
[read-only]
RequiredPackageFilesIReadOnlyList<Urho.IO.PackageFile>. Return required package files.
SmoothingConstantSingle. Return motion smoothing constant. Or Set network client motion smoothing constant.
SnapThresholdSingle. Return motion smoothing snap threshold. Or Set network client motion smoothing snap threshold.
[read-only]
ThreadedUpdateBoolean. Return threaded update flag.
TimeScaleSingle. Return update time scale. Or Set update time scale. 1.0 = real time (default.)
[read-only]
override
TypeStringHash. Urho's type system type.
[read-only]
override
TypeNameString. Urho's low-level type name.
[read-only]
static
TypeNameStaticString. Urho's low-level type name, accessible as a static method.
[read-only]
static
TypeStaticStringHash. Urho's low-level type, accessible as a static method.
UpdateEnabledBoolean. Controls whether updates to the scene are enabled or disabled.
[read-only]
VarNamesAttrString. Return node user variable reverse mappings.

Public Methods

override
AddReplicationState(NodeReplicationState*)
AddRequiredPackageFile(PackageFile)
Add a required package file for networking. To be called on the server.
BeginThreadedUpdate()
Begin a threaded update. During threaded update components can choose to delay dirty processing.
override
CleanupConnection(Connection)
Clean up all references to a network connection that is about to be removed.
Clear(Boolean, Boolean)
Clear scene completely of either replicated, local or all nodes and components.
ClearRequiredPackageFiles()
Clear required package files.
DelayedMarkedDirty(Component)
Add a component to the delayed dirty notify queue. Is thread-safe.
EndThreadedUpdate()
End a threaded update. Notify components that marked themselves for delayed dirty processing.
GetComponent(UInt32) : Component
Return component from the whole scene by ID, or null if not found.
GetFreeComponentID(CreateMode) : UInt32
Get free component ID, either non-local or local.
GetFreeNodeID(CreateMode) : UInt32
Get free node ID, either non-local or local.
GetNode(UInt32) : Node
Return node from the whole scene by ID, or null if not found.
GetVarName(StringHash) : String
Return a node user variable name, or empty if not registered.
Instantiate(File, Vector3, Quaternion, CreateMode) : Node
Instantiate(MemoryBuffer, Vector3, Quaternion, CreateMode) : Node
InstantiateJson(File, Vector3, Quaternion, CreateMode) : Node
Instantiate scene content from JSON data. 
InstantiateJson(MemoryBuffer, Vector3, Quaternion, CreateMode) : Node
InstantiateXml(File, Vector3, Quaternion, CreateMode) : Node
Instantiate scene content from serialized XML data.
InstantiateXml(MemoryBuffer, Vector3, Quaternion, CreateMode) : Node
InstantiateXml(XmlElement, Vector3, Quaternion, CreateMode) : Node
Instantiate scene content from serialized XML data.
override
Load(File, Boolean) : Boolean
override
Load(MemoryBuffer, Boolean) : Boolean
LoadAsync(File, LoadMode) : Boolean
Load from a binary file asynchronously. Return true if started successfully. The LOAD_RESOURCES_ONLY mode can also be used to preload resources from object prefab files.
LoadAsyncJson(File, LoadMode) : Boolean
LoadAsyncXml(File, LoadMode) : Boolean
LoadJson(File) : Boolean
LoadJson(MemoryBuffer) : Boolean
LoadXml(String) : Boolean
LoadXml(File) : Boolean
LoadXml(MemoryBuffer) : Boolean
override
LoadXml(XmlElement, Boolean) : Boolean
LoadXmlFromCache(ResourceCache, String) : Boolean
override
MarkNetworkUpdate()
Mark for attribute check on the next network update.
MarkNetworkUpdate(Component)
Mark a comoponent for attribute check on the next network update.
MarkNetworkUpdate(Node)
Mark a node for attribute check on the next network update.
MarkReplicationDirty(Node)
Mark a node dirty in scene replication states. The node does not need to have own replication state yet.
NodeTagAdded(Node, String)
NodeTagRemoved(Node, String)
override
PrepareNetworkUpdate()
Prepare network update by comparing attributes and marking replication states dirty as necessary.
static
RegisterObject(Context)
Register object factory. Node must be registered first.
RegisterVar(String)
Register a node user variable hash reverse mapping (for editing.)
override
Save(File) : Boolean
override
Save(MemoryBuffer) : Boolean
override
SaveJson(File, String) : Boolean
override
SaveJson(MemoryBuffer, String) : Boolean
SaveXml(String, String) : Boolean
override
SaveXml(File, String) : Boolean
override
SaveXml(MemoryBuffer, String) : Boolean
SetVarNamesAttr(String)
Set node user variable reverse mappings.
StopAsyncLoading()
Stop asynchronous loading.
SubscribeToAsyncLoadFinished(Action<AsyncLoadFinishedEventArgs>) : Subscription
Subscribes to the AsyncLoadFinished event raised by the Scene.
SubscribeToAsyncLoadProgress(Action<AsyncLoadProgressEventArgs>) : Subscription
Subscribes to the AsyncLoadProgress event raised by the Scene.
SubscribeToAttributeAnimationUpdate(Action<AttributeAnimationUpdateEventArgs>) : Subscription
Subscribes to the AttributeAnimationUpdate event raised by the Scene.
SubscribeToComponentAdded(Action<ComponentAddedEventArgs>) : Subscription
Subscribes to the ComponentAdded event raised by the Scene.
SubscribeToComponentCloned(Action<ComponentClonedEventArgs>) : Subscription
SubscribeToComponentEnabledChanged(Action<ComponentEnabledChangedEventArgs>) : Subscription
Subscribes to the ComponentEnabledChanged event raised by the Scene.
SubscribeToComponentRemoved(Action<ComponentRemovedEventArgs>) : Subscription
Subscribes to the ComponentRemoved event raised by the Scene.
SubscribeToNodeAdded(Action<NodeAddedEventArgs>) : Subscription
Subscribes to the NodeAdded event raised by the Scene.
SubscribeToNodeCloned(Action<NodeClonedEventArgs>) : Subscription
SubscribeToNodeEnabledChanged(Action<NodeEnabledChangedEventArgs>) : Subscription
Subscribes to the NodeEnabledChanged event raised by the Scene.
SubscribeToNodeNameChanged(Action<NodeNameChangedEventArgs>) : Subscription
Subscribes to the NodeNameChanged event raised by the Scene.
SubscribeToNodeRemoved(Action<NodeRemovedEventArgs>) : Subscription
Subscribes to the NodeRemoved event raised by the Scene.
SubscribeToSceneDrawableUpdateFinished(Action<SceneDrawableUpdateFinishedEventArgs>) : Subscription
Subscribes to the SceneDrawableUpdateFinished event raised by the Scene.
SubscribeToScenePostUpdate(Action<ScenePostUpdateEventArgs>) : Subscription
Subscribes to the ScenePostUpdate event raised by the Scene.
SubscribeToSceneSubsystemUpdate(Action<SceneSubsystemUpdateEventArgs>) : Subscription
Subscribes to the SceneSubsystemUpdate event raised by the Scene.
SubscribeToSceneUpdate(Action<SceneUpdateEventArgs>) : Subscription
Subscribes to the SceneUpdate event raised by the Scene.
SubscribeToUpdateSmoothing(Action<UpdateSmoothingEventArgs>) : Subscription
Subscribes to the UpdateSmoothing event raised by the Scene.
UnregisterAllVars()
Clear all registered node user variable hash reverse mappings.
UnregisterVar(String)
Unregister a node user variable hash reverse mapping.
Update(Single)
Update scene. Called by HandleUpdate.

Protected Methods

override
OnDeleted()

Public Events