SaturnRingLibrary 0.9
SGL wrapper
 
Loading...
Searching...
No Matches
SRL::Scene3D Class Reference

Detailed Description

Rendering of 3D objects.

#include <srl_scene3d.hpp>

Static Public Member Functions

Draw functions
static void DrawSmoothMesh (Types::SmoothMesh &mesh, SRL::Math::Types::Vector3D &light)
 Draw SRL::Types::SmoothMesh.
 
static bool DrawMesh (Types::Mesh &mesh, const bool slaveOnly=false)
 Draw SRL::Types::Mesh.
 
static bool DrawOrthographicMesh (Types::Mesh &mesh, uint16_t attribute)
 Draw SRL::Types::Mesh with orthographic projection.
 
Light handling functions
static void SetDirectionalLight (const SRL::Math::Types::Vector3D &direction)
 Set directional light source.
 
static void LightInitGouraudTable (uint32_t gouraudRamOffset, uint8_t *vertexCalculationBuffer, Types::HighColor *tableStorage, uint32_t maxPolygons)
 Initialize gouraud table for light calculation with SRL::Scene3D::DrawSmoothMesh.
 
static void LightSetGouraudTable (Types::HighColor table[32])
 Set custom light gouraud table.
 
static void LightSetGouraudColor (const SRL::Types::HighColor color)
 Set gouraud color of light source.
 
static void LightSetColor (const SRL::Types::HighColor color)
 Set color of the flat light source (UseLight option)
 
static void LightCopyGouraudTable ()
 Copies gouraud table calculated by the library to VRAM.
 
Camera functions
static bool IsOnScreen (const SRL::Math::Types::Vector3D &point, const SRL::Math::Types::Fxp size)
 Check if point/circle area is on screen.
 
static void LookAt (const SRL::Math::Types::Vector3D &camera, const SRL::Math::Types::Vector3D &target, const SRL::Math::Types::Angle roll)
 Make camera look at certain point in the 3D scene.
 
static SRL::Math::Types::Fxp ProjectToScreen (const SRL::Math::Types::Vector3D &position, SRL::Math::Types::Vector2D *result)
 Projects 3D point onto a screen from current transformation matrix.
 
static void SetDepthDisplayLevel (const uint16_t level)
 Set value indicating how far in front of the projection surface to actually project.
 
static void SetPerspective (SRL::Math::Types::Angle angle)
 Set angle of the perspective projection.
 
static bool SetWindow (const SRL::Math::Types::Vector2D &topLeft, const SRL::Math::Types::Vector2D &bottomRight, const SRL::Math::Types::Vector2D &center, const SRL::Math::Types::Fxp &depthLimit)
 Set window limiting the display of sprites and polygons.
 
Transformation matrix operations
static void PushMatrix ()
 Push current matrix onto the matrix stack.
 
static void PushIdentityMatrix ()
 Push current matrix onto the matrix stack and set identity matrix as current.
 
static void PopMatrix ()
 Pop matrix from top of the stack and set it as current.
 
static void LoadIdentity ()
 Replaces current matrix with identity matrix.
 
static void IdentityTranslationMatrix ()
 Sets identity translation matrix.
 
static void IdentityRotationMatrix ()
 Sets identity rotation matrix.
 
static void SetMatrix (SRL::Math::Matrix43 &matrix)
 Set current matrix.
 
static void GetMatrix (SRL::Math::Matrix43 *result)
 Get current matrix.
 
static void InvertMatrix ()
 Inverts current matrix.
 
static void TransposeMatrix ()
 Transpose current matrix (zero movement in parallel direction)
 
static void MultiplyMatrix (SRL::Math::Matrix43 &matrix)
 Multiply current matrix by specified matrix.
 
static void Rotate (const SRL::Math::Types::Vector3D &axis, const SRL::Math::Types::Angle angle)
 Rotate current matrix around arbitrary axis by specific angle.
 
static void RotateX (const SRL::Math::Types::Angle angle)
 Rotate current matrix around X axis by specific angle.
 
static void RotateX (const SRL::Math::Types::Fxp sin, const SRL::Math::Types::Fxp cos)
 Rotate current matrix around X axis by specific sinus and cosine values.
 
static void RotateY (const SRL::Math::Types::Angle angle)
 Rotate current matrix around Y axis by specific angle.
 
static void RotateY (const SRL::Math::Types::Fxp sin, const SRL::Math::Types::Fxp cos)
 Rotate current matrix around Y axis by specific sinus and cosine values.
 
static void RotateZ (const SRL::Math::Types::Angle angle)
 Rotate current matrix around Z axis by specific angle.
 
static void RotateZ (const SRL::Math::Types::Fxp sin, const SRL::Math::Types::Fxp cos)
 Rotate current matrix around X axis by specific sinus and cosine values.
 
static void Scale (const SRL::Math::Types::Fxp x, const SRL::Math::Types::Fxp y, const SRL::Math::Types::Fxp z)
 Scale current transformation matrix.
 
static void Scale (const SRL::Math::Types::Vector3D &scale)
 Scale current transformation matrix.
 
static void Scale (const SRL::Math::Types::Fxp scale)
 Scale current transformation matrix.
 
static void Translate (const SRL::Math::Types::Fxp x, const SRL::Math::Types::Fxp y, const SRL::Math::Types::Fxp z)
 Translate current transformation matrix.
 
static void Translate (const SRL::Math::Types::Vector3D &delta)
 Translate current transformation matrix.
 
static SRL::Math::Types::Vector3D TransformPoint (const SRL::Math::Types::Vector3D &point)
 Transforms point by current transformation matrix.
 
static SRL::Math::Types::Vector3D TransformVector (const SRL::Math::Types::Vector3D &point)
 Transforms direction vector by current transformation matrix.