tiny.rig.Skeleton
Defined in tiny.rig.
API (7)
Actions
Public operations.
countforward: World transforms from local ones.initisAncestorOrSelf: Whetherancestorisjointor lies on its path to the root.restWorld: World transforms of the rest pose.
Fields and members
Public fields and members.
Source
Source: fun/rig/src/skeleton.zig:29
zig
pub const Skeleton = struct { /// Each joint's parent, or `none` for a root. parents: []const Joint, /// Each joint's rest transform relative to its parent. rest: []const Transform, pub fn init(parents: []const Joint, rest: []const Transform) Error!Skeleton { if (parents.len != rest.len) return error.InvalidLength; if (parents.len > max_joints) return error.InvalidLength; for (parents, 0..) |parent, index| { if (parent != none and parent >= index) return error.InvalidParent; } return .{ .parents = parents, .rest = rest }; } pub fn count(skeleton: Skeleton) usize { return skeleton.parents.len; } /// World transforms from local ones. `world` may not alias `local`. pub fn forward(skeleton: Skeleton, local: []const Transform, world: []Transform) void { forwardParents(skeleton.parents, local, world); } /// World transforms of the rest pose. pub fn restWorld(skeleton: Skeleton, world: []Transform) void { forwardParents(skeleton.parents, skeleton.rest, world); } /// Whether `ancestor` is `joint` or lies on its path to the root. pub fn isAncestorOrSelf(skeleton: Skeleton, ancestor: Joint, joint: Joint) bool { return ancestorOrSelf(skeleton.parents, ancestor, joint); }};Source: fun/rig/src/root.zig:33
zig
pub const Skeleton = skeleton.Skeleton;Audit
| Definitions | 6 |
|---|---|
| Public names | 6 |
| Members | 2 |
| Version | 26.7.0 |
| Revision | daab053ee433 |