You.i Engine
CYISceneBuilder Class Reference

#include <scenetree/YiSceneBuilder.h>

Classes

struct  RenderTargetConfiguration
 

Static Public Member Functions

static std::unique_ptr< CYISceneNodeCreateSolid (CYISceneManager *pSceneManager, const CYIColor &color, float width, float height)
 
static std::unique_ptr< CYIImageSceneNodeCreateImage (CYISceneManager *pSceneManager, const CYIString &assetPath)
 
static std::unique_ptr< CYIImageSceneNodeCreateImage (CYISceneManager *pSceneManager, const CYIString &assetPath, float width, float height)
 
static std::unique_ptr< CYIImageSceneNodeCreateImage (CYISceneManager *pSceneManager, const std::shared_ptr< CYIAssetTextureBase > &pTextureAsset, float width, float height)
 
static std::unique_ptr< CYIScreenRenderTargetCreateScreenRenderTarget (const CYIViewport &viewport)
 
static std::unique_ptr< CYIOffscreenRenderTargetCreateOffscreenRenderTarget (CYIRenderTarget::Type targetType, uint32_t targetWidth, uint32_t targetHeight)
 
static std::unique_ptr< CYIRenderTargetCreateRenderTarget (CYIRenderTarget::Type renderTargetType, size_t width, size_t height)
 
static std::unique_ptr< CYIOrthographicCameraSceneNodeCreateOrthographicCameraSceneNode (CYISceneManager *pSceneManager, const YI_RECT_REL &worldRegionOfInterest)
 
static std::unique_ptr< CYIPerspectiveCameraSceneNodeCreatePerspectiveCameraSceneNode (CYISceneManager *pSceneManager, const YI_RECT_REL &worldRegionOfInterest, float desiredCameraDistance)
 
static std::unique_ptr< CYISceneViewCreateOrthographicScene (CYISceneManager *pSceneManager, const YI_RECT_REL &worldRegionOfInterest, const RenderTargetConfiguration &renderTargetConfiguration)
 
static std::unique_ptr< CYISceneViewCreatePerspectiveScene (CYISceneManager *pSceneManager, const YI_RECT_REL &worldRegionOfInterest, float desiredCameraDistance, const RenderTargetConfiguration &renderTargetConfiguration)
 

Member Function Documentation

◆ CreateImage() [1/3]

static std::unique_ptr<CYIImageSceneNode> CYISceneBuilder::CreateImage ( CYISceneManager pSceneManager,
const CYIString assetPath 
)
static

Creates an image node from assetPath which is relative to the assets directory. The image size determines the node's size.

An asset will be added to the asset manager.

See also
CYIAssetLoader
CYIAssetManager
CYIAssetLocator

◆ CreateImage() [2/3]

static std::unique_ptr<CYIImageSceneNode> CYISceneBuilder::CreateImage ( CYISceneManager pSceneManager,
const CYIString assetPath,
float  width,
float  height 
)
static

Creates an image node from assetPath which is relative to the assets directory. The node's size is determined by width and height.

An asset will be added to the asset manager.

See also
CYIAssetLoader
CYIAssetManager
CYIAssetLocator

◆ CreateImage() [3/3]

static std::unique_ptr<CYIImageSceneNode> CYISceneBuilder::CreateImage ( CYISceneManager pSceneManager,
const std::shared_ptr< CYIAssetTextureBase > &  pTextureAsset,
float  width,
float  height 
)
static

Creates an image node from the provided texture asset. The node's size is determined by width and height.

The asset will not be added to the asset manager.

See also
CYIAssetLoader
CYIAssetManager

◆ CreateOffscreenRenderTarget()

static std::unique_ptr<CYIOffscreenRenderTarget> CYISceneBuilder::CreateOffscreenRenderTarget ( CYIRenderTarget::Type  targetType,
uint32_t  targetWidth,
uint32_t  targetHeight 
)
static

Creates a new offscreen render target with type targetType. Initializes the target size to targetWidth and targetHeight. The viewport will be initialized to (0, 0, targetWidth, targetHeight).

Note
targetType must be one of the offscreen target types.

◆ CreateOrthographicCameraSceneNode()

static std::unique_ptr<CYIOrthographicCameraSceneNode> CYISceneBuilder::CreateOrthographicCameraSceneNode ( CYISceneManager pSceneManager,
const YI_RECT_REL worldRegionOfInterest 
)
static

Creates an orthographic camera centered on the worldRegionOfInterest, whose view tightly encompasses the worldRegionOfInterest. An orthographic camera is suitable for 2D scenes. The resulting coordinate system has the origin located at the top-left of the window.

