coastline 0.0.4
Loading...
Searching...
No Matches
coastline::ModelOptions Struct Reference

What of a glTF document a RenderModel takes, and how. More...

#include <scenerenderer.h>

Collaboration diagram for coastline::ModelOptions:

Public Attributes

std::optional< std::string > node
 The name of a node to draw in place of the default scene, such as the sky of a track or a wheel of a car, at its origin without its translation, or none for the scene.
std::optional< std::array< std::uint8_t, 3 > > paint
 The red, green, and blue of the colour of a car, which paints the first two colours of the images of its materials as SetMaterialPaletteColors() paints them, or none for the colours of the images.
std::function< bool(const std::string &)> parts
 Whether a node of a mesh is drawn, by its name, or none for every node.
bool reflects = false
 Whether every part of the model reflects the sky whatever its materials set, as RenderVehicleModel() sets G_TEXTURE_GEN and the combiner of the reflection before the highlighted parts of a car in its other look.
std::optional< std::filesystem::path > images
 Another glTF document of the same model whose images take the place of these, one for one, such as the textures of the cartridge on a car of the PC release, or none.
const GltfDocument * imageDocument = nullptr
 A document in memory taken in place of images, or null.
int variants = 0
 The number of palette variants of the images of materials, such as the lights of a car.
std::function< bool(SDL_Palette *, int material, int variant)> paletteVariant
 Change the palette of an image of a material for a variant, and report whether the image has variants; called for each variant of each image with a material.
std::function< std::optional< ImageDamage >(int set)> damage
 The damage of the image of a paint set of the document, by the set, or none for an image the damage does not darken; none for a model without damage.
const std::array< std::vector< std::uint8_t >, CAR_DAMAGE_LEVELS > * damageMasks = nullptr
 The 64 by 64 intensities of the damage of each level after the first, row by row from the top, which darken a damaged image.
bool optional = false
 Whether the document may have nothing to draw, such as a part a level of detail of a car does not have, which then loads no model without an error.
bool oneCycle = false
 Whether the caller of the display lists sets one cycle, as RenderSkybox() and RenderVehicleHeadlightBeams() do.

Detailed Description

What of a glTF document a RenderModel takes, and how.

A RenderDocument takes the images, the variants and their palettes, and the damage, and each model of the document the rest.

Member Data Documentation

◆ node

std::optional<std::string> coastline::ModelOptions::node

The name of a node to draw in place of the default scene, such as the sky of a track or a wheel of a car, at its origin without its translation, or none for the scene.

◆ paint

std::optional<std::array<std::uint8_t, 3> > coastline::ModelOptions::paint

The red, green, and blue of the colour of a car, which paints the first two colours of the images of its materials as SetMaterialPaletteColors() paints them, or none for the colours of the images.

◆ parts

std::function<bool(const std::string &)> coastline::ModelOptions::parts

Whether a node of a mesh is drawn, by its name, or none for every node.

◆ reflects

bool coastline::ModelOptions::reflects = false

Whether every part of the model reflects the sky whatever its materials set, as RenderVehicleModel() sets G_TEXTURE_GEN and the combiner of the reflection before the highlighted parts of a car in its other look.

◆ images

std::optional<std::filesystem::path> coastline::ModelOptions::images

Another glTF document of the same model whose images take the place of these, one for one, such as the textures of the cartridge on a car of the PC release, or none.

A document with another number of images is not taken.

◆ imageDocument

const GltfDocument* coastline::ModelOptions::imageDocument = nullptr

A document in memory taken in place of images, or null.

The caller retains the document until the load returns.

◆ variants

int coastline::ModelOptions::variants = 0

The number of palette variants of the images of materials, such as the lights of a car.

A model of a document draws the variants only where its own options have them.

◆ paletteVariant

std::function<bool(SDL_Palette *, int material, int variant)> coastline::ModelOptions::paletteVariant

Change the palette of an image of a material for a variant, and report whether the image has variants; called for each variant of each image with a material.

◆ damage

std::function<std::optional<ImageDamage>(int set)> coastline::ModelOptions::damage

The damage of the image of a paint set of the document, by the set, or none for an image the damage does not darken; none for a model without damage.

◆ damageMasks

const std::array<std::vector<std::uint8_t>, CAR_DAMAGE_LEVELS>* coastline::ModelOptions::damageMasks = nullptr

The 64 by 64 intensities of the damage of each level after the first, row by row from the top, which darken a damaged image.

◆ optional

bool coastline::ModelOptions::optional = false

Whether the document may have nothing to draw, such as a part a level of detail of a car does not have, which then loads no model without an error.

◆ oneCycle

bool coastline::ModelOptions::oneCycle = false

Whether the caller of the display lists sets one cycle, as RenderSkybox() and RenderVehicleHeadlightBeams() do.

The lists do not set the cycle type themselves, and DrawModelList(), RenderTrackGeometry(), and RenderVehicleModel() set two.


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