C# Class FBX.Scene.Scene

A scene is a collection of meshes, lights, cameras, textures and material parameters A mesh is a collection of primitives that are rendered by the renderer's render techniques You can load and save a scene in the Nuaj.Cirrus proprietary format. Scenes can also be imported through 3rd party formats (cf. FBXSceneLoader) then saved into the proprietary format.
Mostrar archivo Open project: Patapom/GodComplex

Protected Properties

Property Type Description
m_Cameras List
m_ID2MaterialParameters MaterialParameters>.Dictionary
m_ID2Node Node>.Dictionary
m_ID2Texture Texture2D>.Dictionary
m_Lights List
m_MaterialParameters List
m_MaterialParametersIDCounter int
m_Meshes List
m_NodeIDCounter int
m_Root FBX.Scene.Nodes.Node
m_TextureIDCounter int
m_Textures List
m_URL2Texture Texture2D>.Dictionary

Public Methods

Method Description
ClearMaterialParameters ( ) : void

Clear the list of material parameters

ClearNodes ( ) : void

Clear the hierarchy of nodes

ClearTextures ( ) : void

Clear the list of textures

ComputeObjectDeltaPositionRotation ( Matrix4x4 &_Previous, Matrix4x4 &_Current, Vector &_DeltaPosition, Quat &_DeltaRotation, Vector &_Pivot ) : void

Helper method that helps to compute the difference in translation and rotation of an object moving from one frame to the other This is essentially used for motion blur

CreateCamera ( string _Name, Node _Parent, Matrix4x4 _Local2Parent ) : Camera

Creates a new camera for the scene

CreateLight ( string _Name, Node _Parent, Matrix4x4 _Local2Parent ) : Light

Creates a new light for the scene

CreateMaterialParameters ( string _Name, string _ShaderURL ) : MaterialParameters

Creates a new material parameter block

CreateMesh ( string _Name, Node _Parent, Matrix4x4 _Local2Parent ) : Mesh

Creates a new mesh for the scene

CreateNode ( string _Name, Node _Parent, Matrix4x4 _Local2Parent ) : Node

Creates a new node for the scene

CreateTexture ( string _URL, string _OpacityURL, bool _bCreateMipMaps ) : Texture2D

Creates a new texture for the scene

FindMaterialParameters ( int _ID ) : MaterialParameters

Finds a material parameter block by ID

FindMaterialParameters ( string _Name ) : MaterialParameters

Finds a material parameter block by name

FindMesh ( string _Name, bool _bCaseSensitive ) : Mesh

Finds a mesh by name

FindNode ( Node _Node, FindNodeDelegate _D ) : Node

Custom node finder

FindNode ( int _NodeID ) : Node

Finds a node by ID

FindNode ( string _Name, bool _bCaseSensitive ) : Node

Finds a node by name

FindTexture ( int _ID ) : Texture2D

Finds a texture by ID

Load ( System _Reader ) : void

Creates a scene from a stream

Save ( System _Writer ) : void

Writes a scene to a stream

Scene ( ) : System

Creates a default scene

Protected Methods

Method Description
FindMesh ( Node _Node, string _Name, bool _bCaseSensitive ) : Mesh
FindNode ( Node _Node, int _NodeID ) : Node
FindNode ( Node _Node, string _Name, bool _bCaseSensitive ) : Node

Private Methods

Method Description
QuatFromMatrix ( Matrix4x4 M ) : Quat
QuatInvert ( Quat q ) : Quat
QuatMultiply ( Quat q0, Quat q1 ) : Quat
RegisterNodeID ( Node _Node ) : void

Registers the node's ID and associate it to the node so we can find nodes by ID later

RotateAbout ( Vector _Point, Vector _Pivot, Quat _Rotation ) : Vector

Method Details

ClearMaterialParameters() public method

Clear the list of material parameters
public ClearMaterialParameters ( ) : void
return void

ClearNodes() public method

Clear the hierarchy of nodes
public ClearNodes ( ) : void
return void

ClearTextures() public method

Clear the list of textures
public ClearTextures ( ) : void
return void

ComputeObjectDeltaPositionRotation() public static method

Helper method that helps to compute the difference in translation and rotation of an object moving from one frame to the other This is essentially used for motion blur
public static ComputeObjectDeltaPositionRotation ( Matrix4x4 &_Previous, Matrix4x4 &_Current, Vector &_DeltaPosition, Quat &_DeltaRotation, Vector &_Pivot ) : void
_Previous Matrix4x4 The object's matrix at previous frame
_Current Matrix4x4 The object's matrix at current frame
_DeltaPosition Vector Returns the difference in position from last frame
_DeltaRotation Quat Returns the difference in rotation from last frame
_Pivot Vector Returns the pivot position the object rotated about
return void

CreateCamera() public method

Creates a new camera for the scene
public CreateCamera ( string _Name, Node _Parent, Matrix4x4 _Local2Parent ) : Camera
_Name string
_Parent FBX.Scene.Nodes.Node
_Local2Parent Matrix4x4
return FBX.Scene.Nodes.Camera

CreateLight() public method