See also
CYIOrthographicCameraSceneNode

◆ CreateOrthographicScene()

static std::unique_ptr<CYISceneView> CYISceneBuilder::CreateOrthographicScene ( CYISceneManager pSceneManager,
const YI_RECT_REL worldRegionOfInterest,
const RenderTargetConfiguration renderTargetConfiguration 
)
static

Creates an empty scene with an orthographic (2D) camera centered on worldRegionOfInterest whose view tightly encompasses worldRegionOfInterest. The resulting coordinate system has the origin located at the top-left of the window. The resulting camera view will be rendered into a render target determined by renderTargetType, inside the bounds (0,0) to (viewportWidth, viewportHeight). If the renderTargetType is an off-screen target, a new buffer will be allocated with dimensions viewportWidth by viewportHeight, but a screen render target will share the existing screen buffer. Typically, these dimensions correspond to those of the window, these values can be queried via CYISurface.

See also
CYISurface::GetWidth
CYISurface::GetHeight
CYIOrthographicCameraSceneNode

◆ CreatePerspectiveCameraSceneNode()

static std::unique_ptr<CYIPerspectiveCameraSceneNode> CYISceneBuilder::CreatePerspectiveCameraSceneNode ( CYISceneManager pSceneManager,
const YI_RECT_REL worldRegionOfInterest,
float  desiredCameraDistance 
)
static

Creates a perspective camera centered on worldRegionOfInterest, whose view tightly encompasses the worldRegionOfInterest. A perspective camera is suitable for 3D scenes. The resulting coordinate system has the origin located at the top-left of the window. Higher values of desiredCameraDistance will result in a narrower field of view, de-emphasizing the perspective, because the camera view encompasses the same region but at a further distance.

See also
CYIPerspectiveCameraSceneNode

◆ CreatePerspectiveScene()

static std::unique_ptr<CYISceneView> CYISceneBuilder::CreatePerspectiveScene ( CYISceneManager pSceneManager,
const YI_RECT_REL worldRegionOfInterest,
float  desiredCameraDistance,
const RenderTargetConfiguration renderTargetConfiguration 
)
static

Creates an empty scene with a perspective (3D) camera centered on worldRegionOfInterest whose view tightly encompasses worldRegionOfInterest, at desiredCameraDistance. The resulting coordinate system has the origin located at the top-left of the window. Higher values of desiredCameraDistance will result in a narrower field of view, de-emphasizing the perspective, because the camera view encompasses the same region but at a further distance. The resulting camera view will be rendered into a render target determined by renderTargetType, inside the bounds (0,0) to (viewportWidth, viewportHeight). If the renderTargetType is an off-screen target, a new buffer will be allocated with dimensions viewportWidth by viewportHeight, but a screen render target will share the existing screen buffer. Typically, these dimensions correspond to those of the window, these values can be queried via CYISurface.

See also
CYISurface::GetWidth
CYISurface::GetHeight
CYIPerspectiveCameraSceneNode

◆ CreateRenderTarget()

static std::unique_ptr<CYIRenderTarget> CYISceneBuilder::CreateRenderTarget ( CYIRenderTarget::Type  renderTargetType,
size_t  width,
size_t  height 
)
static

Returns a render target of the specified renderTargetType (representing the screen buffer, or some off-screen buffer) whose size is width by height pixels. For an offscreen renderTargetType a new buffer will be allocated using the dimensions, but a screen buffer will simply refer to a region of the screen buffer, requiring no additional allocation. Typically, these dimensions correspond to those of the window, these values can be queried via CYISurface.

See also
CYISurface::GetWidth
CYISurface::GetHeight

◆ CreateScreenRenderTarget()

static std::unique_ptr<CYIScreenRenderTarget> CYISceneBuilder::CreateScreenRenderTarget ( const CYIViewport viewport)
static

Creates a new screen render target and initializes it with viewport. A typical viewport might fill the window using CYISurface::GetWidth, CYISurface::GetHeight for the viewport dimensions and 0, 0 for the offset. Other values may be used if the scene should not fill the window.

See also
CYISurface::GetWidth
CYISurface::GetHeight

◆ CreateSolid()

static std::unique_ptr<CYISceneNode> CYISceneBuilder::CreateSolid ( CYISceneManager pSceneManager,
const CYIColor color,
float  width,
float  height 
)
static

Creates a "solid" node given a color and a size.

An asset will be added to the asset manager named after the color (e.g. "\#FF0000FF") if it doesn't already exist.


The documentation for this class was generated from the following file: