tiny.rig.articulated
Defined in tiny.rig.
An articulated rig: handles joined by revolute and prismatic coordinates, with a point Jacobian and collision proxies on top.
API (25)
Actions
Public operations.
Types and contracts
Public types and contracts.
Values and defaults
Public values and defaults.
ArticulatedRig.addHandleArticulatedRig.addProxyArticulatedRig.clampCoordinateValueArticulatedRig.coordinateCountArticulatedRig.coordinateValueArticulatedRig.getCoordinateArticulatedRig.handleByIndexArticulatedRig.pointJacobianArticulatedRig.proxyBindingArticulatedRig.proxyCountArticulatedRig.proxyWorldTransformArticulatedRig.refreshArticulatedRig.setCoordinateArticulatedRig.worldPointArticulatedRig.worldTransformmax_handle_coordinates
Source
Source: fun/rig/src/articulated/handle.zig:15
zig
pub const CoordinateKind = enum(u8) { revolute = 0, prismatic = 1,};Source: fun/rig/src/articulated/handle.zig:32
zig
pub const Handle = struct { name_buf: [64]u8 = @as([64]u8, @splat(0)), name_len: u8 = 0, parent: ?u32 = null, rest_translation: Vec3 = .{}, rest_rotation: Quat = .{}, coordinate_offset: u32 = 0, coordinate_count: u8 = 0, coordinate_kinds: [max_handle_coordinates]CoordinateKind = @as([max_handle_coordinates]CoordinateKind, @splat(.revolute)), coordinate_axes: [max_handle_coordinates]Vec3 = @as([max_handle_coordinates]Vec3, @splat(Vec3.zero)), coordinate_mins: [max_handle_coordinates]f32 = @as([max_handle_coordinates]f32, @splat(0.0)), coordinate_maxs: [max_handle_coordinates]f32 = @as([max_handle_coordinates]f32, @splat(0.0)),};Source: fun/rig/src/articulated/handle.zig:20
zig
pub const HandleSpec = struct { name: []const u8 = "", parent: ?u32 = null, rest_translation: Vec3 = .{}, rest_rotation: Quat = .{}, coordinate_kinds: []const CoordinateKind = &.{}, coordinate_axes: []const Vec3 = &.{}, coordinate_mins: []const f32 = &.{}, coordinate_maxs: []const f32 = &.{}, initial_coordinates: []const f32 = &.{},};Source: fun/rig/src/articulated/proxy.zig:12
zig
pub const MotionType = enum(u8) { dynamic = 0, kinematic = 1, static_ = 2,};Source: fun/rig/src/articulated/proxy.zig:25
zig
pub const ProxyBinding = struct { handle_index: u32, local_translation: Vec3 = .{}, local_rotation: Quat = .{}, shape: ProxyShape = .point, mass: f32 = 1.0, friction: f32 = 0.0, restitution: f32 = 0.0, motion_type: MotionType = .kinematic,};Source: fun/rig/src/articulated/proxy.zig:18
zig
pub const ProxyShape = union(enum(u8)) { point: void, sphere: struct { radius: f32 }, box: struct { half_extents: [3]f32 }, capsule: struct { half_height: f32, radius: f32 },};Source: fun/rig/src/articulated/handle.zig:13
zig
pub const max_handle_coordinates: usize = 3;Source: fun/rig/src/articulated/root.zig
zig
//! An articulated rig: handles joined by revolute and prismatic//! coordinates, with a point Jacobian and collision proxies on top.//!//! Each handle's coordinates turn its rest transform into a local//! transform, rest first and then each coordinate's motion in order. The//! skeleton's forward kinematics composes the local transforms down the//! hierarchy; there is no second composition of the chain. Storage grows//! only when a handle or proxy is added, so posing and querying never//! allocate.const std = @import("std");const linear = @import("linear");const skeleton = @import("../skeleton.zig");const transform = @import("../transform.zig");const handle = @import("handle.zig");const jacobian = @import("jacobian.zig");const pose = @import("pose.zig");const proxy = @import("proxy.zig");const Allocator = std.mem.Allocator;const Joint = skeleton.Joint;const Transform = transform.Transform;const Vec3 = linear.Vec3;pub const CoordinateKind = handle.CoordinateKind;pub const HandleSpec = handle.HandleSpec;pub const Handle = handle.Handle;pub const max_handle_coordinates = handle.max_handle_coordinates;pub const MotionType = proxy.MotionType;pub const ProxyBinding = proxy.ProxyBinding;pub const ProxyShape = proxy.ProxyShape;pub const ArticulatedRig = struct { handles: std.ArrayListUnmanaged(Handle) = .empty, /// Each handle's parent, in the skeleton's form. parents: std.ArrayListUnmanaged(Joint) = .empty, coordinates: std.ArrayListUnmanaged(f32) = .empty, coordinate_to_handle: std.ArrayListUnmanaged(u32) = .empty, local_transforms: std.ArrayListUnmanaged(Transform) = .empty, world_transforms: std.ArrayListUnmanaged(Transform) = .empty, /// Each coordinate's axis and origin in world space, in the frame its /// motion applies in. coordinate_world_axes: std.ArrayListUnmanaged(Vec3) = .empty, coordinate_world_origins: std.ArrayListUnmanaged(Vec3) = .empty, proxies: std.ArrayListUnmanaged(ProxyBinding) = .empty, pose_dirty: bool = true, pub fn init() ArticulatedRig { return .{}; } pub fn deinit(rig: *ArticulatedRig, allocator: Allocator) void { rig.handles.deinit(allocator); rig.parents.deinit(allocator); rig.coordinates.deinit(allocator); rig.coordinate_to_handle.deinit(allocator); rig.local_transforms.deinit(allocator); rig.world_transforms.deinit(allocator); rig.coordinate_world_axes.deinit(allocator); rig.coordinate_world_origins.deinit(allocator); rig.proxies.deinit(allocator); rig.* = .{}; } pub const addHandle = handle.add; pub const coordinateCount = handle.coordinateCount; pub const setCoordinate = handle.setCoordinate; pub const getCoordinate = handle.getCoordinate; pub const clampCoordinateValue = handle.clampCoordinateValue; pub const handleByIndex = handle.byIndex; pub const coordinateValue = handle.coordinateValue; pub const refresh = pose.refresh; pub const worldTransform = pose.worldTransform; pub const worldPoint = pose.worldPoint; pub const pointJacobian = jacobian.point; pub const addProxy = proxy.add; pub const proxyCount = proxy.count; pub const proxyBinding = proxy.binding; pub const proxyWorldTransform = proxy.worldTransform;};Source: fun/rig/src/root.zig:21
zig
pub const articulated = @import("articulated/root.zig");Complete caller list for articulated.ArticulatedRig.deinit
9 direct callers.
fun.rig.src.articulated.handle.test_a_failed_handle_leaves_the_rig_unchanged[function] — test; no exact target atfun/rig/src/articulated/handle.zig:157in nearest public ownerfun.rig.src.articulated.handlefun.rig.src.articulated.handle.test_handle_coordinate_limits_clamp_initial_and_assigned_values[function] — test; no exact target atfun/rig/src/articulated/handle.zig:140in nearest public ownerfun.rig.src.articulated.handlefun.rig.src.articulated.test.test_rig_proxy_transform_follows_the_owning_handle[function] — test; no exact target atfun/rig/src/articulated/test.zig:61in nearest public ownerfun.rig.src.articulated.testfun.rig.src.articulated.test.test_rig_world_point_jacobian_matches_finite_difference[function] — test; no exact target atfun/rig/src/articulated/test.zig:14in nearest public ownerfun.rig.src.articulated.testfun.sdfii.src.physics.articulation.test_articulated_servo_tracking_converges_toward_target[function] — test; no exact target atfun/sdfii/src/physics/articulation.zig:333in nearest public ownerfun.sdfii.src.physics.articulationfun.sdfii.src.physics.articulation.test_articulation_proxy_body_preserves_collider_metadata[function] — test; no exact target atfun/sdfii/src/physics/articulation.zig:265in nearest public ownerfun.sdfii.src.physics.articulationfun.sdfii.src.physics.articulation.test_contact_generalized_forces_project_plane_contact_onto_a_prismatic_axis[function] — test; no exact target atfun/sdfii/src/physics/articulation.zig:364in nearest public ownerfun.sdfii.src.physics.articulationfun.sdfii.src.physics.articulation.test_joint_descriptors_are_collected_from_rig_handles[function] — test; no exact target atfun/sdfii/src/physics/articulation.zig:299in nearest public ownerfun.sdfii.src.physics.articulationfun.sdfii.src.rig.test.test_rig_slot_bindings_mutate_a_differentiable_program_without_recompiling[function] — test; no exact target atfun/sdfii/src/rig/test.zig:16in nearest public ownerfun.sdfii.src.rig.test
Complete caller list for articulated.ArticulatedRig.init
9 direct callers.
fun.rig.src.articulated.handle.test_a_failed_handle_leaves_the_rig_unchanged[function] — test; no exact target atfun/rig/src/articulated/handle.zig:157in nearest public ownerfun.rig.src.articulated.handlefun.rig.src.articulated.handle.test_handle_coordinate_limits_clamp_initial_and_assigned_values[function] — test; no exact target atfun/rig/src/articulated/handle.zig:140in nearest public ownerfun.rig.src.articulated.handlefun.rig.src.articulated.test.test_rig_proxy_transform_follows_the_owning_handle[function] — test; no exact target atfun/rig/src/articulated/test.zig:61in nearest public ownerfun.rig.src.articulated.testfun.rig.src.articulated.test.test_rig_world_point_jacobian_matches_finite_difference[function] — test; no exact target atfun/rig/src/articulated/test.zig:14in nearest public ownerfun.rig.src.articulated.testfun.sdfii.src.physics.articulation.test_articulated_servo_tracking_converges_toward_target[function] — test; no exact target atfun/sdfii/src/physics/articulation.zig:333in nearest public ownerfun.sdfii.src.physics.articulationfun.sdfii.src.physics.articulation.test_articulation_proxy_body_preserves_collider_metadata[function] — test; no exact target atfun/sdfii/src/physics/articulation.zig:265in nearest public ownerfun.sdfii.src.physics.articulationfun.sdfii.src.physics.articulation.test_contact_generalized_forces_project_plane_contact_onto_a_prismatic_axis[function] — test; no exact target atfun/sdfii/src/physics/articulation.zig:364in nearest public ownerfun.sdfii.src.physics.articulationfun.sdfii.src.physics.articulation.test_joint_descriptors_are_collected_from_rig_handles[function] — test; no exact target atfun/sdfii/src/physics/articulation.zig:299in nearest public ownerfun.sdfii.src.physics.articulationfun.sdfii.src.rig.test.test_rig_slot_bindings_mutate_a_differentiable_program_without_recompiling[function] — test; no exact target atfun/sdfii/src/rig/test.zig:16in nearest public ownerfun.sdfii.src.rig.test
Audit
| Definitions | 26 |
|---|---|
| Public names | 26 |
| Members | 47 |
| Version | 26.7.0 |
| Revision | daab053ee433 |