Skip to content

Game.Rendering.BlendWeight

Assembly:
Assembly-CSharp (typical game assembly)

Namespace: Game.Rendering

Type:
public struct

Base:
System.ValueType

Summary:
Simple plain-old-data struct representing a single blend weight used for vertex skinning/blending. It pairs an integer index (typically a bone or blend-channel index) with a floating-point weight that expresses that bone/channel's influence on a vertex. Used when building arrays of blend weights for mesh skinning, morph targets or other multi-channel blending systems.


Fields

  • public int m_Index
    Index of the bone or blend channel this weight refers to. Typically a non‑negative integer identifying a bone/slot; a sentinel value (e.g. -1) may be used to indicate an unused entry depending on the consuming code.

  • public float m_Weight
    Influence value for the given index. Commonly normalized in the range 0.0 to 1.0 (sum of weights for a vertex may be expected to equal 1.0 by downstream systems), but exact semantics depend on the consumer.

Properties

  • This struct does not declare any C# properties. It exposes two public fields for direct access.

Constructors

  • public BlendWeight()
    The implicit default constructor (provided by the runtime) initializes m_Index to 0 and m_Weight to 0.0f. You can initialize instances using object initializers, e.g. new BlendWeight { m_Index = 1, m_Weight = 0.5f }.

Methods

  • This struct declares no methods.

Usage Example

// Create a single blend weight
var bw = new Game.Rendering.BlendWeight { m_Index = 2, m_Weight = 0.75f };

// Create an array of blend weights for a vertex (e.g., up to 4 influences)
var weights = new Game.Rendering.BlendWeight[4];
weights[0] = new Game.Rendering.BlendWeight { m_Index = 0, m_Weight = 0.5f };
weights[1] = new Game.Rendering.BlendWeight { m_Index = 3, m_Weight = 0.3f };
weights[2] = new Game.Rendering.BlendWeight { m_Index = 7, m_Weight = 0.2f };
weights[3] = new Game.Rendering.BlendWeight { m_Index = -1, m_Weight = 0f }; // unused slot

// Pass these weights to whatever mesh/skinning API the game/mod expects.
// (Exact consumer API will vary in Cities: Skylines 2 modding context.)