Description
The ScenePanel
method is a static extension method for the PanelCreator
class, allowing you to create a ScenePanel
within a specified SceneWorld
. This method is useful for rendering 3D scenes within a UI panel, providing a way to integrate 3D content into your user interface.
Usage
To use the ScenePanel
method, you need to have a PanelCreator
instance. You can then call this method to create a ScenePanel
by specifying the SceneWorld
, position, rotation, field of view, and an optional class name for the panel.
Parameters:
self
: The PanelCreator
instance to which this method is an extension.
world
: The SceneWorld
in which the scene will be rendered.
position
: A Vector3
representing the position of the scene within the panel.
rotation
: A Rotation
object defining the orientation of the scene.
fieldOfView
: A float
value representing the field of view for the scene camera.
classname
: An optional string
parameter to specify a class name for the panel, useful for styling or identification purposes.
Example
// Example of creating a ScenePanel
var panelCreator = new PanelCreator();
var sceneWorld = new SceneWorld();
Vector3 position = new Vector3(0, 0, 0);
Rotation rotation = Rotation.Identity;
float fieldOfView = 90.0f;
string classname = "myScenePanel";
// Create a ScenePanel
ScenePanel scenePanel = SceneConstructor.ScenePanel(panelCreator, sceneWorld, position, rotation, fieldOfView, classname);