Game.Rendering.BoneElement
Assembly: Assembly-CSharp.dll
Namespace: Game.Rendering
Type: public struct
Base: System.ValueType
Summary:
Represents a single bone transform used by the rendering/skeletal system. Contains a Unity.Mathematics.float4x4 matrix (column-major) that encodes the bone's transform (typically a TRS matrix). This struct is a simple, blittable container intended for fast copying to native memory or GPU buffers for skinning and animation.
Fields
public Unity.Mathematics.float4x4 m_Matrix
Stores the 4x4 transformation matrix for the bone. In Unity.Mathematics this is column-major; the translation component is typically in the fourth column (m_Matrix.c3.xyz). The matrix is commonly used for skinning (transforming vertices by bone matrices) or for passing bone transforms to GPU/compute shaders. A float4x4 contains 16 floats (64 bytes), so it is blittable and suitable for direct memory/structured buffer uploads.
Properties
- (none)
This struct exposes its data via the public field m_Matrix; there are no properties.
Constructors
public BoneElement()
Default value-type constructor (zero-initializes the matrix). You can also initialize the struct with an object initializer.
Methods
- (none)
This struct contains only data; any operations (TRS creation, multiplication) should be done with Unity.Mathematics functions (math.mul, float4x4.TRS, etc.) outside the struct.
Usage Example
using Unity.Mathematics;
using Game.Rendering;
// create a bone with identity transform
BoneElement bone = new BoneElement { m_Matrix = float4x4.identity };
// create a TRS matrix and assign (if your math lib provides TRS)
float3 position = new float3(0f, 1f, 0f);
quaternion rotation = quaternion.EulerXYZ(new float3(0f, math.radians(45f), 0f));
float3 scale = new float3(1f, 1f, 1f);
// If float4x4.TRS is available in your math package:
bone.m_Matrix = float4x4.TRS(position, rotation, scale);
// When uploading many BoneElement instances to GPU, you can memcpy the array
// directly into a ComputeBuffer or structured buffer because the struct is blittable.
{{ Add any project-specific notes here: e.g., whether bone matrices are in local or model space, expected matrix convention for the renderer, and any alignment/packing requirements for GPU buffers. }}