Game.Rendering.AnimationInfoData
Assembly:
Game (assembly containing rendering/game types; may appear in Assembly-CSharp.dll in Unity builds)
Namespace:
Game.Rendering
Type:
struct
Base:
System.ValueType
Summary:
AnimationInfoData is a plain data container used by the rendering/animation subsystem to describe a single animation (or an animation block) for a mesh/entity. It holds indices/offsets into various animation-related buffers (hierarchy, shapes, bones, inverse bind matrices), counts for shapes and bones, a type/flags field, and a small AABB (min + range) used for culling or spatial tests. The struct is intended for fast, blittable transfer to native code or GPU buffers, so pay attention to layout and shader-side packing when sending instances to compute buffers or structured buffers.
Fields
-
public int m_Offset
Offset (typically an index or byte offset) into a packed animation data buffer. Used to locate per-animation data within larger arrays or streams. -
public int m_Hierarchy
Index or offset to hierarchy data (parent/child skeleton/hierarchy indices) for this animation. Points to a separate hierarchy buffer/array. -
public int m_Shapes
Index/offset into blend shape (morph target) data for this animation. Used when applying shape/blend animations. -
public int m_Bones
Index/offset into bone transform data for this animation (e.g., start index in a global bone transform buffer). -
public int m_InverseBones
Index/offset into inverse bind-pose matrices for bones (used for skinning: bone->mesh bind correction). -
public int m_ShapeCount
Number of blend shapes (morph targets) associated with this animation entry. -
public int m_BoneCount
Number of bones used by this animation entry. -
public int m_Type
Animation type or flags. Semantics depend on the rendering/animation system (e.g., distinguishes CPU/GPU skinning, LOD group, or animation format). Inspect game code where this field is read to determine exact meaning. -
public float3 m_PositionMin
Minimum corner of a local-space axis-aligned bounding box for the animated geometry (float3 from Unity.Mathematics). Used for culling or bounding queries. -
public float3 m_PositionRange
Size (extent) of the bounding box along each axis; with m_PositionMin this forms min/max = min + range. Used for culling and overlap tests.
Notes on memory layout and packing: - The struct is blittable (ints and float3). Rough size: 8 ints * 4 = 32 bytes, plus 2 * float3 (12 bytes each) = 24 bytes, total ≈ 56 bytes. When sending to GPU or interoperating with HLSL, be careful: shader packing rules may align float3 to 16 bytes in constant buffers. For structured/byte-address buffers the layout may be tight; ensure shader-side struct matches the exact packing/order or add explicit padding fields.
Properties
- None. This is a plain public-field struct; no C# properties are defined.
Constructors
- Default parameterless constructor (implicit)
The struct relies on the default value initialization. If you need initialized/default values, create and set fields explicitly.
Methods
- None. No methods are defined on this struct.
Usage Example
using Unity.Mathematics;
using UnityEngine;
// Create and populate an animation info entry
var animInfo = new Game.Rendering.AnimationInfoData
{
m_Offset = 1024, // offset/index into packed animation buffer
m_Hierarchy = 5, // index of hierarchy
m_Shapes = 256, // index of shapes
m_Bones = 512, // index of bone transforms
m_InverseBones = 768, // index of inverse bind matrices
m_ShapeCount = 4,
m_BoneCount = 24,
m_Type = 1, // application-specific type/flags
m_PositionMin = new float3(-1f, 0f, -1f),
m_PositionRange = new float3(2f, 2f, 2f)
};
// Example: upload to a ComputeBuffer (ensure shader struct layout matches)
int stride = System.Runtime.InteropServices.Marshal.SizeOf<Game.Rendering.AnimationInfoData>();
var buffer = new ComputeBuffer(1, stride, ComputeBufferType.Default);
buffer.SetData(new[] { animInfo });
// Remember: verify shader-side packing (float3 vs float4) and add padding if needed.