Table of Contents

Class PoseData

Namespace
WitShells.WitPose

Data structure for storing and managing human poses. Uses Unity's HumanPose muscle space for rig-agnostic storage.

[Serializable]
public class PoseData
Inheritance
PoseData
Inherited Members

Constructors

PoseData()

Create empty pose data

public PoseData()

PoseData(HumanPose, string)

Create a new pose data from HumanPose

public PoseData(HumanPose humanPose, string name = "New Pose")

Parameters

humanPose HumanPose
name string

Fields

author

public string author

Field Value

string

category

public string category

Field Value

string

description

public string description

Field Value

string

poseName

public string poseName

Field Value

string

thumbnail

public Texture2D thumbnail

Field Value

Texture2D

thumbnailPath

public string thumbnailPath

Field Value

string

timestamp

public long timestamp

Field Value

long

version

public string version

Field Value

string

Properties

BodyPosition

Properties for accessing pose data

public Vector3 BodyPosition { get; }

Property Value

Vector3

BodyRotation

public Quaternion BodyRotation { get; }

Property Value

Quaternion

Muscles

public float[] Muscles { get; }

Property Value

float[]

Methods

BlendWith(PoseData, float)

Blend this pose with another pose

public PoseData BlendWith(PoseData otherPose, float t)

Parameters

otherPose PoseData
t float

Returns

PoseData

ClampMuscleValues()

Clamp all muscle values to valid range

public void ClampMuscleValues()

Clone()

Create a copy of this pose data

public PoseData Clone()

Returns

PoseData

CreateMirrored()

Mirror this pose (left-right flip)

public PoseData CreateMirrored()

Returns

PoseData

FromJson(string)

Create pose from JSON string

public static PoseData FromJson(string json)

Parameters

json string

Returns

PoseData

IsValid()

Validate pose data integrity

public bool IsValid()

Returns

bool

ToHumanPose()

Convert this pose data to HumanPose

public HumanPose ToHumanPose()

Returns

HumanPose

ToHumanPoseMusclesOnly(ref HumanPose)

Converts to HumanPose but keeps the target's current world position and rotation. Useful to prevent the avatar from teleporting when applying a pose.

public HumanPose ToHumanPoseMusclesOnly(ref HumanPose currentTargetPose)

Parameters

currentTargetPose HumanPose

Returns

HumanPose

ToJson(bool)

Get pose as JSON string

public string ToJson(bool prettyPrint = false)

Parameters

prettyPrint bool

Returns

string

UpdateFromHumanPose(HumanPose)

Update pose data from HumanPose

public void UpdateFromHumanPose(HumanPose humanPose)

Parameters

humanPose HumanPose

ValidateMuscleArraySize()

public void ValidateMuscleArraySize()