Hatch Game Engine Documentation v1.4.0
The documentation for the Hatch Game Engine
Loading...
Searching...
No Matches
Scene3D Class Reference

The main interface for drawing 3D elements. More...

Public Member Functions

integer Create (integer unloadPolicy)
 Creates a 3D scene.
void Delete (integer scene3DIndex)
 Deletes a 3D scene.
void SetDrawMode (integer scene3DIndex, DrawMode drawMode)
 Sets the draw mode of the 3D scene.
void SetFaceCullMode (integer scene3DIndex, FaceCull cullMode)
 Sets the face culling mode of the 3D scene. (hardware-renderer only).
void SetFieldOfView (integer scene3DIndex, matrix fieldOfView)
 Sets the field of view of the 3D scene.
void SetFarClippingPlane (integer scene3DIndex, matrix farClippingPlane)
 Sets the far clipping plane of the 3D scene.
void SetNearClippingPlane (integer scene3DIndex, matrix farClippingPlane)
 Sets the near clipping plane of the 3D scene.
void SetViewMatrix (integer scene3DIndex, matrix viewMatrix)
 Sets the view matrix of the 3D scene.
void SetCustomProjectionMatrix (integer scene3DIndex, matrix projMatrix)
 Sets a custom projection matrix.
void SetAmbientLighting (integer scene3DIndex, number red, number green, number blue)
 Sets the ambient lighting of the 3D scene.
void SetDiffuseLighting (integer scene3DIndex, number red, number green, number blue)
 Sets the diffuse lighting of the 3D scene.
void SetSpecularLighting (integer scene3DIndex, number red, number green, number blue)
 Sets the specular lighting of the 3D scene.
void SetFogEquation (integer scene3DIndex, FogEquation fogEquation)
 Sets the fog equation of the 3D scene.
void SetFogStart (integer scene3DIndex, number start)
 Sets the near distance used in the linear equation of the 3D scene's fog.
void SetFogEnd (integer scene3DIndex, number end)
 Sets the far distance used in the linear equation of the 3D scene's fog.
void SetFogDensity (integer scene3DIndex, number density)
 Sets the density used in the exponential equation of the 3D scene's fog.
void SetFogColor (integer scene3DIndex, number red, number green, number blue)
 Sets the fog color of the 3D scene.
void SetFogSmoothness (integer scene3DIndex, number smoothness)
 Sets the smoothness of the 3D scene's fog.
void SetPointSize (integer scene3DIndex, decimal pointSize)
 Sets the point size of the 3D scene. (hardware-renderer only).
void Clear (integer scene3DIndex)
 Removes all previously drawn elements out of a 3D scene.

Detailed Description

The main interface for drawing 3D elements.

Member Function Documentation

◆ Clear()

void Scene3D.Clear ( integer scene3DIndex)

Removes all previously drawn elements out of a 3D scene.

Parameters
scene3DIndexThe index of the 3D scene.

◆ Create()

integer Scene3D.Create ( integer unloadPolicy)

Creates a 3D scene.

Parameters
unloadPolicyWhether to delete the 3D scene at the end of the current Scene, or the game end.
Returns
The index of the created 3D scene.

◆ Delete()

void Scene3D.Delete ( integer scene3DIndex)

Deletes a 3D scene.

Parameters
scene3DIndexThe index of the 3D scene to delete.

◆ SetAmbientLighting()

void Scene3D.SetAmbientLighting ( integer scene3DIndex,
number red,
number green,
number blue )

Sets the ambient lighting of the 3D scene.

Parameters
scene3DIndexThe index of the 3D scene.
redThe red color value, bounded by 0.0 - 1.0.
greenThe green color value, bounded by 0.0 - 1.0.
blueThe blue color value, bounded by 0.0 - 1.0.

◆ SetCustomProjectionMatrix()

void Scene3D.SetCustomProjectionMatrix ( integer scene3DIndex,
matrix projMatrix )

Sets a custom projection matrix.

Parameters
scene3DIndexThe index of the 3D scene.
projMatrixThe projection matrix.

◆ SetDiffuseLighting()

void Scene3D.SetDiffuseLighting ( integer scene3DIndex,
number red,
number green,
number blue )

Sets the diffuse lighting of the 3D scene.