Creates a new light for the scene
public CreateLight ( string _Name, Node _Parent, Matrix4x4 _Local2Parent ) : Light
_Name string
_Parent FBX.Scene.Nodes.Node
_Local2Parent Matrix4x4
return FBX.Scene.Nodes.Light

CreateMaterialParameters() public method

Creates a new material parameter block
public CreateMaterialParameters ( string _Name, string _ShaderURL ) : MaterialParameters
_Name string The name of the parameter block
_ShaderURL string The URL of the shader that uses theses parameters (this can be a path to an actual shader, or an identifier like Phong, Lambert, Blinn, whatever really as anyway these parameters are later read and identified by you so you can use whatever makes you comfortable)
return FBX.Scene.Materials.MaterialParameters

CreateMesh() public method

Creates a new mesh for the scene
public CreateMesh ( string _Name, Node _Parent, Matrix4x4 _Local2Parent ) : Mesh
_Name string
_Parent FBX.Scene.Nodes.Node
_Local2Parent Matrix4x4
return FBX.Scene.Nodes.Mesh

CreateNode() public method

Creates a new node for the scene
public CreateNode ( string _Name, Node _Parent, Matrix4x4 _Local2Parent ) : Node
_Name string
_Parent FBX.Scene.Nodes.Node
_Local2Parent Matrix4x4
return FBX.Scene.Nodes.Node

CreateTexture() public method

Creates a new texture for the scene
public CreateTexture ( string _URL, string _OpacityURL, bool _bCreateMipMaps ) : Texture2D
_URL string The relative texture URL to identify the texture
_OpacityURL string The optional relative URL to identify the opacity texture
_bCreateMipMaps bool True if the texture should be created using mip-maps
return FBX.Scene.Materials.Texture2D

FindMaterialParameters() public method

Finds a material parameter block by ID
public FindMaterialParameters ( int _ID ) : MaterialParameters
_ID int
return FBX.Scene.Materials.MaterialParameters

FindMaterialParameters() public method

Finds a material parameter block by name
public FindMaterialParameters ( string _Name ) : MaterialParameters
_Name string
return FBX.Scene.Materials.MaterialParameters

FindMesh() protected method

protected FindMesh ( Node _Node, string _Name, bool _bCaseSensitive ) : Mesh
_Node FBX.Scene.Nodes.Node
_Name string
_bCaseSensitive bool
return FBX.Scene.Nodes.Mesh

FindMesh() public method

Finds a mesh by name
public FindMesh ( string _Name, bool _bCaseSensitive ) : Mesh
_Name string
_bCaseSensitive bool
return FBX.Scene.Nodes.Mesh

FindNode() public method

Custom node finder
public FindNode ( Node _Node, FindNodeDelegate _D ) : Node
_Node FBX.Scene.Nodes.Node
_D FindNodeDelegate
return FBX.Scene.Nodes.Node

FindNode() protected method

protected FindNode ( Node _Node, int _NodeID ) : Node
_Node FBX.Scene.Nodes.Node
_NodeID int
return FBX.Scene.Nodes.Node

FindNode() protected method

protected FindNode ( Node _Node, string _Name, bool _bCaseSensitive ) : Node
_Node FBX.Scene.Nodes.Node
_Name string
_bCaseSensitive bool
return FBX.Scene.Nodes.Node

FindNode() public method

Finds a node by ID
public FindNode ( int _NodeID ) : Node
_NodeID int
return FBX.Scene.Nodes.Node

FindNode() public method

Finds a node by name
public FindNode ( string _Name, bool _bCaseSensitive ) : Node
_Name string
_bCaseSensitive bool
return FBX.Scene.Nodes.Node

FindTexture() public method

Finds a texture by ID
public FindTexture ( int _ID ) : Texture2D
_ID int
return FBX.Scene.Materials.Texture2D

Load() public method

Creates a scene from a stream
public Load ( System _Reader ) : void
_Reader System
return void

Save() public method

Writes a scene to a stream
public Save ( System _Writer ) : void
_Writer System
return void

Scene() public method

Creates a default scene
public Scene ( ) : System
return System

Property Details

m_Cameras protected_oe property

protected List m_Cameras
return List

m_ID2MaterialParameters protected_oe property

protected Dictionary m_ID2MaterialParameters
return MaterialParameters>.Dictionary

m_ID2Node protected_oe property

protected Dictionary m_ID2Node
return Node>.Dictionary

m_ID2Texture protected_oe property

protected Dictionary m_ID2Texture
return Texture2D>.Dictionary

m_Lights protected_oe property

protected List m_Lights
return List

m_MaterialParameters protected_oe property

protected List m_MaterialParameters
return List

m_MaterialParametersIDCounter protected_oe property

protected int m_MaterialParametersIDCounter
return int

m_Meshes protected_oe property

protected List m_Meshes
return List

m_NodeIDCounter protected_oe property

protected int m_NodeIDCounter
return int

m_Root protected_oe property

protected Node,FBX.Scene.Nodes m_Root
return FBX.Scene.Nodes.Node

m_TextureIDCounter protected_oe property

protected int m_TextureIDCounter
return int

m_Textures protected_oe property

protected List m_Textures
return List

m_URL2Texture protected_oe property

protected Dictionary m_URL2Texture
return Texture2D>.Dictionary