Train Simulator NEXT
In This Topic
    Shape Files 0.1
    In This Topic

    Shape files (*.Shape) contains all the geometry and object related data like materials, lights, animations and scripts.

    Basic File Layout

    The file contains a identifier ("SHAPE"), a version and an encoded stream.

    Basic File Layout
    Copy Code
    astring       Identifier = "SHAPE";
    ui16          Version    = 01;      // = 0.1
    EncodedStream Stream;

    Stream Content

    The stream contains the following information:

    1. If UTF-16 or UTF-8 strings are used.
    2. Author description
    3. Volume information
    4. Properties
    5. Materials
    6. Lights
    7. Lens Flares
    8. Cameras
    9. Anchors
    10. Sub Shapes (reserved)
    11. Scripts
    12. Sounds
    13. Geometry
    14. Node structure
    15. and Animations
    Copy Code
    // String format
    bool             HasUnicodeStrings;
    
    // Author information
    string           Author;
    string           Website;
    bool             AllowEdit;
    
    // Volume information
    float3           VolumeAABB_MinExtends;
    float3           VolumeAABB_MaxExtends;
    float4           VolumeSphere;          // xyz position, w = radius
    // Shape properties
    ui16             NumProperties;
    SHAPE_PROPERTY   Property[NumProperties];
    
    // Materials
    ui16             NumMaterials;
    SHAPE_MATERIAL   Material[NumMaterials];
    
    // Lights
    ui16             NumLights;
    SHAPE_LIGHT      Light[NumLights];
    
    // Lens Flares
    ui16             NumLensFlares;
    SHAPE_LENS_FLARE LensFlare[NumLensFlares];
    
    // Cameras
    ui8              NumCameras;
    SHAPE_CAMERA     Camera[NumCameras];
    
    // Anchors
    ui8              NumAnchors;
    SHAPE_ANCHOR     Anchor[NumAnchors];
    
    // Sub Shapes (reserved)
    ui8              NumSubShapes;
    SHAPE_SUB_SHAPE  SubShape[NumSubShapes];
    
    // Scripts
    ui8              NumScripts;
    SHAPE_SCRIPT     Script[NumScripts];
    
    // Sounds
    ui8              NumSounds;
    SHAPE_SOUND      Sound[NumSounds];
    
    // Geometry
    ui16             NumGeometries;
    SHAPE_GEOMETRY   Geometry[NumGeometries];
    
    // Node Struture
    SHAPE_NODE       RootNode;
    
    // Animations
    ui16             NumAnimations;
    SHAPE_ANIMATION  Animation[NumAnimations];

    String Type

    HasUnicodeStrings

    Type: bool

    If true, all strings are stored as a ustring (wchar_t string). If false, all strings are stored as a astring (char string).

    Strings are stated in this page as string, regardless of the stored type. All strings a stored with a string size type of ui8. For example, if true + string  is given, this results in stream data as ui8 StringSize; wchar_t StringData[StringSize];.

    Author information

    Author

    Type: string

    The author name. This can be also the name of the company.

    Website

    Type: string

    The author website link.

    AllowEdit

    Type: bool

    If true, the author notices that you shoudn't change anything unless you have the permission to do so. This does not impact the handling in the editors and tools, but gives the user a hint how to handle this shape.

    Volume information

    VolumeAABB_MinExtends

    Type: float3

    The minimum extends of the axis-aligned bounding-box volume of the shape in m. Used for i.e. collision detection.

    VolumeAABB_MaxExtends

    Type: float3

    The maximum extends of the axis-aligned bounding-box volume of the shape in m. Used for i.e. collision detection.

    VolumeSphere

    Type: float4

    The center of the sphere volume (xyz) and its radius (w) in m.

    Shape Properties

    NumProperties

    Type: ui16

    The number of shape properties.

    Property

    Type: SHAPE_PROPERTY

    Count: NumProperties

    The list of shape properties.

    Shape Property Structure
    Copy Code
    struct SHAPE_PROPERTY
    {
        string Name;
        string Value;
    };

    Name

    Type: string

    The name of the property.

    Value

    Type: string

    The value of the property.

    Materials

    NumMaterials

    Type: ui16

    The number of materials.

    Material

    Type: SHAPE_MATERIAL

    Count: NumMaterials

    The list of materials.

    Structure

    Material Structure
    Copy Code
    struct SHAPE_MATERIAL
    {
         string Name;
         string SpecialEffect;
    
         // Shape Rendering
         bool                   HasOpacity;
         bool                   NoShadow;
    
         // Rasterization and Depth Stencil
         ui8                    FillMode;              // = D3D12_FILL_MODE
         ui8                    CullMode;              // = D3D12_CULL_MODE
         ui8                    ConservativeRaster;    // = D3D12_CONSERVATIVE_RASTERIZATION_MODE
         ui8                    PrimitiveTopologyType; // = D3D12_PRIMTIVE_TOPOLOGY_TYPE
         ui8                    ForcedSampleCount;
         bool                   FrontCounterClockWise;
         bool                   DepthClipEnable;
         bool                   MultisampleEnable;
         bool                   AntialiasedLineEnable;
         bool                   DepthEnable;
         bool                   DepthBoundsTestEnable;
    
         // Values
         ui8                    NumDefinitions;
         ui8                    NumBooleans;
         ui8                    NumIntegers;
         ui8                    NumUnsignedIntegers;
         ui8                    NumFloats;
         ui8                    NumVectors2;
         ui8                    NumVectors3;
         ui8                    NumVectors4;
         ui8                    NumMaps;
        
         MATERIAL_VALUE<string> Definition[NumDefinitions];
         MATERIAL_VALUE<bool>   Boolea[NumBooleans];
         MATERIAL_VALUE<i32>    Integer[NumIntegers];
         MATERIAL_VALUE<ui32>   UnsignedInteger[NumUnsignedIntegers];
         MATERIAL_VALUE<float>  Float[NumFloats];
         MATERIAL_VALUE<float2> Float2[NumVectors2];
         MATERIAL_VALUE<float3> Float3[NumVectors3];
         MATERIAL_VALUE<float4> Float4[NumVectors4];
         MATERIAL_MAP           Map[NumMaps];
    
         // Sampler
         ui8                    Filter;         // = D3D12_FILTER
         ui8                    AddressU;       // = D3D12_TEXTURE_ADDRESS_MODE
         ui8                    AddressV;       // = D3D12_TEXTURE_ADDRESS_MODE
         ui8                    AddressW;       // = D3D12_TEXTURE_ADDRESS_MODE
         ui8                    ComparisonFunc; // = D3D12_COMPARISON_FUNC
         float4                 BorderColor;
         ui8                    MaxAnisotropy;
         float                  MipLODBias;
         float                  MinLOD;
         float                  MaxLOD;
    
         // Blend State
         ui8                    SrcBlend;        // = D3D12_BLEND
         ui8                    DestBlend;       // = D3D12_BLEND
         ui8                    BlendOp;         // = D3D12_BLEND_OP
         ui8                    SrcBlendAlpha;   // = D3D12_BLEND
         ui8                    DestBlendAlpha;  // = D3D12_BLEND
         ui8                    BlendOpAlpha;    // = D3D12_BLEND_OP
         ui8                    LogicOp;         // = D3D12_LOGIC_OP
         ui8                    AlphaToCoverage;
    };

    Name

    Type: string

    The name of this material.

    SpecialEffect

    Type: string

    The name of the effect. If not set, "Standard".

    Rasterizer and Depth Stencil

    HasOpacity

    Type: bool

    True if the material has not-opaque maps, false if opaque (default: false).

    NoShadow

    Type: bool

    True if the material should not cast shadows (default: false). (Reserved)

    FillMode

    Type: ui8 (D3D12_FILL_MODE)

    The fill mode (default: D3D12_FILL_MODE_SOLID).

    CullMode

    Type: ui8 (D3D12_CULL_MODE)

    The cull mode (default: D3D12_CULL_MODE_BACK).

    ConservativeRaster

    Type: ui8 (D3D12_CONSERVATIVE_RASTERIZATION_MODE)

    The conservative rasterization mode (default: D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF).

    PrimitiveTopologyType

    Type: ui8 (D3D12_PRIMITIVE_TOPOLOGY_TYPE)

    The primitive topology type (default: D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE).

    ForcedSampleCount

    Type: ui8

    The forced sampling count (default: 0).

    FrontCounterClockwise

    Type: bool

    True if the triangles are ordered in front counter clockwise mode (default: false).

    DepthClipEnable

    Type: bool

    True to enale depth clipping, false if not (default: true).

    MultisampleEnable

    Type: bool

    True to enable multi sampling, false if not (default: true).

    AntialiasedLineEnable

    Type: bool

    True to enable antialiased lines, false if not (default: false). Must be false if MultisampleEnable is true.

    DepthEnable

    Type: bool

    True to enable depth comparison, false if not (default: true).

    DepthBoundsTestEnable

    Type: bool

    True if depth-bound tests are enabled, false if not (default: false).

    Values

    NumDefinitions

    Type: ui8

    The number of definitions.

    NumBooleans

    Type: ui8

    The number of boolean properties.

    NumIntegers

    Type: ui8

    The number of int properties.

    NumUnsignedIntegers

    Type: ui8

    The number of uint properties.

    NumFloats

    Type: ui8

    The number of float properties.

    NumVectors2

    Type: ui8

    The number of 2D vector properties.

    NumVectors3

    Type: ui8

    The number of 3D vector properties.

    NumVectors4

    Type: ui8

    The number of 4D vector properties.

    NumMaps

    Type: ui8

    The number of map properties.

    Definition

    Type: MATERIAL_VALUE<string>

    Count: NumDefinitions

    The effect definitions.

    Boolean

    Type: MATERIAL_VALUE<bool>

    Count: NumBooleans

    The bool properties.

    Integer

    Type: MATERIAL_VALUE<i32>

    Count: NumIntegers

    The int properties.

    UnsignedInteger

    Type: MATERIAL_VALUE<ui32>

    Count: NumUnsignedIntegers

    The uint properties.

    Float

    Type: MATERIAL_VALUE<float>

    Count: NumFloats

    The float properties.

    Vector2

    Type: MATERIAL_VALUE<float2>

    Count: NumVectors2

    The float2 properties.

    Vector3

    Type: MATERIAL_VALUE<float3>

    Count: NumVectors3

    The float3 properties.

    Vector4

    Type: MATERIAL_VALUE<float4>

    Count: NumVectors4

    The float4 properties.

    Map

    Type: MATERIAL_MAP

    Count: NumMaps

    The maps (textures).

    MATERIAL_VALUE<T> Structure
    Copy Code
    template<typename T> struct MATERIAL_VALUE
    {
        string Name;
        T      Value;
    };

    Name

    Type: string

    The name of the value.

    Value

    Type: T

    The value.

    MATERIAL_MAP Structure
    Copy Code
    struct MATERIAL_MAP
    {
        string Name;
        string FileName;
        ui8    Index;
    };

    Name

    Type: string

    The name of the texture in the effect.

    FileName

    Type: string

    The name of the file incl. its extension.

    Index (reserved)

    Type: ui8

    The location (column) in the uv texture atlas. Reserved feature.

    Sampler

    The following data is used to build a D3D12_SAMPLER_DESC.

    Filter

    Type: ui8

    The texture filter mode (default: D3D12_FILTER_MIN_MAG_MIP_LINEAR).

    AddressU

    Type: ui8

    The texture address mode for the u channel (default: D3D12_TEXTURE_ADDRESS_MODE_WRAP).

    AddressV

    Type: ui8

    The texture address mode for the v channel (default: D3D12_TEXTURE_ADDRESS_MODE_WRAP).

    AddressW

    Type: ui8

    The texture address mode for the w channel (default: D3D12_TEXTURE_ADDRESS_MODE_WRAP).

    ComparisonFunc

    Type: ui8

    The comparison function if the filter is one of the _COMPARISON filters (default: D3D12_COMPARISON_FUNC_ALWAYS).

    BorderColor

    Type: float4

    The border color if the wrap mode is D3D12_TEXTURE_ADDRESS_MODE_BORDER. Black, White or Transparent (default: Black).

    MaxAnisotropy

    Type: ui8

    The maximum anisotropic filter level, if the filter is D3D12_FILTER_ANISOTROPIC. This must be 1, 2, 4, 8 or 16 (default: 16).

    MipLODBias

    Type: float

    The LOD level offset (default: 0.0f).

    MinLOD

    Type: float

    The minimum LOD level for textures (default: -FLT_MAX).

    MaxLOD

    Type: float

    The maximum LOD level for textures (default: FLT_MAX).

    Blend State

    The following data is used to build a D3D12_BLEND_DESC and will be applied for the ambient, diffuse and emissive render target.

    SrcBlend

    Type: ui8 (D3D12_BLEND)

    The source blend source of the color channel (default: D3D12_BLEND_SRC_ALPHA).

    DestBlend

    Type: ui8 (D3D12_BLEND)

    The destination blend source of the color channel (default: D3D12_BLEND_INV_SRC_ALPHA).

    BlendOp

    Type: ui8 (D3D12_BLEND_OP)

    The blend operation of the color channel (default: D3D12_BLEND_OP_ADD).

    SrcBlendAlpha

    Type: ui8 (D3D12_BLEND)

    The source blend source of the alpha channel (default: D3D12_BLEND_ZERO).

    DestBlendAlpha

    Type: ui8 (D3D12_BLEND)

    The destination blend source of the alpha channel (default: D3D12_BLEND_ZERO).

    BlendOpAlpha

    Type: ui8 (D3D12_BLEND_OP)

    The blend operation for the alpha channel (default: D3D12_BLEND_OP_ADD).

    LogicOp

    Type: ui8 (D3D12_LOGIC_OP)

    The logic operation (default: D3D12_LOGIC_OP_NOOP).

    AlphaToCoverage

    Type: ui8

    1 to enable alpha to coverage, 0 to disable it (default: false).

    Lights

    NumLights

    Type: ui16

    The number of lights.

    Light

    Type: SHAPE_LIGHT

    Count: NumLights

    The list of lights. Lights are attached to the root node.

    SHAPE_LIGHT Structure
    Copy Code
    struct SHAPE_LIGHT
    {
        string Name;
        string ProjectionMap;
        ui8    Type;
        float3 Position;
        float3 Color;
        float2 Direction;
        float  LineRotation;
        float  Radius;
        float  Watt;
        float  LuxPerWatt;
        float  ColorTemperature;
        float2 Extends;
        float2 Cone;
        float  CircleRadius;
        float  InnerDistance;
        ui16   FlensFlareIndex;
    };

    Name

    Type: string

    The name of the light.

    ProjectionMap (Reserved)

    Type: string

    The map file of the projection light.

    Type

    Type: ui8

    The light type:

    Value Type Description
    0 SHAPE_LIGHT_TYPE_POINT A simple point light with no direction.
    1 SHAPE_LIGHT_TYPE_DIFFUSE Not used, but stored. A diffuse light with no source but direction.
    2 SHAPE_LIGHT_TYPE_SPOT A spot light.
    3 SHAPE_LIGHT_TYPE_LINE A line from position towards direction and with spot direction.
    4 SHAPE_LIGHT_TYPE_CIRCLE A cylindric surface like a spot light. 
    5 SHAPE_LIGHT_TYPE_AREA A quadratic surface like a spot light.

     

    Position

    Type: float3

    The position in object space (root node).

    Color

    Type: float3

    The color of the light (RGB).

    Direction

    Type: float2

    The direction in radian (yaw, pitch).

    LineRotation

    Type: float

    The rotation of a line in radian (roll).

    Radius

    Type: float

    The radius of the light in m.

    Watt

    Type: float

    The power of the light source in W.

    LuxPerWatt

    Type: float

    How much lux is per Watt emitted.

    ColorTemperature

    Type: float

    The temperature of the color. This must no match with the color.

    Extends

    Type: float2

    The extensions of the box or area light.

    Cone

    Type: float2

    The inner and outer cone of the light in radian.

    CircleRadius

    Type: float

    The radius of the circle light.

    InnerDistance

    Type: float

    The inner distance of the light / minimum emitted light distance.

    LensFlareIndex

    Type: ui16

    The index of the used lens flare. UINT16_MAX if not used.

    Lens Flares

    NumLensFlares

    Type: ui16

    The number of lens flares.

    LensFlare

    Type: SHAPE_LENS_FLARE

    Count: NumLensFlares

    The list of lens flares.

    SHAPE_LENS_FLARE Structure
    Copy Code
    struct SHAPE_LENS_FLARE
    {
        string Name;
        string TypeName;
        float4 BaseColor;
        float  Scale;
        float  MaxDistance;
    };

    Name

    Type: string

    The name of the lens flare.

    TypeName

    Type: string

    The type name of the lens flare. The lens flare model will be selected by this name.

    BaseColor

    Type: float4

    The base color. It will be multiplied with the pre-defined lens flare color from configuration.

    Scale

    Type: float

    The scale of the lens flare (1.0 = 100%).

    MaxDistance

    Type: float

    The maximum distance this lens flare is visible in m.

    Cameras

    NumCameras

    Type: ui8

    The number of cameras.

    Camera

    Type: SHAPE_CAMERA

    Count: NumCameras

    The list of cameras.

    SHAPE_CAMERA Structure
    Copy Code
    struct SHAPE_CAMERA
    {
        string Name;
        float3 Position;
        float3 Direction;
        float  DepthDistance;
        float  FOV;
    };

    Name

    Type: string

    The name of the camera.

    Position

    Type: float3

    The position of the camera in object space (root node).

    Direction

    Type: float3

    The direction of the camera in radian (yaw, pitch, roll).

    DepthDistance

    Type: float

    The maximum visible depth distance.

    FOV

    Type: float

    The field of view in radian.

    Anchors

    NumAnchors

    Type: ui8

    The number of anchors.

    Anchor

    Type: SHAPE_ANCHOR

    Count: NumAnchors

    The list of anchors.

    SHAPE_ANCHOR Structure
    Copy Code
    struct SHAPE_ANCHOR
    {
        string Name;
        float3 Position;
        float3 Direction;
    };

    Name

    Type: string

    The name of the anchor.

    Position

    Type: float3

    The position in object space (root node).

    Direction

    Type: float3

    The direction of the anchor (default: up).

    Sub Shapes

    This feature is reserved. The structure may change until the feature is implemented.

    NumSubShapes

    Type: ui8

    The number of sub shapes.

    SubShape

    Type: SHAPE_SUB_SHAPE

    Count: NumSubShapes

    SHAPE_SUB_SHAPE
    Copy Code
    struct SHAPE_SUB_SHAPE
    {
        string Name;
        string File;
        float3 Position;
        float3 Rotation;
        float3 Scale;
    };

    Name

    Type: string

    The name of the sub shape. May be empty.

    File

    Type: string

    The shape file name with file extension.

    Position

    Type: float3

    The position in object space (root node).

    Rotation

    Type: float3

    The rotation in radian (yaw, pitch, roll).

    Scale

    Type: float3

    The scale in units (1.0f = 100%).

    Scripts

    NumScripts

    Type: ui8

    The number of scripts.

    Script

    Type: SHAPE_SCRIPT

    Count: NumScripts

    SHAPE_SCRIPT Structure
    Copy Code
    struct SHAPE_SCRIPT
    {
        string         File;
        string         Commands;
        ui16           NumArguments;
        SHAPE_PROPERTY Arguments[NumArguments];
    };

    File

    Type: string

    The script file (SGScript).

    Commands

    Type: string

    The script commands.

    NumArguments

    Type: ui16

    The number of arguments.

    Arguments

    Type: Equal to SHAPE_PROPERTY

    Count: NumArguments

    The list of arguments.

    Sounds

    NumSounds

    Type: ui8

    The number of sounds.

    Sound

    Type: SHAPE_SOUND

    Count: NumSounds

    The list of sounds.

    SHAPE_SOUND Structure
    Copy Code
    struct SHAPE_SOUND
    {
        string                Name;
        string                Bank;
        string                Event;
        float3                Position;
        float3                Direction;
        float                 SphereRadius;
        bool                  AllowShapeChange;
        float2                ShapeChangeTimes;
        float                 ShapeChangeRadius;
        float                 ShapeChangeSpeed;
        ui16                  NumSoundProperties;
        MATERIAL_VALUE<float> SoundProperty;
    };

    Name

    Type: string

    The name of the sound.

    Bank

    Type: string

    The name of the bank or xml file.

    Event

    Type: string

    The name of the event to run.

    Position

    Type: float3

    The position in object space (root node).

    Direction

    Type: float3

    The direction in radian (yaw, pitch and roll).

    SphereRadius

    Type: float

    The radius of the sound, if used.

    AllowShapeChange

    Type: bool

    True if the sound is allowed to move to other shapes.

    ShapeChangeTimes

    Type: float2

    The min-max time a sound switches to another shape in seconds.

    ShapeChangeRadius

    Type: float

    The maximum distance a sound looks for another compatible shape.

    ShapeChangeSpeed

    Type: float

    The speed the sound moves to another shape.

    NumSoundProperties

    Type: ui8

    The number of sound properties.

    SoundProperty

    Type: Equal to MATERIAL_VALUE<float>

    Count: NumSoundProperties

    The list of sound properties.

    Geometry

    NumGeometries

    Type: ui16

    The number of geometries.

    Geometry

    Type: SHAPE_GEOMETRY

    Count: NumGeometries

    The list of shape geometries.

    SHAPE_GEOMETRY Structure
    Copy Code
    struct SHAPE_GEOMETRY
    {
        ui32 Topology;          // = D3D_PRIMITIVE_TOPOLOGY
        ui16 MaterialIndex;
    
        bool HasNormals;
        bool HasUVChannel0;
        bool HasUVChannel1;
        ui8  NumBones;
    
        ui8  PositionFormat;    // = DXGI_FORMAT
        ui32 NumPositions;
        ui8  PositionData[];
    
        if(HasNormals == true)
        {
            ui8  NormalFormat;  // = DXGI_FORMAT
            ui32 NumNormals;    // == NumPositions
            ui8  NormalData[];
        }
    
        if(HasUVChannel0 == true)
        {
            ui8  UV0Format;      // = DXGI_FORMAT
            ui32 NumUVCoords0;   // == NumPositions
            ui8  UVCoord0Data[];
        }
    
        if(HasUVChannel1 == true)
        {
            ui8  UV1Format;      // = DXGI_FORMAT
            ui32 NumUVCoords1;   // == NumPositions
            ui8  UVCoord1Data[];
        }
    
        ui8 IndicesFormat;       // = DXGI_FORMAT
        ui32 NumIndices;
        ui8 IndicesData[];
    
        for each Bone
        {
            string   BoneName;
            float4x4 OffsetMatrix;
            ui32     NumWeights;          // == NumPositions
            float    Weights[NumWeights];
        }
    };

    Topology

    Type: ui32 (D3D_PRIMITIVE_TOPOLOGY)

    The primitive topology.

    MaterialIndex

    Type: ui16

    The material index.

    HasNormals

    Type: bool

    True if the geometry has normals. If it has also a uv channel, tangents will be computed on load.

    HasUVCoord0

    Type: bool

    True if the geometry has a first uv channel.

    HasUVCoord1

    Type: bool

    True if the geometry has a second uv channel.

    NumBones

    Type: ui8

    The number of bones. Maximum of 4 channels are supported.

    PositionFormat

    Type: ui8 (DXGI_FORMAT)

    The format of the positions. DXGI_FORMAT_R32G32B32_FLOAT is currently supported.

    NumPositions

    Type: ui32

    The number of positions (which is the count of vertices).

    PositionData

    Type: ui8

    Count: verty::helper::GetBytesOfFormat(PositionFormat) * NumPositions

    The position data.

    NormalFormat

    Type: ui8 (DXGI_FORMAT)

    The format of the normals. DXGI_FORMAT_R32G32B32_FLOAT is currently supported.

    NumNormals

    Type: ui32

    The number of normals. Must be equal to NumPositions.

    NormalData

    Type: ui8

    Count: verty::helper::GetBytesOfFormat(NormalFormat) * NumPositions

    The normal data.

    UV0Format

    Type: ui8 (DXGI_FORMAT)

    The format of the first uv channel. DXGI_FORMAT_R32G32_FLOAT is currently supported.

    NumUVCoords0

    Type: ui32

    The number of uv coordinates of the first channel. Must be equal to NumPositions.

    UVCoords0Data

    Type: ui8

    Count: verty::helper::GetBytesOfFormat(UV0Format) * NumPositions

    The data of the first UV channel.

    UV1Format

    Type: ui8 (DXGI_FORMAT)

    The format of the second uv channel. DXGI_FORMAT_R32G32_FLOAT is currently supported.

    NumUVCoords1

    Type: ui32

    The number of uv coordinates of the second channel. Must be equal to NumPositions.

    UVCoord1Data

    Type: ui8

    Count: verty::helper::GetBytesOfFormat(UV1Format) * NumPositions

    The data of the second UV channel.

    IndicesFormat

    Type: ui8 (DXGI_FORMAT)

    The format of the index buffer. DXGI_FORMAT_R32_UINT is currently supported. DXGI_FORMAT_UNKNOWN if not used.

    NumIndices

    Type: ui32

    The number of indices. Zero if not used.

    IndicesData

    Type: ui8

    Count: verty::helper::GetBytesOfFormat(IndicesFormat) * NumIndices

    The index data.

    BoneName

    Type: string

    The name of the bone.

    OffsetMatrix

    Type: float4x4

    The offset matrix for the bone.

    NumWeights

    Type: ui32

    The number of weights. Must be equal to NumPositions.

    Weights

    Type: float

    The vertex weights for this bone.

    Node structure

    RootNode

    Type: SHAPE_NODE

    The root node of the shape hierarchy.

    SHAPE_NODE Structure
    Copy Code
    struct SHAPE_NODE
    {
        string       Name;
        float4x4     Transformation;
        ui32         LODLevel;
        float2       Distance;
        bool         HasOpacity;
        bool         NoShadow;
        bool         IsHidden;
        bool         RenderBeforeChildren;
        float3       NullPosition;
        SHAPE_VOLUME Volume;
    
        ui8          NumGeometries;
        ui8          NumChildren;
    
        ui16         GeometryIndex[NumGeometries];
        SHAPE_VOLUME GeometryVolume[NumGeometries];
        SHAPE_NODE   Children[NumChildren];
    };

    Name

    Type: string

    The name of this node.

    Transformation

    Type: float4x4

    The node transformation.

    LODLevel

    Type: ui32

    The LOD level of this node.

    Distance

    Type: float2

    The minimum and maximum distance for this node.

    HasOpacity

    Type: bool

    True if this node has opacity material.

    NoShadow

    Type: bool

    True if this node should not cast shadows.

    IsHidden

    Type: bool

    True if this node geometry is hidden.

    RenderBeforeChildren

    Type: bool

    True to render the geometry before the children geometry is rendered.

    NullPosition

    Type: float3

    The center position of the node.

    NodeVolume

    Type: SHAPE_VOLUME

    The bounding volume of this node.

    NumGeometries

    Type: ui8

    The number of geometries.

    NumChildren

    Type: ui8

    The number of children.

    GeometryIndex

    Type: ui16

    Count: NumGeometries

    The index of the geometry to use.

    GeometryVolume

    Type: SHAPE_VOLUME

    Count: NumGeometries

    The bounding volumes of each geometry.

    Children

    Type: SHAPE_NODE

    Count: NumChildren

    The child nodes.

    SHAPE_VOLUME Structure
    Copy Code
    struct SHAPE_VOLUME
    {
        float3 AABB_MinExtends;
        float3 AABB_MaxExtends;
        float4 Sphere;
    };

    AABB_MinExtends

    Type: float3

    The minimum extensions of the axis-aligned bounding box.

    AABB_MaxExtends

    Type: float3

    The maximum extensions of the axis-aligned bounding box.

    Sphere

    Type: float4

    The center of the sphere (xyz) and the radius (w) in m.

    Animations

    Each animation is called to be an animation layer.

    NumAnimations

    Type: ui8

    The number of animations.

    Animation

    Type: SHAPE_ANIMATION_LAYER

    Count: NumAnimations

    A list of all animation layers.

    SHAPE_ANIMATION_LAYER Structure
    Copy Code
    struct SHAPE_ANIMATION_LAYER
    {
        string                LayerName;
        ui8                   Processing;
        double                Duration;
        double                KeyFrameTime;
        ui16                  NumTracks;
        SHAPE_ANIMATION_TRACK Track[NumTracks];
    };

    LayerName

    Type: string

    The name of the animation layer.

    Processing

    Type: ui8

    The type of the how animation is processed:

    Value Type Description
    0 SHAPE_ANIMATION_PROCESSING_NONE The current key of the animation has to been set manually.
    1 SHAPE_ANIMATION_PROCESSING_PLAYBACK The animation plays from the current key to the target key.
    2 SHAPE_ANIMATION_PROCESSING_REPEAT If the animation is started into a direction, it will be repeated into this direction.
    3 SHAPE_ANIMATION_PROCESSING_STATE If the animation is started into a direction, it plays until the first or last key.

     

    Duration

    Type: double

    The animation duration in milliseconds.

    KeyFrameTime

    Type: double

    The frame time of one key in milliseconds.

    NumTracks

    Type: ui16

    The number of animation tracks.

    Track

    Type: SHAPE_ANIMATION_TRACK

    Count: NumTracks

    The list of animation layer tracks.

    SHAPE_ANIMATION_TRACK Structure
    Copy Code
    struct SHAPE_ANIMATION_TRACK
    {
        string                 NodeName;
        ui16                   NumPositionKeys;
        ui16                   NumScaleKeys;
        ui16                   NumRotationKeys;
        ui16                   NumEventKeys;
    
        SHAPE_ANIM_KEY<float3> PositionKey[NumPositionKeys];
        SHAPE_ANIM_KEY<float3> ScaleKey[NumScaleKeys];
        SHAPE_ANIM_KEY<float4> RotationKey[NumRotationKeys];
        SHAPE_ANIM_KEY<string> EventKey[NumEventKeys];
    };

    NodeName

    Type: string

    Name of the node this animation track affects.

    NumPositionKeys

    Type: ui16

    The number of position keys.

    NumScaleKeys

    Type: ui16

    The number of scale keys.

    NumRotationKeys

    Type: ui16

    The number of rotation keys.

    NumEventKeys

    Type: ui16

    The number of event keys.

    PositionKey

    Type: SHAPE_ANIM_KEY<float3>

    Count: NumPositionKeys

    The position keys. The keys are in order of the playback.

    ScaleKey

    Type: SHAPE_ANIM_KEY<float3>

    Count: NumScaleKeys

    The scaling keys. The keys are in order of the playback.

    RotationKey

    Type: SHAPE_ANIM_KEY<float4>

    Count: NumRotationKeys

    The rotation keys as quarternion. Th keys are in order of the playback.

    EventKey

    Type: SHAPE_ANIM_KEY<string>

    Count: NumEventKeys

    The event keys who triggers events to the script. The keys are in order of the playback.

    SHAPE_ANIM_KEY<T>
    Copy Code
    template<typename T> struct SHAPE_ANIM_KEY
    {
        double Key;
        T      Value;
    };

    Key

    Type: double

    The animation key.

    Value

    Type: T

    The value.