Parameters
scene3DIndexThe index of the 3D scene.
redThe red color value, bounded by 0.0 - 1.0.
greenThe green color value, bounded by 0.0 - 1.0.
blueThe blue color value, bounded by 0.0 - 1.0.

◆ SetDrawMode()

void Scene3D.SetDrawMode ( integer scene3DIndex,
DrawMode drawMode )

Sets the draw mode of the 3D scene.

Parameters
scene3DIndexThe index of the 3D scene.
drawModeThe type of drawing to use for the vertices in the 3D scene.

◆ SetFaceCullMode()

void Scene3D.SetFaceCullMode ( integer scene3DIndex,
FaceCull cullMode )

Sets the face culling mode of the 3D scene. (hardware-renderer only).

Parameters
scene3DIndexThe index of the 3D scene.
cullModeThe type of face culling to use for the vertices in the 3D scene.

◆ SetFarClippingPlane()

void Scene3D.SetFarClippingPlane ( integer scene3DIndex,
matrix farClippingPlane )

Sets the far clipping plane of the 3D scene.

Parameters
scene3DIndexThe index of the 3D scene.
farClippingPlaneThe far clipping plane value.

◆ SetFieldOfView()

void Scene3D.SetFieldOfView ( integer scene3DIndex,
matrix fieldOfView )

Sets the field of view of the 3D scene.

Parameters
scene3DIndexThe index of the 3D scene.
fieldOfViewThe field of view value.

◆ SetFogColor()

void Scene3D.SetFogColor ( integer scene3DIndex,
number red,
number green,
number blue )

Sets the fog color of the 3D scene.

Parameters
scene3DIndexThe index of the 3D scene.
redThe red color value, bounded by 0.0 - 1.0.
greenThe green color value, bounded by 0.0 - 1.0.
blueThe blue color value, bounded by 0.0 - 1.0.

◆ SetFogDensity()

void Scene3D.SetFogDensity ( integer scene3DIndex,
number density )

Sets the density used in the exponential equation of the 3D scene's fog.

Parameters
scene3DIndexThe index of the 3D scene.
densityThe fog density.

◆ SetFogEnd()

void Scene3D.SetFogEnd ( integer scene3DIndex,
number end )

Sets the far distance used in the linear equation of the 3D scene's fog.

Parameters
scene3DIndexThe index of the 3D scene.
endThe end value.

◆ SetFogEquation()

void Scene3D.SetFogEquation ( integer scene3DIndex,
FogEquation fogEquation )

Sets the fog equation of the 3D scene.

Parameters
scene3DIndexThe index of the 3D scene.
fogEquationThe fog equation to use.

◆ SetFogSmoothness()

void Scene3D.SetFogSmoothness ( integer scene3DIndex,
number smoothness )

Sets the smoothness of the 3D scene's fog.

Parameters
scene3DIndexThe index of the 3D scene.
smoothnessThe smoothness, bounded by 0.0 - 1.0.

◆ SetFogStart()

void Scene3D.SetFogStart ( integer scene3DIndex,
number start )

Sets the near distance used in the linear equation of the 3D scene's fog.

Parameters
scene3DIndexThe index of the 3D scene.
startThe start value.

◆ SetNearClippingPlane()

void Scene3D.SetNearClippingPlane ( integer scene3DIndex,
matrix farClippingPlane )

Sets the near clipping plane of the 3D scene.

Parameters
scene3DIndexThe index of the 3D scene.
farClippingPlaneThe near clipping plane value.

◆ SetPointSize()

void Scene3D.SetPointSize ( integer scene3DIndex,
decimal pointSize )

Sets the point size of the 3D scene. (hardware-renderer only).

Parameters
scene3DIndexThe index of the 3D scene.
pointSizeThe point size.

◆ SetSpecularLighting()

void Scene3D.SetSpecularLighting ( integer scene3DIndex,
number red,
number green,
number blue )

Sets the specular lighting of the 3D scene.

Parameters
scene3DIndexThe index of the 3D scene.
redThe red color value, bounded by 0.0 - 1.0.
greenThe green color value, bounded by 0.0 - 1.0.
blueThe blue color value, bounded by 0.0 - 1.0.

◆ SetViewMatrix()

void Scene3D.SetViewMatrix ( integer scene3DIndex,
matrix viewMatrix )

Sets the view matrix of the 3D scene.

Parameters
scene3DIndexThe index of the 3D scene.
viewMatrixThe view matrix.