[c] Codegen outputs ported comments

This commit is contained in:
Mario Zechner 2025-09-15 15:14:50 +02:00
parent 355f557153
commit 522101f569
101 changed files with 1853 additions and 19 deletions

View File

@ -1,4 +1,4 @@
import type { ClassOrStruct, Enum } from './types';
import type { ClassOrStruct, DocumentationComment, Enum } from './types';
export interface CParameter {
name: string; // Parameter name in C
@ -14,6 +14,7 @@ export interface CMethod {
parameters: CParameter[];
body: string; // The actual implementation code (e.g., "return ((Bone*)self)->getX();")
returnTypeNullable: boolean; // true if return type can be null (pointer types)
documentation?: DocumentationComment; // Documentation from C++ source
}
export interface CClassOrStruct {

View File

@ -151,6 +151,13 @@ export class CWriter {
private writeMethodDeclaration(method: CMethod): string {
const params = this.formatParameters(method.parameters);
const returnTypeWithAnnotation = method.returnTypeNullable ? `/*@null*/ ${method.returnType}` : method.returnType;
// Generate documentation comment if available
const docComment = this.formatDocumentationComment(method);
if (docComment) {
return `${docComment}\nSPINE_C_API ${returnTypeWithAnnotation} ${method.name}(${params});`;
}
return `SPINE_C_API ${returnTypeWithAnnotation} ${method.name}(${params});`;
}
@ -177,6 +184,104 @@ export class CWriter {
.join(', ');
}
private formatDocumentationComment(method: CMethod): string | null {
if (!method.documentation) {
return null;
}
const doc = method.documentation;
const lines: string[] = [];
lines.push('/**');
// Add summary
if (doc.summary) {
this.wrapCommentText(doc.summary, lines);
}
// Add details if present
if (doc.details) {
if (doc.summary) {
lines.push(' *');
}
this.wrapCommentText(doc.details, lines);
}
// Add parameter documentation
if (doc.params && Object.keys(doc.params).length > 0) {
lines.push(' *');
for (const [paramName, paramDesc] of Object.entries(doc.params)) {
// Skip 'self' parameter documentation as it's implicit in C API
if (paramName === 'self' || paramName === 'this') continue;
lines.push(` * @param ${paramName} ${paramDesc}`);
}
}
// Add return documentation
if (doc.returns) {
lines.push(' *');
lines.push(` * @return ${doc.returns}`);
}
// Add deprecation notice
if (doc.deprecated) {
lines.push(' *');
lines.push(` * @deprecated ${doc.deprecated}`);
}
// Add since version
if (doc.since) {
lines.push(' *');
lines.push(` * @since ${doc.since}`);
}
// Add see also references
if (doc.see && doc.see.length > 0) {
lines.push(' *');
for (const ref of doc.see) {
lines.push(` * @see ${ref}`);
}
}
lines.push(' */');
return lines.join('\n');
}
private wrapCommentText(text: string, lines: string[]): void {
const maxLineLength = 80;
const prefix = ' * ';
const maxTextLength = maxLineLength - prefix.length;
// Split text into paragraphs
const paragraphs = text.split('\n\n');
for (let i = 0; i < paragraphs.length; i++) {
if (i > 0) {
lines.push(' *');
}
const paragraph = paragraphs[i].replace(/\n/g, ' ');
const words = paragraph.split(' ');
let currentLine = '';
for (const word of words) {
if (currentLine.length === 0) {
currentLine = word;
} else if (currentLine.length + word.length + 1 <= maxTextLength) {
currentLine += ' ' + word;
} else {
lines.push(prefix + currentLine);
currentLine = word;
}
}
if (currentLine.length > 0) {
lines.push(prefix + currentLine);
}
}
}
async writeType(typeName: string, headerContent: string, sourceContent?: string): Promise<void> {
const fileName = toSnakeCase(typeName);

View File

@ -104,7 +104,8 @@ export function generateConstructors(type: ClassOrStruct, knownTypeNames: Set<st
returnType: cTypeName,
parameters: [],
body: `return (${cTypeName}) new (__FILE__, __LINE__) ${cppTypeName}();`,
returnTypeNullable: false // Constructors never return null on success
returnTypeNullable: false, // Constructors never return null on success
documentation: ctor.documentation
});
} else {
// Parameterized constructor
@ -119,7 +120,8 @@ export function generateConstructors(type: ClassOrStruct, knownTypeNames: Set<st
returnType: cTypeName,
parameters: cParams,
body: `return (${cTypeName}) new (__FILE__, __LINE__) ${cppTypeName}(${cppArgs});`,
returnTypeNullable: false // Constructors never return null on success
returnTypeNullable: false, // Constructors never return null on success
documentation: ctor.documentation
});
}
i++;
@ -696,7 +698,8 @@ function generateMethod(type: ClassOrStruct, method: Method, cTypeName: string,
returnType: cReturnType,
parameters: cParams,
body,
returnTypeNullable: isNullable(method.returnType)
returnTypeNullable: isNullable(method.returnType),
documentation: method.documentation
};
} catch (e) {
console.warn(`Skipping method ${type.name}::${method.name}: ${e}`);
@ -840,7 +843,8 @@ function generateArrayMethod(cTypeName: string, method: Method, cppElementType:
returnType: cReturnType,
parameters: cParams,
body,
returnTypeNullable: isNullable(method.returnType)
returnTypeNullable: isNullable(method.returnType),
documentation: method.documentation
};
} catch (e) {
console.warn(`Skipping array method ${method.name}: ${e}`);

View File

@ -93,7 +93,7 @@ function analyzeNullableMethods(): void {
if (method.fromSupertype) continue;
// Skip excluded methods
if (isMethodExcluded(classType.name, method.name, exclusions, method)) {
if (isMethodExcluded(classType.name, method.name, exclusions, member.kind === 'method' ? method as Method : undefined)) {
continue;
}

View File

@ -2,7 +2,7 @@ import { execSync } from 'node:child_process';
import * as fs from 'node:fs';
import * as path from 'node:path';
import { fileURLToPath } from 'node:url';
import type { ClassOrStruct, Constructor, Destructor, Enum, EnumValue, Field, Member, Method, Parameter, Type } from './types';
import type { ClassOrStruct, Constructor, Destructor, DocumentationComment, Enum, EnumValue, Field, Member, Method, Parameter, Type } from './types';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const SPINE_CPP_PATH = path.join(__dirname, '../../../spine-cpp');
@ -114,6 +114,105 @@ function isInTargetFile(node: any, targetPath: string): boolean {
return true;
}
/**
* Extracts text from a paragraph comment node
*/
function extractTextFromParagraph(paragraphNode: any): string {
const texts: string[] = [];
for (const inner of paragraphNode.inner || []) {
if (inner.kind === 'TextComment' && inner.text) {
texts.push(inner.text.trim());
} else if (inner.kind === 'InlineCommandComment' && inner.inner) {
// Handle inline commands like \c (code) or \b (bold)
for (const textNode of inner.inner) {
if (textNode.kind === 'TextComment' && textNode.text) {
texts.push(textNode.text.trim());
}
}
}
}
return texts.join(' ').trim();
}
/**
* Parses a FullComment node into a DocumentationComment
*/
function parseFullComment(commentNode: any): DocumentationComment | undefined {
const doc: DocumentationComment = {};
for (const inner of commentNode.inner || []) {
if (inner.kind === 'ParagraphComment') {
const text = extractTextFromParagraph(inner);
if (text) {
if (!doc.summary) {
doc.summary = text;
} else {
doc.details = (doc.details ? doc.details + '\n\n' : '') + text;
}
}
} else if (inner.kind === 'ParamCommandComment') {
if (!doc.params) doc.params = {};
// ParamCommandComment has its content in inner array
let paramText = '';
for (const paramInner of inner.inner || []) {
if (paramInner.kind === 'ParagraphComment') {
const text = extractTextFromParagraph(paramInner);
if (text) {
paramText = (paramText ? paramText + ' ' : '') + text;
}
}
}
if (inner.param && paramText) {
doc.params[inner.param] = paramText;
}
} else if (inner.kind === 'BlockCommandComment') {
// BlockCommandComment also has its content in inner array
let blockText = '';
for (const blockInner of inner.inner || []) {
if (blockInner.kind === 'ParagraphComment') {
const text = extractTextFromParagraph(blockInner);
if (text) {
blockText = (blockText ? blockText + ' ' : '') + text;
}
}
}
if (blockText) {
switch (inner.name) {
case 'return':
case 'returns':
doc.returns = blockText;
break;
case 'deprecated':
doc.deprecated = blockText;
break;
case 'since':
doc.since = blockText;
break;
case 'see':
if (!doc.see) doc.see = [];
doc.see.push(blockText);
break;
}
}
}
}
return Object.keys(doc).length > 0 ? doc : undefined;
}
/**
* Extracts documentation comment from an AST node
*/
function extractDocumentationComment(node: any): DocumentationComment | undefined {
// Look for FullComment in node.inner
const fullComment = (node.inner || []).find((n: any) => n.kind === 'FullComment');
if (!fullComment) return undefined;
return parseFullComment(fullComment);
}
/**
* Extracts member information from an AST node
*/
@ -131,6 +230,7 @@ function extractMember(inner: any, parent: any): Member & { access?: 'public' |
type: inner.type?.qualType || '',
isStatic: inner.storageClass === 'static',
access: 'public', // Will be set correctly later
documentation: extractDocumentationComment(inner),
loc: {
line: inner.loc.line || 0,
col: inner.loc.col || 0
@ -156,6 +256,7 @@ function extractMember(inner: any, parent: any): Member & { access?: 'public' |
isPure: inner.pure || false,
isConst: inner.constQualifier || false,
access: 'public', // Will be set correctly later
documentation: extractDocumentationComment(inner),
loc: {
line: inner.loc.line || 0,
col: inner.loc.col || 0
@ -172,6 +273,7 @@ function extractMember(inner: any, parent: any): Member & { access?: 'public' |
name: inner.name || parent.name || '',
parameters: extractParameters(inner),
access: 'public', // Will be set correctly later
documentation: extractDocumentationComment(inner),
loc: {
line: inner.loc.line || 0,
col: inner.loc.col || 0
@ -190,6 +292,7 @@ function extractMember(inner: any, parent: any): Member & { access?: 'public' |
isVirtual: inner.virtual || false,
isPure: inner.pure || false,
access: 'public', // Will be set correctly later
documentation: extractDocumentationComment(inner),
loc: {
line: inner.loc.line || 0,
col: inner.loc.col || 0
@ -227,6 +330,7 @@ function extractTypeInfo(node: any, sourceLines: string[]): Type {
return enumValue;
}),
documentation: extractDocumentationComment(node),
loc: {
line: node.loc?.line || 0,
col: node.loc?.col || 0
@ -239,6 +343,7 @@ function extractTypeInfo(node: any, sourceLines: string[]): Type {
const info: ClassOrStruct = {
name: node.name || '',
kind: (node.tagUsed || 'class') as 'class' | 'struct',
documentation: extractDocumentationComment(node),
loc: {
line: node.loc?.line || 0,
col: node.loc?.col || 0
@ -378,8 +483,8 @@ function extractLocalTypes(headerFile: string, typeMap: Map<string, Type> | null
const sourceContent = fs.readFileSync(absHeaderPath, 'utf8');
const sourceLines = sourceContent.split('\n');
// Get AST from clang
const cmd = `clang++ -Xclang -ast-dump=json -fsyntax-only -std=c++11 -I "${SPINE_INCLUDE_DIR}" "${absHeaderPath}" 2>/dev/null`;
// Get AST from clang with comment parsing enabled
const cmd = `clang++ -Xclang -ast-dump=json -fsyntax-only -std=c++11 -fparse-all-comments -I "${SPINE_INCLUDE_DIR}" "${absHeaderPath}" 2>/dev/null`;
const maxBuffer = headerFile.includes('Debug.h') ? 500 : 200; // MB
let astJson: any;

View File

@ -1,3 +1,13 @@
export interface DocumentationComment {
summary?: string; // Main description
details?: string; // Extended description
params?: { [name: string]: string }; // Parameter descriptions
returns?: string; // Return value description
deprecated?: string; // Deprecation notice
since?: string; // Version info
see?: string[]; // Related references
}
export interface Parameter {
name: string;
type: string;
@ -9,6 +19,7 @@ export type Field = {
type: string;
isStatic?: boolean;
fromSupertype?: string;
documentation?: DocumentationComment;
loc: {
line: number;
col: number;
@ -25,6 +36,7 @@ export type Method = {
isPure?: boolean;
isConst?: boolean;
fromSupertype?: string;
documentation?: DocumentationComment;
loc: {
line: number;
col: number;
@ -36,6 +48,7 @@ export type Constructor = {
name: string;
parameters?: Parameter[];
fromSupertype?: string;
documentation?: DocumentationComment;
loc: {
line: number;
col: number;
@ -48,6 +61,7 @@ export type Destructor = {
isVirtual?: boolean;
isPure?: boolean;
fromSupertype?: string;
documentation?: DocumentationComment;
loc: {
line: number;
col: number;
@ -64,6 +78,7 @@ export type Enum = {
kind: 'enum';
name: string;
values: EnumValue[];
documentation?: DocumentationComment;
loc: {
line: number;
col: number;
@ -87,6 +102,7 @@ export interface ClassOrStruct {
isAbstract?: boolean;
isTemplate?: boolean;
templateParams?: string[];
documentation?: DocumentationComment;
}
export type Type = ClassOrStruct | Enum;

View File

@ -19,7 +19,16 @@ SPINE_C_API void spine_alpha_timeline_apply(spine_alpha_timeline self, spine_ske
bool appliedPose);
SPINE_C_API int spine_alpha_timeline_get_slot_index(spine_alpha_timeline self);
SPINE_C_API void spine_alpha_timeline_set_slot_index(spine_alpha_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_alpha_timeline_set_frame(spine_alpha_timeline self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_alpha_timeline_get_curve_value(spine_alpha_timeline self, float time);
SPINE_C_API float spine_alpha_timeline_get_relative_value(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current,
float setup);

View File

@ -13,16 +13,53 @@ SPINE_C_API spine_animation spine_animation_create(const char *name, spine_array
SPINE_C_API void spine_animation_dispose(spine_animation self);
/**
* If the returned array or the timelines it contains are modified,
* setTimelines() must be called.
*/
SPINE_C_API spine_array_timeline spine_animation_get_timelines(spine_animation self);
SPINE_C_API void spine_animation_set_timelines(spine_animation self, spine_array_timeline timelines);
/**
* Returns true if this animation contains a timeline with any of the specified
* property IDs.
*/
SPINE_C_API bool spine_animation_has_timeline(spine_animation self, spine_array_property_id ids);
/**
* The duration of the animation in seconds, which is usually the highest time
* of all frames in the timeline. The duration is used to know when it has
* completed and when it should loop back to the start.
*/
SPINE_C_API float spine_animation_get_duration(spine_animation self);
SPINE_C_API void spine_animation_set_duration(spine_animation self, float inValue);
/**
* Applies the animation's timelines to the specified skeleton.
*
* See Timeline::apply().
*
* @param skeleton The skeleton the animation is being applied to. This provides access to the bones, slots, and other skeleton components the timelines may change.
* @param lastTime The last time in seconds this animation was applied. Some timelines trigger only at specific times rather than every frame. Pass -1 the first time an animation is applied to ensure frame 0 is triggered.
* @param time The time in seconds the skeleton is being posed for. Most timelines find the frame before and the frame after this time and interpolate between the frame values. If beyond the getDuration() and loop is true then the animation will repeat, else the last frame will be applied.
* @param loop If true, the animation repeats after the getDuration().
* @param events If any events are fired, they are added to this list. Can be null to ignore fired events or if no timelines fire events.
* @param alpha 0 applies the current or setup values (depending on blend). 1 applies the timeline values. Between 0 and 1 applies values between the current or setup values and the timeline values. By adjusting alpha over time, an animation can be mixed in or out. alpha can also be useful to apply animations on top of each other (layering).
* @param blend Controls how mixing is applied when alpha < 1.
* @param direction Indicates whether the timelines are mixing in or out. Used by timelines which perform instant transitions, such as DrawOrderTimeline or AttachmentTimeline.
*/
SPINE_C_API void spine_animation_apply(spine_animation self, spine_skeleton skeleton, float lastTime, float time, bool loop,
/*@null*/ spine_array_event events, float alpha, spine_mix_blend blend, spine_mix_direction direction,
bool appliedPose);
/**
* The animation's name, which is unique across all animations in the skeleton.
*/
SPINE_C_API const char *spine_animation_get_name(spine_animation self);
/**
* The bone indices affected by this animation.
*/
SPINE_C_API spine_array_int spine_animation_get_bones(spine_animation self);
/**
*
* @param target After the first and before the last entry.
*/
SPINE_C_API int spine_animation_search_1(spine_array_float values, float target);
SPINE_C_API int spine_animation_search_2(spine_array_float values, float target, int step);

View File

@ -13,25 +13,141 @@ SPINE_C_API spine_animation_state spine_animation_state_create(spine_animation_s
SPINE_C_API void spine_animation_state_dispose(spine_animation_state self);
/**
* Increments each track entry TrackEntry::getTrackTime(), setting queued
* animations as current if needed.
*/
SPINE_C_API void spine_animation_state_update(spine_animation_state self, float delta);
/**
* Poses the skeleton using the track entry animations. The animation state is
* not changed, so can be applied to multiple skeletons to pose them
* identically.
*
* @return True if any animations were applied.
*/
SPINE_C_API bool spine_animation_state_apply(spine_animation_state self, spine_skeleton skeleton);
/**
* Removes all animations from all tracks, leaving skeletons in their current
* pose.
*
* It may be desired to use AnimationState::setEmptyAnimations(float) to mix the
* skeletons back to the setup pose, rather than leaving them in their current
* pose.
*/
SPINE_C_API void spine_animation_state_clear_tracks(spine_animation_state self);
/**
* Removes all animations from the track, leaving skeletons in their current
* pose.
*
* It may be desired to use AnimationState::setEmptyAnimation(int, float) to mix
* the skeletons back to the setup pose, rather than leaving them in their
* current pose.
*/
SPINE_C_API void spine_animation_state_clear_track(spine_animation_state self, size_t trackIndex);
/**
* Sets an animation by name.
*
* See setAnimation(int, Animation, bool).
*/
SPINE_C_API spine_track_entry spine_animation_state_set_animation_1(spine_animation_state self, size_t trackIndex, const char *animationName,
bool loop);
/**
* Sets the current animation for a track, discarding any queued animations.
*
* If the formerly current track entry is for the same animation and was never
* applied to a skeleton, it is replaced (not mixed from).
*
* @param loop If true, the animation will repeat. If false, it will not, instead its last frame is applied if played beyond its duration. In either case TrackEntry.TrackEnd determines when the track is cleared.
*
* @return A track entry to allow further customization of animation playback. References to the track entry must not be kept after AnimationState.Dispose.
*/
SPINE_C_API spine_track_entry spine_animation_state_set_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation,
bool loop);
/**
* Queues an animation by name.
*
* See addAnimation(int, Animation, bool, float).
*/
SPINE_C_API spine_track_entry spine_animation_state_add_animation_1(spine_animation_state self, size_t trackIndex, const char *animationName,
bool loop, float delay);
/**
* Adds an animation to be played delay seconds after the current or last queued
* animation for a track. If the track has no entries, this is equivalent to
* calling setAnimation.
*
* @param delay Seconds to begin this animation after the start of the previous animation. May be < = 0 to use the animation duration of the previous track minus any mix duration plus the negative delay.
*
* @return A track entry to allow further customization of animation playback. References to the track entry must not be kept after AnimationState.Dispose
*/
SPINE_C_API spine_track_entry spine_animation_state_add_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation,
bool loop, float delay);
/**
* Sets an empty animation for a track, discarding any queued animations, and
* sets the track entry's TrackEntry::getMixDuration(). An empty animation has
* no timelines and serves as a placeholder for mixing in or out.
*
* Mixing out is done by setting an empty animation with a mix duration using
* either setEmptyAnimation(int, float), setEmptyAnimations(float), or
* addEmptyAnimation(int, float, float). Mixing to an empty animation causes the
* previous animation to be applied less and less over the mix duration.
* Properties keyed in the previous animation transition to the value from lower
* tracks or to the setup pose value if no lower tracks key the property. A mix
* duration of 0 still mixes out over one frame.
*
* Mixing in is done by first setting an empty animation, then adding an
* animation using addAnimation(int, Animation, bool, float) with the desired
* delay (an empty animation has a duration of 0) and on the returned track
* entry, set the TrackEntry::setMixDuration(float). Mixing from an empty
* animation causes the new animation to be applied more and more over the mix
* duration. Properties keyed in the new animation transition from the value
* from lower tracks or from the setup pose value if no lower tracks key the
* property to the value keyed in the new animation.
*
* See Empty animations in the Spine Runtimes Guide.
*/
SPINE_C_API spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration);
/**
* Adds an empty animation to be played after the current or last queued
* animation for a track, and sets the track entry's
* TrackEntry::getMixDuration(). If the track has no entries, it is equivalent
* to calling setEmptyAnimation(int, float).
*
* See setEmptyAnimation(int, float) and Empty animations in the Spine Runtimes
* Guide.
*
* @param delay If > 0, sets TrackEntry::getDelay(). If < = 0, the delay set is the duration of the previous track entry minus any mix duration plus the specified delay (ie the mix ends at ( delay = 0) or before ( delay < 0) the previous track entry duration). If the previous entry is looping, its next loop completion is used instead of its duration.
*
* @return A track entry to allow further customization of animation playback. References to the track entry must not be kept after the AnimationStateListener::dispose(TrackEntry) event occurs.
*/
SPINE_C_API spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration,
float delay);
/**
* Sets an empty animation for every track, discarding any queued animations,
* and mixes to it over the specified mix duration.
*
* See Empty animations in the Spine Runtimes Guide.
*/
SPINE_C_API void spine_animation_state_set_empty_animations(spine_animation_state self, float mixDuration);
/**
*
* @return The track entry for the animation currently playing on the track, or NULL if no animation is currently playing.
*/
SPINE_C_API /*@null*/ spine_track_entry spine_animation_state_get_current(spine_animation_state self, size_t trackIndex);
/**
* The AnimationStateData to look up mix durations.
*/
SPINE_C_API spine_animation_state_data spine_animation_state_get_data(spine_animation_state self);
/**
* The list of tracks that have had animations, which may contain null entries
* for tracks that currently have no animation.
*/
SPINE_C_API spine_array_track_entry spine_animation_state_get_tracks(spine_animation_state self);
/**
* Multiplier for the delta time when the animation state is updated, causing
* time for all animations and mixes to play slower or faster. Defaults to 1.
*
* See TrackEntry TrackEntry::getTimeScale() for affecting a single animation.
*/
SPINE_C_API float spine_animation_state_get_time_scale(spine_animation_state self);
SPINE_C_API void spine_animation_state_set_time_scale(spine_animation_state self, float inValue);
SPINE_C_API void spine_animation_state_disable_queue(spine_animation_state self);

View File

@ -13,12 +13,33 @@ SPINE_C_API spine_animation_state_data spine_animation_state_data_create(spine_s
SPINE_C_API void spine_animation_state_data_dispose(spine_animation_state_data self);
/**
* The SkeletonData to look up animations when they are specified by name.
*/
SPINE_C_API spine_skeleton_data spine_animation_state_data_get_skeleton_data(spine_animation_state_data self);
/**
* The mix duration to use when no mix duration has been specifically defined
* between two animations.
*/
SPINE_C_API float spine_animation_state_data_get_default_mix(spine_animation_state_data self);
SPINE_C_API void spine_animation_state_data_set_default_mix(spine_animation_state_data self, float inValue);
/**
* Sets a mix duration by animation names.
*/
SPINE_C_API void spine_animation_state_data_set_mix_1(spine_animation_state_data self, const char *fromName, const char *toName, float duration);
/**
* Sets a mix duration when changing from the specified animation to the other.
* See TrackEntry.MixDuration.
*/
SPINE_C_API void spine_animation_state_data_set_mix_2(spine_animation_state_data self, spine_animation from, spine_animation to, float duration);
/**
* The mix duration to use when changing from the specified animation to the
* other, or the DefaultMix if no mix duration has been set.
*/
SPINE_C_API float spine_animation_state_data_get_mix(spine_animation_state_data self, spine_animation from, spine_animation to);
/**
* Removes all mixes and sets the default mix to 0.
*/
SPINE_C_API void spine_animation_state_data_clear(spine_animation_state_data self);
#ifdef __cplusplus

View File

@ -12,6 +12,13 @@ extern "C" {
SPINE_C_API void spine_atlas_dispose(spine_atlas self);
SPINE_C_API void spine_atlas_flip_v(spine_atlas self);
/**
* Returns the first region found with the specified name. This method uses
* String comparison to find the region, so the result should be cached rather
* than calling this method multiple times.
*
* @return The region, or nullptr.
*/
SPINE_C_API /*@null*/ spine_atlas_region spine_atlas_find_region(spine_atlas self, const char *name);
SPINE_C_API spine_array_atlas_page spine_atlas_get_pages(spine_atlas self);
SPINE_C_API spine_array_atlas_region spine_atlas_get_regions(spine_atlas self);

View File

@ -11,14 +11,30 @@ extern "C" {
SPINE_C_API void spine_attachment_loader_dispose(spine_attachment_loader self);
/**
*
* @return May be NULL to not load any attachment.
*/
SPINE_C_API /*@null*/ spine_region_attachment spine_attachment_loader_new_region_attachment(spine_attachment_loader self, spine_skin skin,
const char *name, const char *path,
/*@null*/ spine_sequence sequence);
/**
*
* @return May be NULL to not load any attachment.
*/
SPINE_C_API /*@null*/ spine_mesh_attachment spine_attachment_loader_new_mesh_attachment(spine_attachment_loader self, spine_skin skin,
const char *name, const char *path,
/*@null*/ spine_sequence sequence);
/**
*
* @return May be NULL to not load any attachment.
*/
SPINE_C_API /*@null*/ spine_bounding_box_attachment spine_attachment_loader_new_bounding_box_attachment(spine_attachment_loader self, spine_skin skin,
const char *name);
/**
*
* @return May be NULL to not load any attachment
*/
SPINE_C_API /*@null*/ spine_path_attachment spine_attachment_loader_new_path_attachment(spine_attachment_loader self, spine_skin skin,
const char *name);
SPINE_C_API /*@null*/ spine_point_attachment spine_attachment_loader_new_point_attachment(spine_attachment_loader self, spine_skin skin,

View File

@ -17,6 +17,12 @@ SPINE_C_API spine_rtti spine_attachment_timeline_get_rtti(spine_attachment_timel
SPINE_C_API void spine_attachment_timeline_apply(spine_attachment_timeline self, spine_skeleton skeleton, float lastTime, float time,
/*@null*/ spine_array_event events, float alpha, spine_mix_blend blend,
spine_mix_direction direction, bool appliedPose);
/**
* Sets the time and attachment name for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_attachment_timeline_set_frame(spine_attachment_timeline self, int frame, float time, const char *attachmentName);
SPINE_C_API int spine_attachment_timeline_get_slot_index(spine_attachment_timeline self);
SPINE_C_API void spine_attachment_timeline_set_slot_index(spine_attachment_timeline self, int inValue);

View File

@ -9,17 +9,33 @@
extern "C" {
#endif
/**
*
* @param parent May be NULL.
*/
SPINE_C_API spine_bone spine_bone_create(spine_bone_data data, /*@null*/ spine_bone parent);
/**
* Copy constructor. Does not copy the children bones.
*/
SPINE_C_API spine_bone spine_bone_create2(spine_bone bone, /*@null*/ spine_bone parent);
SPINE_C_API void spine_bone_dispose(spine_bone self);
SPINE_C_API spine_rtti spine_bone_get_rtti(spine_bone self);
/**
* The parent bone, or null if this is the root bone.
*/
SPINE_C_API /*@null*/ spine_bone spine_bone_get_parent(spine_bone self);
/**
* The immediate children of this bone.
*/
SPINE_C_API spine_array_bone spine_bone_get_children(spine_bone self);
SPINE_C_API bool spine_bone_is_y_down(void);
SPINE_C_API void spine_bone_set_y_down(bool value);
SPINE_C_API void spine_bone_update(spine_bone self, spine_skeleton skeleton, spine_physics physics);
/**
* The constraint's setup pose data.
*/
SPINE_C_API spine_bone_data spine_bone_get_data(spine_bone self);
SPINE_C_API spine_bone_local spine_bone_get_pose(spine_bone self);
SPINE_C_API spine_bone_pose spine_bone_get_applied_pose(spine_bone self);

View File

@ -13,7 +13,13 @@ SPINE_C_API spine_bone_data spine_bone_data_create(int index, const char *name,
SPINE_C_API void spine_bone_data_dispose(spine_bone_data self);
/**
* The index of the bone in Skeleton.Bones
*/
SPINE_C_API int spine_bone_data_get_index(spine_bone_data self);
/**
* May be NULL.
*/
SPINE_C_API /*@null*/ spine_bone_data spine_bone_data_get_parent(spine_bone_data self);
SPINE_C_API float spine_bone_data_get_length(spine_bone_data self);
SPINE_C_API void spine_bone_data_set_length(spine_bone_data self, float inValue);
@ -23,7 +29,17 @@ SPINE_C_API void spine_bone_data_set_icon(spine_bone_data self, const char *icon
SPINE_C_API bool spine_bone_data_get_visible(spine_bone_data self);
SPINE_C_API void spine_bone_data_set_visible(spine_bone_data self, bool inValue);
SPINE_C_API spine_bone_local spine_bone_data_get_setup_pose(spine_bone_data self);
/**
* The constraint's name, which is unique across all constraints in the skeleton
* of the same type.
*/
SPINE_C_API const char *spine_bone_data_get_name(spine_bone_data self);
/**
* When true, Skeleton::updateWorldTransform(Physics) only updates this
* constraint if the Skeleton::getSkin() contains this constraint.
*
* See Skin::getConstraints().
*/
SPINE_C_API bool spine_bone_data_get_skin_required(spine_bone_data self);
SPINE_C_API void spine_bone_data_set_skin_required(spine_bone_data self, bool skinRequired);

View File

@ -14,23 +14,47 @@ SPINE_C_API spine_bone_local spine_bone_local_create(void);
SPINE_C_API void spine_bone_local_dispose(spine_bone_local self);
SPINE_C_API void spine_bone_local_set(spine_bone_local self, spine_bone_local pose);
/**
* The local x translation.
*/
SPINE_C_API float spine_bone_local_get_x(spine_bone_local self);
SPINE_C_API void spine_bone_local_set_x(spine_bone_local self, float x);
/**
* The local y translation.
*/
SPINE_C_API float spine_bone_local_get_y(spine_bone_local self);
SPINE_C_API void spine_bone_local_set_y(spine_bone_local self, float y);
SPINE_C_API void spine_bone_local_set_position(spine_bone_local self, float x, float y);
/**
* The local rotation in degrees, counter clockwise.
*/
SPINE_C_API float spine_bone_local_get_rotation(spine_bone_local self);
SPINE_C_API void spine_bone_local_set_rotation(spine_bone_local self, float rotation);
/**
* The local scaleX.
*/
SPINE_C_API float spine_bone_local_get_scale_x(spine_bone_local self);
SPINE_C_API void spine_bone_local_set_scale_x(spine_bone_local self, float scaleX);
/**
* The local scaleY.
*/
SPINE_C_API float spine_bone_local_get_scale_y(spine_bone_local self);
SPINE_C_API void spine_bone_local_set_scale_y(spine_bone_local self, float scaleY);
SPINE_C_API void spine_bone_local_set_scale_1(spine_bone_local self, float scaleX, float scaleY);
SPINE_C_API void spine_bone_local_set_scale_2(spine_bone_local self, float scale);
/**
* The local shearX.
*/
SPINE_C_API float spine_bone_local_get_shear_x(spine_bone_local self);
SPINE_C_API void spine_bone_local_set_shear_x(spine_bone_local self, float shearX);
/**
* The local shearY.
*/
SPINE_C_API float spine_bone_local_get_shear_y(spine_bone_local self);
SPINE_C_API void spine_bone_local_set_shear_y(spine_bone_local self, float shearY);
/**
* Determines how parent world transforms affect this bone.
*/
SPINE_C_API spine_inherit spine_bone_local_get_inherit(spine_bone_local self);
SPINE_C_API void spine_bone_local_set_inherit(spine_bone_local self, spine_inherit inherit);

View File

@ -14,54 +14,165 @@ SPINE_C_API spine_bone_pose spine_bone_pose_create(void);
SPINE_C_API void spine_bone_pose_dispose(spine_bone_pose self);
SPINE_C_API spine_rtti spine_bone_pose_get_rtti(spine_bone_pose self);
/**
* Called by Skeleton::updateCache() to compute the world transform, if needed.
*/
SPINE_C_API void spine_bone_pose_update(spine_bone_pose self, spine_skeleton skeleton, spine_physics physics);
/**
* Computes the world transform using the parent bone's applied pose and this
* pose. Child bones are not updated.
*
* See World transforms in the Spine Runtimes Guide.
*/
SPINE_C_API void spine_bone_pose_update_world_transform(spine_bone_pose self, spine_skeleton skeleton);
/**
* Computes the local transform values from the world transform.
*
* If the world transform is modified (by a constraint, rotateWorld(), etc) then
* this method should be called so the local transform matches the world
* transform. The local transform may be needed by other code (eg to apply
* another constraint).
*
* Some information is ambiguous in the world transform, such as -1,-1 scale
* versus 180 rotation. The local transform after calling this method is
* equivalent to the local transform used to compute the world transform, but
* may not be identical.
*/
SPINE_C_API void spine_bone_pose_update_local_transform(spine_bone_pose self, spine_skeleton skeleton);
/**
* If the world transform has been modified and the local transform no longer
* matches, updateLocalTransform() is called.
*/
SPINE_C_API void spine_bone_pose_validate_local_transform(spine_bone_pose self, spine_skeleton skeleton);
SPINE_C_API void spine_bone_pose_modify_local(spine_bone_pose self, spine_skeleton skeleton);
SPINE_C_API void spine_bone_pose_modify_world(spine_bone_pose self, int update);
SPINE_C_API void spine_bone_pose_reset_world(spine_bone_pose self, int update);
/**
* Part of the world transform matrix for the X axis. If changed,
* updateLocalTransform() should be called.
*/
SPINE_C_API float spine_bone_pose_get_a(spine_bone_pose self);
SPINE_C_API void spine_bone_pose_set_a(spine_bone_pose self, float a);
/**
* Part of the world transform matrix for the Y axis. If changed,
* updateLocalTransform() should be called.
*/
SPINE_C_API float spine_bone_pose_get_b(spine_bone_pose self);
SPINE_C_API void spine_bone_pose_set_b(spine_bone_pose self, float b);
/**
* Part of the world transform matrix for the X axis. If changed,
* updateLocalTransform() should be called.
*/
SPINE_C_API float spine_bone_pose_get_c(spine_bone_pose self);
SPINE_C_API void spine_bone_pose_set_c(spine_bone_pose self, float c);
/**
* Part of the world transform matrix for the Y axis. If changed,
* updateLocalTransform() should be called.
*/
SPINE_C_API float spine_bone_pose_get_d(spine_bone_pose self);
SPINE_C_API void spine_bone_pose_set_d(spine_bone_pose self, float d);
/**
* The world X position. If changed, updateLocalTransform() should be called.
*/
SPINE_C_API float spine_bone_pose_get_world_x(spine_bone_pose self);
SPINE_C_API void spine_bone_pose_set_world_x(spine_bone_pose self, float worldX);
/**
* The world Y position. If changed, updateLocalTransform() should be called.
*/
SPINE_C_API float spine_bone_pose_get_world_y(spine_bone_pose self);
SPINE_C_API void spine_bone_pose_set_world_y(spine_bone_pose self, float worldY);
/**
* The world rotation for the X axis, calculated using a and c.
*/
SPINE_C_API float spine_bone_pose_get_world_rotation_x(spine_bone_pose self);
/**
* The world rotation for the Y axis, calculated using b and d.
*/
SPINE_C_API float spine_bone_pose_get_world_rotation_y(spine_bone_pose self);
/**
* The magnitude (always positive) of the world scale X, calculated using a and
* c.
*/
SPINE_C_API float spine_bone_pose_get_world_scale_x(spine_bone_pose self);
/**
* The magnitude (always positive) of the world scale Y, calculated using b and
* d.
*/
SPINE_C_API float spine_bone_pose_get_world_scale_y(spine_bone_pose self);
/**
* Transforms a point from world coordinates to the bone's local coordinates.
*/
SPINE_C_API void spine_bone_pose_world_to_local(spine_bone_pose self, float worldX, float worldY, float *outLocalX, float *outLocalY);
/**
* Transforms a point from the bone's local coordinates to world coordinates.
*/
SPINE_C_API void spine_bone_pose_local_to_world(spine_bone_pose self, float localX, float localY, float *outWorldX, float *outWorldY);
/**
* Transforms a point from world coordinates to the parent bone's local
* coordinates.
*/
SPINE_C_API void spine_bone_pose_world_to_parent(spine_bone_pose self, float worldX, float worldY, float *outParentX, float *outParentY);
/**
* Transforms a point from the parent bone's coordinates to world coordinates.
*/
SPINE_C_API void spine_bone_pose_parent_to_world(spine_bone_pose self, float parentX, float parentY, float *outWorldX, float *outWorldY);
/**
* Transforms a world rotation to a local rotation.
*/
SPINE_C_API float spine_bone_pose_world_to_local_rotation(spine_bone_pose self, float worldRotation);
/**
* Transforms a local rotation to a world rotation.
*/
SPINE_C_API float spine_bone_pose_local_to_world_rotation(spine_bone_pose self, float localRotation);
/**
* Rotates the world transform the specified amount.
*
* After changes are made to the world transform, updateLocalTransform() should
* be called on this bone and any child bones, recursively.
*/
SPINE_C_API void spine_bone_pose_rotate_world(spine_bone_pose self, float degrees);
SPINE_C_API void spine_bone_pose_set(spine_bone_pose self, spine_bone_local pose);
/**
* The local x translation.
*/
SPINE_C_API float spine_bone_pose_get_x(spine_bone_pose self);
SPINE_C_API void spine_bone_pose_set_x(spine_bone_pose self, float x);
/**
* The local y translation.
*/
SPINE_C_API float spine_bone_pose_get_y(spine_bone_pose self);
SPINE_C_API void spine_bone_pose_set_y(spine_bone_pose self, float y);
SPINE_C_API void spine_bone_pose_set_position(spine_bone_pose self, float x, float y);
/**
* The local rotation in degrees, counter clockwise.
*/
SPINE_C_API float spine_bone_pose_get_rotation(spine_bone_pose self);
SPINE_C_API void spine_bone_pose_set_rotation(spine_bone_pose self, float rotation);
/**
* The local scaleX.
*/
SPINE_C_API float spine_bone_pose_get_scale_x(spine_bone_pose self);
SPINE_C_API void spine_bone_pose_set_scale_x(spine_bone_pose self, float scaleX);
/**
* The local scaleY.
*/
SPINE_C_API float spine_bone_pose_get_scale_y(spine_bone_pose self);
SPINE_C_API void spine_bone_pose_set_scale_y(spine_bone_pose self, float scaleY);
SPINE_C_API void spine_bone_pose_set_scale_1(spine_bone_pose self, float scaleX, float scaleY);
SPINE_C_API void spine_bone_pose_set_scale_2(spine_bone_pose self, float scale);
/**
* The local shearX.
*/
SPINE_C_API float spine_bone_pose_get_shear_x(spine_bone_pose self);
SPINE_C_API void spine_bone_pose_set_shear_x(spine_bone_pose self, float shearX);
/**
* The local shearY.
*/
SPINE_C_API float spine_bone_pose_get_shear_y(spine_bone_pose self);
SPINE_C_API void spine_bone_pose_set_shear_y(spine_bone_pose self, float shearY);
/**
* Determines how parent world transforms affect this bone.
*/
SPINE_C_API spine_inherit spine_bone_pose_get_inherit(spine_bone_pose self);
SPINE_C_API void spine_bone_pose_set_inherit(spine_bone_pose self, spine_inherit inherit);
SPINE_C_API spine_rtti spine_bone_pose_rtti(void);

View File

@ -12,6 +12,10 @@ extern "C" {
SPINE_C_API void spine_bone_timeline_dispose(spine_bone_timeline self);
SPINE_C_API spine_rtti spine_bone_timeline_get_rtti(spine_bone_timeline self);
/**
* The index of the bone in Skeleton::getBones() that will be changed when this
* timeline is applied.
*/
SPINE_C_API int spine_bone_timeline_get_bone_index(spine_bone_timeline self);
SPINE_C_API void spine_bone_timeline_set_bone_index(spine_bone_timeline self, int inValue);
SPINE_C_API spine_rtti spine_bone_timeline_rtti(void);

View File

@ -17,7 +17,16 @@ SPINE_C_API void spine_bone_timeline1_apply(spine_bone_timeline1 self, spine_ske
bool appliedPose);
SPINE_C_API int spine_bone_timeline1_get_bone_index(spine_bone_timeline1 self);
SPINE_C_API void spine_bone_timeline1_set_bone_index(spine_bone_timeline1 self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_bone_timeline1_set_frame(spine_bone_timeline1 self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_bone_timeline1_get_curve_value(spine_bone_timeline1 self, float time);
SPINE_C_API float spine_bone_timeline1_get_relative_value(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current,
float setup);

View File

@ -16,12 +16,28 @@ SPINE_C_API void spine_bounding_box_attachment_dispose(spine_bounding_box_attach
SPINE_C_API spine_rtti spine_bounding_box_attachment_get_rtti(spine_bounding_box_attachment self);
SPINE_C_API spine_color spine_bounding_box_attachment_get_color(spine_bounding_box_attachment self);
SPINE_C_API spine_attachment spine_bounding_box_attachment_copy(spine_bounding_box_attachment self);
/**
* Transforms the attachment's local vertices to world coordinates. If the
* slot's SlotPose::getDeform() is not empty, it is used to deform the vertices.
*
* See https://esotericsoftware.com/spine-runtime-skeletons#World-transforms
* World transforms in the Spine Runtimes Guide.
*
* @param start The index of the first vertices value to transform. Each vertex has 2 values, x and y.
* @param count The number of world vertex values to output. Must be < = WorldVerticesLength - start.
* @param worldVertices The output world vertices. Must have a length >= offset + count * stride / 2.
* @param offset The worldVertices index to begin writing values.
* @param stride The number of worldVertices entries between the value pairs written.
*/
SPINE_C_API void spine_bounding_box_attachment_compute_world_vertices_1(spine_bounding_box_attachment self, spine_skeleton skeleton, spine_slot slot,
size_t start, size_t count, /*@null*/ float *worldVertices, size_t offset,
size_t stride);
SPINE_C_API void spine_bounding_box_attachment_compute_world_vertices_2(spine_bounding_box_attachment self, spine_skeleton skeleton, spine_slot slot,
size_t start, size_t count, spine_array_float worldVertices, size_t offset,
size_t stride);
/**
* Gets a unique ID for this attachment.
*/
SPINE_C_API int spine_bounding_box_attachment_get_id(spine_bounding_box_attachment self);
SPINE_C_API spine_array_int spine_bounding_box_attachment_get_bones(spine_bounding_box_attachment self);
SPINE_C_API void spine_bounding_box_attachment_set_bones(spine_bounding_box_attachment self, spine_array_int bones);

View File

@ -18,12 +18,28 @@ SPINE_C_API /*@null*/ spine_slot_data spine_clipping_attachment_get_end_slot(spi
SPINE_C_API void spine_clipping_attachment_set_end_slot(spine_clipping_attachment self, /*@null*/ spine_slot_data inValue);
SPINE_C_API spine_color spine_clipping_attachment_get_color(spine_clipping_attachment self);
SPINE_C_API spine_attachment spine_clipping_attachment_copy(spine_clipping_attachment self);
/**
* Transforms the attachment's local vertices to world coordinates. If the
* slot's SlotPose::getDeform() is not empty, it is used to deform the vertices.
*
* See https://esotericsoftware.com/spine-runtime-skeletons#World-transforms
* World transforms in the Spine Runtimes Guide.
*
* @param start The index of the first vertices value to transform. Each vertex has 2 values, x and y.
* @param count The number of world vertex values to output. Must be < = WorldVerticesLength - start.
* @param worldVertices The output world vertices. Must have a length >= offset + count * stride / 2.
* @param offset The worldVertices index to begin writing values.
* @param stride The number of worldVertices entries between the value pairs written.
*/
SPINE_C_API void spine_clipping_attachment_compute_world_vertices_1(spine_clipping_attachment self, spine_skeleton skeleton, spine_slot slot,
size_t start, size_t count, /*@null*/ float *worldVertices, size_t offset,
size_t stride);
SPINE_C_API void spine_clipping_attachment_compute_world_vertices_2(spine_clipping_attachment self, spine_skeleton skeleton, spine_slot slot,
size_t start, size_t count, spine_array_float worldVertices, size_t offset,
size_t stride);
/**
* Gets a unique ID for this attachment.
*/
SPINE_C_API int spine_clipping_attachment_get_id(spine_clipping_attachment self);
SPINE_C_API spine_array_int spine_clipping_attachment_get_bones(spine_clipping_attachment self);
SPINE_C_API void spine_clipping_attachment_set_bones(spine_clipping_attachment self, spine_array_int bones);

View File

@ -22,7 +22,13 @@ SPINE_C_API spine_color spine_color_add_2(spine_color self, float _r, float _g,
SPINE_C_API spine_color spine_color_add_3(spine_color self, spine_color other);
SPINE_C_API spine_color spine_color_clamp(spine_color self);
SPINE_C_API float spine_color_parse_hex(/*@null*/ const char *value, size_t index);
/**
* Convert packed RGBA8888 integer to Color
*/
SPINE_C_API void spine_color_rgba8888_to_color(spine_color color, int value);
/**
* Convert packed RGB888 integer to Color (no alpha)
*/
SPINE_C_API void spine_color_rgb888_to_color(spine_color color, int value);
SPINE_C_API float spine_color_get_r(spine_color self);
SPINE_C_API void spine_color_set_r(spine_color self, float value);

View File

@ -15,6 +15,9 @@ SPINE_C_API spine_rtti spine_constraint_get_rtti(spine_constraint self);
SPINE_C_API spine_constraint_data spine_constraint_get_data(spine_constraint self);
SPINE_C_API void spine_constraint_sort(spine_constraint self, spine_skeleton skeleton);
SPINE_C_API bool spine_constraint_is_source_active(spine_constraint self);
/**
* Inherited from Update
*/
SPINE_C_API void spine_constraint_update(spine_constraint self, spine_skeleton skeleton, spine_physics physics);
SPINE_C_API spine_rtti spine_constraint_rtti(void);

View File

@ -12,6 +12,10 @@ extern "C" {
SPINE_C_API void spine_constraint_timeline_dispose(spine_constraint_timeline self);
SPINE_C_API spine_rtti spine_constraint_timeline_get_rtti(spine_constraint_timeline self);
/**
* The index of the constraint in Skeleton::getConstraints() that will be
* changed when this timeline is applied.
*/
SPINE_C_API int spine_constraint_timeline_get_constraint_index(spine_constraint_timeline self);
SPINE_C_API void spine_constraint_timeline_set_constraint_index(spine_constraint_timeline self, int inValue);
SPINE_C_API spine_rtti spine_constraint_timeline_rtti(void);

View File

@ -14,7 +14,16 @@ SPINE_C_API void spine_constraint_timeline1_dispose(spine_constraint_timeline1 s
SPINE_C_API spine_rtti spine_constraint_timeline1_get_rtti(spine_constraint_timeline1 self);
SPINE_C_API int spine_constraint_timeline1_get_constraint_index(spine_constraint_timeline1 self);
SPINE_C_API void spine_constraint_timeline1_set_constraint_index(spine_constraint_timeline1 self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_constraint_timeline1_set_frame(spine_constraint_timeline1 self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_constraint_timeline1_get_curve_value(spine_constraint_timeline1 self, float time);
SPINE_C_API float spine_constraint_timeline1_get_relative_value(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend,
float current, float setup);
@ -31,6 +40,18 @@ SPINE_C_API void spine_constraint_timeline1_set_bezier(spine_constraint_timeline
SPINE_C_API float spine_constraint_timeline1_get_bezier_value(spine_constraint_timeline1 self, float time, size_t frame, size_t valueOffset,
size_t i);
SPINE_C_API spine_array_float spine_constraint_timeline1_get_curves(spine_constraint_timeline1 self);
/**
* Sets the value(s) for the specified time.
*
* @param skeleton The skeleton the timeline is being applied to. This provides access to the bones, slots, and other skeleton components the timeline may change.
* @param lastTime lastTime The time this timeline was last applied. Timelines such as EventTimeline trigger only at specific times rather than every frame. In that case, the timeline triggers everything between lastTime (exclusive) and time (inclusive).
* @param time The time within the animation. Most timelines find the key before and the key after this time so they can interpolate between the keys.
* @param events If any events are fired, they are added to this array. Can be NULL to ignore firing events or if the timeline does not fire events. May be NULL.
* @param alpha alpha 0 applies the current or setup pose value (depending on pose parameter). 1 applies the timeline value. Between 0 and 1 applies a value between the current or setup pose and the timeline value. By adjusting alpha over time, an animation can be mixed in or out. alpha can also be useful to apply animations on top of each other (layered).
* @param blend Controls how mixing is applied when alpha is than 1.
* @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions such as DrawOrderTimeline and AttachmentTimeline.
* @param appliedPose True to modify the applied pose.
*/
SPINE_C_API void spine_constraint_timeline1_apply(spine_constraint_timeline1 self, spine_skeleton skeleton, float lastTime, float time,
/*@null*/ spine_array_event events, float alpha, spine_mix_blend blend,
spine_mix_direction direction, bool appliedPose);

View File

@ -18,6 +18,18 @@ SPINE_C_API void spine_curve_timeline_set_bezier(spine_curve_timeline self, size
float cx1, float cy1, float cx2, float cy2, float time2, float value2);
SPINE_C_API float spine_curve_timeline_get_bezier_value(spine_curve_timeline self, float time, size_t frame, size_t valueOffset, size_t i);
SPINE_C_API spine_array_float spine_curve_timeline_get_curves(spine_curve_timeline self);
/**
* Sets the value(s) for the specified time.
*
* @param skeleton The skeleton the timeline is being applied to. This provides access to the bones, slots, and other skeleton components the timeline may change.
* @param lastTime lastTime The time this timeline was last applied. Timelines such as EventTimeline trigger only at specific times rather than every frame. In that case, the timeline triggers everything between lastTime (exclusive) and time (inclusive).
* @param time The time within the animation. Most timelines find the key before and the key after this time so they can interpolate between the keys.
* @param events If any events are fired, they are added to this array. Can be NULL to ignore firing events or if the timeline does not fire events. May be NULL.
* @param alpha alpha 0 applies the current or setup pose value (depending on pose parameter). 1 applies the timeline value. Between 0 and 1 applies a value between the current or setup pose and the timeline value. By adjusting alpha over time, an animation can be mixed in or out. alpha can also be useful to apply animations on top of each other (layered).
* @param blend Controls how mixing is applied when alpha is than 1.
* @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions such as DrawOrderTimeline and AttachmentTimeline.
* @param appliedPose True to modify the applied pose.
*/
SPINE_C_API void spine_curve_timeline_apply(spine_curve_timeline self, spine_skeleton skeleton, float lastTime, float time,
/*@null*/ spine_array_event events, float alpha, spine_mix_blend blend, spine_mix_direction direction,
bool appliedPose);

View File

@ -12,7 +12,16 @@ extern "C" {
SPINE_C_API void spine_curve_timeline1_dispose(spine_curve_timeline1 self);
SPINE_C_API spine_rtti spine_curve_timeline1_get_rtti(spine_curve_timeline1 self);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_curve_timeline1_set_frame(spine_curve_timeline1 self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_curve_timeline1_get_curve_value(spine_curve_timeline1 self, float time);
SPINE_C_API float spine_curve_timeline1_get_relative_value(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current,
float setup);
@ -28,6 +37,18 @@ SPINE_C_API void spine_curve_timeline1_set_bezier(spine_curve_timeline1 self, si
float cx1, float cy1, float cx2, float cy2, float time2, float value2);
SPINE_C_API float spine_curve_timeline1_get_bezier_value(spine_curve_timeline1 self, float time, size_t frame, size_t valueOffset, size_t i);
SPINE_C_API spine_array_float spine_curve_timeline1_get_curves(spine_curve_timeline1 self);
/**
* Sets the value(s) for the specified time.
*
* @param skeleton The skeleton the timeline is being applied to. This provides access to the bones, slots, and other skeleton components the timeline may change.
* @param lastTime lastTime The time this timeline was last applied. Timelines such as EventTimeline trigger only at specific times rather than every frame. In that case, the timeline triggers everything between lastTime (exclusive) and time (inclusive).
* @param time The time within the animation. Most timelines find the key before and the key after this time so they can interpolate between the keys.
* @param events If any events are fired, they are added to this array. Can be NULL to ignore firing events or if the timeline does not fire events. May be NULL.
* @param alpha alpha 0 applies the current or setup pose value (depending on pose parameter). 1 applies the timeline value. Between 0 and 1 applies a value between the current or setup pose and the timeline value. By adjusting alpha over time, an animation can be mixed in or out. alpha can also be useful to apply animations on top of each other (layered).
* @param blend Controls how mixing is applied when alpha is than 1.
* @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions such as DrawOrderTimeline and AttachmentTimeline.
* @param appliedPose True to modify the applied pose.
*/
SPINE_C_API void spine_curve_timeline1_apply(spine_curve_timeline1 self, spine_skeleton skeleton, float lastTime, float time,
/*@null*/ spine_array_event events, float alpha, spine_mix_blend blend, spine_mix_direction direction,
bool appliedPose);

View File

@ -15,7 +15,13 @@ SPINE_C_API spine_deform_timeline spine_deform_timeline_create(size_t frameCount
SPINE_C_API void spine_deform_timeline_dispose(spine_deform_timeline self);
SPINE_C_API spine_rtti spine_deform_timeline_get_rtti(spine_deform_timeline self);
/**
* Sets the time and vertices for the specified frame.
*/
SPINE_C_API void spine_deform_timeline_set_frame(spine_deform_timeline self, int frameIndex, float time, spine_array_float vertices);
/**
* The attachment that will be deformed.
*/
SPINE_C_API spine_vertex_attachment spine_deform_timeline_get_attachment(spine_deform_timeline self);
SPINE_C_API void spine_deform_timeline_set_attachment(spine_deform_timeline self, spine_vertex_attachment inValue);
SPINE_C_API void spine_deform_timeline_set_bezier(spine_deform_timeline self, size_t bezier, size_t frame, float value, float time1, float value1,

View File

@ -18,6 +18,13 @@ SPINE_C_API void spine_draw_order_timeline_apply(spine_draw_order_timeline self,
/*@null*/ spine_array_event events, float alpha, spine_mix_blend blend,
spine_mix_direction direction, bool appliedPose);
SPINE_C_API size_t spine_draw_order_timeline_get_frame_count(spine_draw_order_timeline self);
/**
* Sets the time and draw order for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
* @param drawOrder For each slot in Skeleton::slots, the index of the slot in the new draw order. May be null to use setup pose draw order.
*/
SPINE_C_API void spine_draw_order_timeline_set_frame(spine_draw_order_timeline self, size_t frame, float time, /*@null*/ spine_array_int drawOrder);
SPINE_C_API size_t spine_draw_order_timeline_get_frame_entries(spine_draw_order_timeline self);
SPINE_C_API spine_array_float spine_draw_order_timeline_get_frames(spine_draw_order_timeline self);

View File

@ -13,7 +13,13 @@ SPINE_C_API spine_event spine_event_create(float time, spine_event_data data);
SPINE_C_API void spine_event_dispose(spine_event self);
/**
* The event's setup pose data.
*/
SPINE_C_API spine_event_data spine_event_get_data(spine_event self);
/**
* The animation time this event was keyed.
*/
SPINE_C_API float spine_event_get_time(spine_event self);
SPINE_C_API int spine_event_get_int(spine_event self);
SPINE_C_API void spine_event_set_int(spine_event self, int inValue);

View File

@ -13,6 +13,9 @@ SPINE_C_API spine_event_data spine_event_data_create(const char *name);
SPINE_C_API void spine_event_data_dispose(spine_event_data self);
/**
* The name of the event, which is unique within the skeleton.
*/
SPINE_C_API const char *spine_event_data_get_name(spine_event_data self);
SPINE_C_API int spine_event_data_get_int(spine_event_data self);
SPINE_C_API void spine_event_data_set_int(spine_event_data self, int inValue);

View File

@ -14,11 +14,22 @@ SPINE_C_API spine_event_timeline spine_event_timeline_create(size_t frameCount);
SPINE_C_API void spine_event_timeline_dispose(spine_event_timeline self);
SPINE_C_API spine_rtti spine_event_timeline_get_rtti(spine_event_timeline self);
/**
* Fires events for frames > lastTime and < = time.
*/
SPINE_C_API void spine_event_timeline_apply(spine_event_timeline self, spine_skeleton skeleton, float lastTime, float time,
/*@null*/ spine_array_event events, float alpha, spine_mix_blend blend, spine_mix_direction direction,
bool appliedPose);
SPINE_C_API size_t spine_event_timeline_get_frame_count(spine_event_timeline self);
/**
* The event for each frame.
*/
SPINE_C_API spine_array_event spine_event_timeline_get_events(spine_event_timeline self);
/**
* Sets the time and event for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
*/
SPINE_C_API void spine_event_timeline_set_frame(spine_event_timeline self, size_t frame, spine_event event);
SPINE_C_API size_t spine_event_timeline_get_frame_entries(spine_event_timeline self);
SPINE_C_API spine_array_float spine_event_timeline_get_frames(spine_event_timeline self);

View File

@ -12,6 +12,9 @@ extern "C" {
SPINE_C_API void spine_from_property_dispose(spine_from_property self);
SPINE_C_API spine_rtti spine_from_property_get_rtti(spine_from_property self);
/**
* Reads this property from the specified bone.
*/
SPINE_C_API float spine_from_property_value(spine_from_property self, spine_skeleton skeleton, spine_bone_pose source, bool local,
/*@null*/ float *offsets);
SPINE_C_API spine_rtti spine_from_property_rtti(void);

View File

@ -21,8 +21,19 @@ SPINE_C_API bool spine_ik_constraint_is_source_active(spine_ik_constraint self);
SPINE_C_API spine_array_bone_pose spine_ik_constraint_get_bones(spine_ik_constraint self);
SPINE_C_API spine_bone spine_ik_constraint_get_target(spine_ik_constraint self);
SPINE_C_API void spine_ik_constraint_set_target(spine_ik_constraint self, spine_bone inValue);
/**
* Adjusts the bone rotation so the tip is as close to the target position as
* possible. The target is specified in the world coordinate system.
*/
SPINE_C_API void spine_ik_constraint_apply_1(spine_skeleton skeleton, spine_bone_pose bone, float targetX, float targetY, bool compress, bool stretch,
bool uniform, float mix);
/**
* Adjusts the parent and child bone rotations so the tip of the child is as
* close to the target position as possible. The target is specified in the
* world coordinate system.
*
* @param child A direct descendant of the parent bone.
*/
SPINE_C_API void spine_ik_constraint_apply_2(spine_skeleton skeleton, spine_bone_pose parent, spine_bone_pose child, float targetX, float targetY,
int bendDirection, bool stretch, bool uniform, float softness, float mix);
SPINE_C_API spine_ik_constraint_data spine_ik_constraint_get_data(spine_ik_constraint self);

View File

@ -22,6 +22,9 @@ SPINE_C_API void spine_ik_constraint_base_set_active(spine_ik_constraint_base se
SPINE_C_API spine_rtti spine_ik_constraint_base_get_rtti(spine_ik_constraint_base self);
SPINE_C_API void spine_ik_constraint_base_sort(spine_ik_constraint_base self, spine_skeleton skeleton);
SPINE_C_API bool spine_ik_constraint_base_is_source_active(spine_ik_constraint_base self);
/**
* Inherited from Update
*/
SPINE_C_API void spine_ik_constraint_base_update(spine_ik_constraint_base self, spine_skeleton skeleton, spine_physics physics);
SPINE_C_API spine_rtti spine_ik_constraint_base_rtti(void);

View File

@ -15,11 +15,24 @@ SPINE_C_API void spine_ik_constraint_data_dispose(spine_ik_constraint_data self)
SPINE_C_API spine_rtti spine_ik_constraint_data_get_rtti(spine_ik_constraint_data self);
SPINE_C_API spine_constraint spine_ik_constraint_data_create_method(spine_ik_constraint_data self, spine_skeleton skeleton);
/**
* The bones that are constrained by this IK Constraint.
*/
SPINE_C_API spine_array_bone_data spine_ik_constraint_data_get_bones(spine_ik_constraint_data self);
/**
* The bone that is the IK target.
*/
SPINE_C_API spine_bone_data spine_ik_constraint_data_get_target(spine_ik_constraint_data self);
SPINE_C_API void spine_ik_constraint_data_set_target(spine_ik_constraint_data self, spine_bone_data inValue);
/**
* When true and IkConstraintPose compress or stretch is used, the bone is
* scaled on both the X and Y axes.
*/
SPINE_C_API bool spine_ik_constraint_data_get_uniform(spine_ik_constraint_data self);
SPINE_C_API void spine_ik_constraint_data_set_uniform(spine_ik_constraint_data self, bool uniform);
/**
* Resolve ambiguity by forwarding to PosedData's implementation
*/
SPINE_C_API const char *spine_ik_constraint_data_get_name(spine_ik_constraint_data self);
SPINE_C_API bool spine_ik_constraint_data_get_skin_required(spine_ik_constraint_data self);
SPINE_C_API spine_ik_constraint_pose spine_ik_constraint_data_get_setup_pose(spine_ik_constraint_data self);

View File

@ -14,14 +14,41 @@ SPINE_C_API spine_ik_constraint_pose spine_ik_constraint_pose_create(void);
SPINE_C_API void spine_ik_constraint_pose_dispose(spine_ik_constraint_pose self);
SPINE_C_API void spine_ik_constraint_pose_set(spine_ik_constraint_pose self, spine_ik_constraint_pose pose);
/**
* A percentage (0-1) that controls the mix between the constrained and
* unconstrained rotation.
*
* For two bone IK: if the parent bone has local nonuniform scale, the child
* bone's local Y translation is set to 0.
*/
SPINE_C_API float spine_ik_constraint_pose_get_mix(spine_ik_constraint_pose self);
SPINE_C_API void spine_ik_constraint_pose_set_mix(spine_ik_constraint_pose self, float mix);
/**
* For two bone IK, the target bone's distance from the maximum reach of the
* bones where rotation begins to slow. The bones will not straighten completely
* until the target is this far out of range.
*/
SPINE_C_API float spine_ik_constraint_pose_get_softness(spine_ik_constraint_pose self);
SPINE_C_API void spine_ik_constraint_pose_set_softness(spine_ik_constraint_pose self, float softness);
/**
* For two bone IK, controls the bend direction of the IK bones, either 1 or -1.
*/
SPINE_C_API int spine_ik_constraint_pose_get_bend_direction(spine_ik_constraint_pose self);
SPINE_C_API void spine_ik_constraint_pose_set_bend_direction(spine_ik_constraint_pose self, int bendDirection);
/**
* For one bone IK, when true and the target is too close, the bone is scaled to
* reach it.
*/
SPINE_C_API bool spine_ik_constraint_pose_get_compress(spine_ik_constraint_pose self);
SPINE_C_API void spine_ik_constraint_pose_set_compress(spine_ik_constraint_pose self, bool compress);
/**
* When true and the target is out of range, the parent bone is scaled to reach
* it.
*
* For two bone IK: 1) the child bone's local Y translation is set to 0, 2)
* stretch is not applied if getSoftness() is > 0, and 3) if the parent bone has
* local nonuniform scale, stretch is not applied.
*/
SPINE_C_API bool spine_ik_constraint_pose_get_stretch(spine_ik_constraint_pose self);
SPINE_C_API void spine_ik_constraint_pose_set_stretch(spine_ik_constraint_pose self, bool stretch);

View File

@ -17,6 +17,14 @@ SPINE_C_API spine_rtti spine_ik_constraint_timeline_get_rtti(spine_ik_constraint
SPINE_C_API void spine_ik_constraint_timeline_apply(spine_ik_constraint_timeline self, spine_skeleton skeleton, float lastTime, float time,
/*@null*/ spine_array_event events, float alpha, spine_mix_blend blend,
spine_mix_direction direction, bool appliedPose);
/**
* Sets the time, mix, softness, bend direction, compress, and stretch for the
* specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
* @param bendDirection 1 or -1.
*/
SPINE_C_API void spine_ik_constraint_timeline_set_frame(spine_ik_constraint_timeline self, int frame, float time, float mix, float softness,
int bendDirection, bool compress, bool stretch);
SPINE_C_API int spine_ik_constraint_timeline_get_constraint_index(spine_ik_constraint_timeline self);

View File

@ -14,6 +14,12 @@ SPINE_C_API spine_inherit_timeline spine_inherit_timeline_create(size_t frameCou
SPINE_C_API void spine_inherit_timeline_dispose(spine_inherit_timeline self);
SPINE_C_API spine_rtti spine_inherit_timeline_get_rtti(spine_inherit_timeline self);
/**
* Sets the inherit transform mode for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_inherit_timeline_set_frame(spine_inherit_timeline self, int frame, float time, spine_inherit inherit);
SPINE_C_API void spine_inherit_timeline_apply(spine_inherit_timeline self, spine_skeleton skeleton, float lastTime, float time,
/*@null*/ spine_array_event events, float alpha, spine_mix_blend blend, spine_mix_direction direction,

View File

@ -23,6 +23,10 @@ SPINE_C_API int spine_mesh_attachment_get_hull_length(spine_mesh_attachment self
SPINE_C_API void spine_mesh_attachment_set_hull_length(spine_mesh_attachment self, int inValue);
SPINE_C_API spine_array_float spine_mesh_attachment_get_region_u_vs(spine_mesh_attachment self);
SPINE_C_API void spine_mesh_attachment_set_region_u_vs(spine_mesh_attachment self, spine_array_float inValue);
/**
* The UV pair for each vertex, normalized within the entire texture. See also
* MeshAttachment::updateRegion
*/
SPINE_C_API spine_array_float spine_mesh_attachment_get_u_vs(spine_mesh_attachment self);
SPINE_C_API spine_array_unsigned_short spine_mesh_attachment_get_triangles(spine_mesh_attachment self);
SPINE_C_API void spine_mesh_attachment_set_triangles(spine_mesh_attachment self, spine_array_unsigned_short inValue);
@ -35,6 +39,9 @@ SPINE_C_API /*@null*/ spine_sequence spine_mesh_attachment_get_sequence(spine_me
SPINE_C_API void spine_mesh_attachment_set_sequence(spine_mesh_attachment self, /*@null*/ spine_sequence sequence);
SPINE_C_API /*@null*/ spine_mesh_attachment spine_mesh_attachment_get_parent_mesh(spine_mesh_attachment self);
SPINE_C_API void spine_mesh_attachment_set_parent_mesh(spine_mesh_attachment self, /*@null*/ spine_mesh_attachment inValue);
/**
* Nonessential.
*/
SPINE_C_API spine_array_unsigned_short spine_mesh_attachment_get_edges(spine_mesh_attachment self);
SPINE_C_API void spine_mesh_attachment_set_edges(spine_mesh_attachment self, spine_array_unsigned_short inValue);
SPINE_C_API float spine_mesh_attachment_get_width(spine_mesh_attachment self);
@ -43,6 +50,9 @@ SPINE_C_API float spine_mesh_attachment_get_height(spine_mesh_attachment self);
SPINE_C_API void spine_mesh_attachment_set_height(spine_mesh_attachment self, float inValue);
SPINE_C_API spine_attachment spine_mesh_attachment_copy(spine_mesh_attachment self);
SPINE_C_API spine_mesh_attachment spine_mesh_attachment_new_linked_mesh(spine_mesh_attachment self);
/**
* Gets a unique ID for this attachment.
*/
SPINE_C_API int spine_mesh_attachment_get_id(spine_mesh_attachment self);
SPINE_C_API spine_array_int spine_mesh_attachment_get_bones(spine_mesh_attachment self);
SPINE_C_API void spine_mesh_attachment_set_bones(spine_mesh_attachment self, spine_array_int bones);

View File

@ -14,6 +14,10 @@ SPINE_C_API spine_path_attachment spine_path_attachment_create(const char *name)
SPINE_C_API void spine_path_attachment_dispose(spine_path_attachment self);
SPINE_C_API spine_rtti spine_path_attachment_get_rtti(spine_path_attachment self);
/**
* The length in the setup pose from the start of the path to the end of each
* curve.
*/
SPINE_C_API spine_array_float spine_path_attachment_get_lengths(spine_path_attachment self);
SPINE_C_API void spine_path_attachment_set_lengths(spine_path_attachment self, spine_array_float inValue);
SPINE_C_API bool spine_path_attachment_get_closed(spine_path_attachment self);
@ -22,10 +26,26 @@ SPINE_C_API bool spine_path_attachment_get_constant_speed(spine_path_attachment
SPINE_C_API void spine_path_attachment_set_constant_speed(spine_path_attachment self, bool inValue);
SPINE_C_API spine_color spine_path_attachment_get_color(spine_path_attachment self);
SPINE_C_API spine_attachment spine_path_attachment_copy(spine_path_attachment self);
/**
* Transforms the attachment's local vertices to world coordinates. If the
* slot's SlotPose::getDeform() is not empty, it is used to deform the vertices.
*
* See https://esotericsoftware.com/spine-runtime-skeletons#World-transforms
* World transforms in the Spine Runtimes Guide.
*
* @param start The index of the first vertices value to transform. Each vertex has 2 values, x and y.
* @param count The number of world vertex values to output. Must be < = WorldVerticesLength - start.
* @param worldVertices The output world vertices. Must have a length >= offset + count * stride / 2.
* @param offset The worldVertices index to begin writing values.
* @param stride The number of worldVertices entries between the value pairs written.
*/
SPINE_C_API void spine_path_attachment_compute_world_vertices_1(spine_path_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start,
size_t count, /*@null*/ float *worldVertices, size_t offset, size_t stride);
SPINE_C_API void spine_path_attachment_compute_world_vertices_2(spine_path_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start,
size_t count, spine_array_float worldVertices, size_t offset, size_t stride);
/**
* Gets a unique ID for this attachment.
*/
SPINE_C_API int spine_path_attachment_get_id(spine_path_attachment self);
SPINE_C_API spine_array_int spine_path_attachment_get_bones(spine_path_attachment self);
SPINE_C_API void spine_path_attachment_set_bones(spine_path_attachment self, spine_array_int bones);

View File

@ -15,10 +15,19 @@ SPINE_C_API void spine_path_constraint_dispose(spine_path_constraint self);
SPINE_C_API spine_rtti spine_path_constraint_get_rtti(spine_path_constraint self);
SPINE_C_API spine_path_constraint spine_path_constraint_copy(spine_path_constraint self, spine_skeleton skeleton);
/**
* Applies the constraint to the constrained bones.
*/
SPINE_C_API void spine_path_constraint_update(spine_path_constraint self, spine_skeleton skeleton, spine_physics physics);
SPINE_C_API void spine_path_constraint_sort(spine_path_constraint self, spine_skeleton skeleton);
SPINE_C_API bool spine_path_constraint_is_source_active(spine_path_constraint self);
/**
* The bones that will be modified by this path constraint.
*/
SPINE_C_API spine_array_bone_pose spine_path_constraint_get_bones(spine_path_constraint self);
/**
* The slot whose path attachment will be used to constrained the bones.
*/
SPINE_C_API spine_slot spine_path_constraint_get_slot(spine_path_constraint self);
SPINE_C_API void spine_path_constraint_set_slot(spine_path_constraint self, spine_slot slot);
SPINE_C_API spine_path_constraint_data spine_path_constraint_get_data(spine_path_constraint self);

View File

@ -22,6 +22,9 @@ SPINE_C_API void spine_path_constraint_base_set_active(spine_path_constraint_bas
SPINE_C_API spine_rtti spine_path_constraint_base_get_rtti(spine_path_constraint_base self);
SPINE_C_API void spine_path_constraint_base_sort(spine_path_constraint_base self, spine_skeleton skeleton);
SPINE_C_API bool spine_path_constraint_base_is_source_active(spine_path_constraint_base self);
/**
* Inherited from Update
*/
SPINE_C_API void spine_path_constraint_base_update(spine_path_constraint_base self, spine_skeleton skeleton, spine_physics physics);
SPINE_C_API spine_rtti spine_path_constraint_base_rtti(void);

View File

@ -15,17 +15,38 @@ SPINE_C_API void spine_path_constraint_data_dispose(spine_path_constraint_data s
SPINE_C_API spine_rtti spine_path_constraint_data_get_rtti(spine_path_constraint_data self);
SPINE_C_API spine_constraint spine_path_constraint_data_create_method(spine_path_constraint_data self, spine_skeleton skeleton);
/**
* The bones that will be modified by this path constraint.
*/
SPINE_C_API spine_array_bone_data spine_path_constraint_data_get_bones(spine_path_constraint_data self);
/**
* The slot whose path attachment will be used to constrained the bones.
*/
SPINE_C_API spine_slot_data spine_path_constraint_data_get_slot(spine_path_constraint_data self);
SPINE_C_API void spine_path_constraint_data_set_slot(spine_path_constraint_data self, spine_slot_data slot);
/**
* The mode for positioning the first bone on the path.
*/
SPINE_C_API spine_position_mode spine_path_constraint_data_get_position_mode(spine_path_constraint_data self);
SPINE_C_API void spine_path_constraint_data_set_position_mode(spine_path_constraint_data self, spine_position_mode positionMode);
/**
* The mode for positioning the bones after the first bone on the path.
*/
SPINE_C_API spine_spacing_mode spine_path_constraint_data_get_spacing_mode(spine_path_constraint_data self);
SPINE_C_API void spine_path_constraint_data_set_spacing_mode(spine_path_constraint_data self, spine_spacing_mode spacingMode);
/**
* The mode for adjusting the rotation of the bones.
*/
SPINE_C_API spine_rotate_mode spine_path_constraint_data_get_rotate_mode(spine_path_constraint_data self);
SPINE_C_API void spine_path_constraint_data_set_rotate_mode(spine_path_constraint_data self, spine_rotate_mode rotateMode);
/**
* An offset added to the constrained bone rotation.
*/
SPINE_C_API float spine_path_constraint_data_get_offset_rotation(spine_path_constraint_data self);
SPINE_C_API void spine_path_constraint_data_set_offset_rotation(spine_path_constraint_data self, float offsetRotation);
/**
* Resolve ambiguity by forwarding to PosedData's implementation
*/
SPINE_C_API const char *spine_path_constraint_data_get_name(spine_path_constraint_data self);
SPINE_C_API bool spine_path_constraint_data_get_skin_required(spine_path_constraint_data self);
SPINE_C_API spine_path_constraint_pose spine_path_constraint_data_get_setup_pose(spine_path_constraint_data self);

View File

@ -17,6 +17,12 @@ SPINE_C_API spine_rtti spine_path_constraint_mix_timeline_get_rtti(spine_path_co
SPINE_C_API void spine_path_constraint_mix_timeline_apply(spine_path_constraint_mix_timeline self, spine_skeleton skeleton, float lastTime,
float time, /*@null*/ spine_array_event events, float alpha, spine_mix_blend blend,
spine_mix_direction direction, bool appliedPose);
/**
* Sets the time and color for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_path_constraint_mix_timeline_set_frame(spine_path_constraint_mix_timeline self, int frame, float time, float mixRotate,
float mixX, float mixY);
SPINE_C_API int spine_path_constraint_mix_timeline_get_constraint_index(spine_path_constraint_mix_timeline self);

View File

@ -14,14 +14,32 @@ SPINE_C_API spine_path_constraint_pose spine_path_constraint_pose_create(void);
SPINE_C_API void spine_path_constraint_pose_dispose(spine_path_constraint_pose self);
SPINE_C_API void spine_path_constraint_pose_set(spine_path_constraint_pose self, spine_path_constraint_pose pose);
/**
* The position along the path.
*/
SPINE_C_API float spine_path_constraint_pose_get_position(spine_path_constraint_pose self);
SPINE_C_API void spine_path_constraint_pose_set_position(spine_path_constraint_pose self, float position);
/**
* The spacing between bones.
*/
SPINE_C_API float spine_path_constraint_pose_get_spacing(spine_path_constraint_pose self);
SPINE_C_API void spine_path_constraint_pose_set_spacing(spine_path_constraint_pose self, float spacing);
/**
* A percentage (0-1) that controls the mix between the constrained and
* unconstrained rotation.
*/
SPINE_C_API float spine_path_constraint_pose_get_mix_rotate(spine_path_constraint_pose self);
SPINE_C_API void spine_path_constraint_pose_set_mix_rotate(spine_path_constraint_pose self, float mixRotate);
/**
* A percentage (0-1) that controls the mix between the constrained and
* unconstrained translation X.
*/
SPINE_C_API float spine_path_constraint_pose_get_mix_x(spine_path_constraint_pose self);
SPINE_C_API void spine_path_constraint_pose_set_mix_x(spine_path_constraint_pose self, float mixX);
/**
* A percentage (0-1) that controls the mix between the constrained and
* unconstrained translation Y.
*/
SPINE_C_API float spine_path_constraint_pose_get_mix_y(spine_path_constraint_pose self);
SPINE_C_API void spine_path_constraint_pose_set_mix_y(spine_path_constraint_pose self, float mixY);

View File

@ -20,8 +20,17 @@ SPINE_C_API void spine_path_constraint_position_timeline_apply(spine_path_constr
spine_mix_direction direction, bool appliedPose);
SPINE_C_API int spine_path_constraint_position_timeline_get_constraint_index(spine_path_constraint_position_timeline self);
SPINE_C_API void spine_path_constraint_position_timeline_set_constraint_index(spine_path_constraint_position_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_path_constraint_position_timeline_set_frame(spine_path_constraint_position_timeline self, size_t frame, float time,
float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_path_constraint_position_timeline_get_curve_value(spine_path_constraint_position_timeline self, float time);
SPINE_C_API float spine_path_constraint_position_timeline_get_relative_value(spine_path_constraint_position_timeline self, float time, float alpha,
spine_mix_blend blend, float current, float setup);

View File

@ -20,7 +20,16 @@ SPINE_C_API void spine_path_constraint_spacing_timeline_apply(spine_path_constra
spine_mix_direction direction, bool appliedPose);
SPINE_C_API int spine_path_constraint_spacing_timeline_get_constraint_index(spine_path_constraint_spacing_timeline self);
SPINE_C_API void spine_path_constraint_spacing_timeline_set_constraint_index(spine_path_constraint_spacing_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_path_constraint_spacing_timeline_set_frame(spine_path_constraint_spacing_timeline self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_path_constraint_spacing_timeline_get_curve_value(spine_path_constraint_spacing_timeline self, float time);
SPINE_C_API float spine_path_constraint_spacing_timeline_get_relative_value(spine_path_constraint_spacing_timeline self, float time, float alpha,
spine_mix_blend blend, float current, float setup);

View File

@ -19,8 +19,19 @@ SPINE_C_API void spine_physics_constraint_sort(spine_physics_constraint self, sp
SPINE_C_API bool spine_physics_constraint_is_source_active(spine_physics_constraint self);
SPINE_C_API spine_physics_constraint spine_physics_constraint_copy(spine_physics_constraint self, spine_skeleton skeleton);
SPINE_C_API void spine_physics_constraint_reset(spine_physics_constraint self, spine_skeleton skeleton);
/**
* Translates the physics constraint so next update() forces are applied as if
* the bone moved an additional amount in world space.
*/
SPINE_C_API void spine_physics_constraint_translate(spine_physics_constraint self, float x, float y);
/**
* Rotates the physics constraint so next update() forces are applied as if the
* bone rotated around the specified point in world space.
*/
SPINE_C_API void spine_physics_constraint_rotate(spine_physics_constraint self, float x, float y, float degrees);
/**
* The bone constrained by this physics constraint.
*/
SPINE_C_API spine_bone_pose spine_physics_constraint_get_bone(spine_physics_constraint self);
SPINE_C_API void spine_physics_constraint_set_bone(spine_physics_constraint self, spine_bone_pose bone);
SPINE_C_API spine_physics_constraint_data spine_physics_constraint_get_data(spine_physics_constraint self);

View File

@ -22,6 +22,9 @@ SPINE_C_API void spine_physics_constraint_base_set_active(spine_physics_constrai
SPINE_C_API spine_rtti spine_physics_constraint_base_get_rtti(spine_physics_constraint_base self);
SPINE_C_API void spine_physics_constraint_base_sort(spine_physics_constraint_base self, spine_skeleton skeleton);
SPINE_C_API bool spine_physics_constraint_base_is_source_active(spine_physics_constraint_base self);
/**
* Inherited from Update
*/
SPINE_C_API void spine_physics_constraint_base_update(spine_physics_constraint_base self, spine_skeleton skeleton, spine_physics physics);
SPINE_C_API spine_rtti spine_physics_constraint_base_rtti(void);

View File

@ -20,8 +20,17 @@ SPINE_C_API void spine_physics_constraint_damping_timeline_apply(spine_physics_c
spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
SPINE_C_API int spine_physics_constraint_damping_timeline_get_constraint_index(spine_physics_constraint_damping_timeline self);
SPINE_C_API void spine_physics_constraint_damping_timeline_set_constraint_index(spine_physics_constraint_damping_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_physics_constraint_damping_timeline_set_frame(spine_physics_constraint_damping_timeline self, size_t frame, float time,
float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_physics_constraint_damping_timeline_get_curve_value(spine_physics_constraint_damping_timeline self, float time);
SPINE_C_API float spine_physics_constraint_damping_timeline_get_relative_value(spine_physics_constraint_damping_timeline self, float time,
float alpha, spine_mix_blend blend, float current, float setup);

View File

@ -15,6 +15,9 @@ SPINE_C_API void spine_physics_constraint_data_dispose(spine_physics_constraint_
SPINE_C_API spine_rtti spine_physics_constraint_data_get_rtti(spine_physics_constraint_data self);
SPINE_C_API spine_constraint spine_physics_constraint_data_create_method(spine_physics_constraint_data self, spine_skeleton skeleton);
/**
* The bone constrained by this physics constraint.
*/
SPINE_C_API spine_bone_data spine_physics_constraint_data_get_bone(spine_physics_constraint_data self);
SPINE_C_API void spine_physics_constraint_data_set_bone(spine_physics_constraint_data self, spine_bone_data bone);
SPINE_C_API float spine_physics_constraint_data_get_step(spine_physics_constraint_data self);
@ -45,6 +48,9 @@ SPINE_C_API bool spine_physics_constraint_data_get_gravity_global(spine_physics_
SPINE_C_API void spine_physics_constraint_data_set_gravity_global(spine_physics_constraint_data self, bool gravityGlobal);
SPINE_C_API bool spine_physics_constraint_data_get_mix_global(spine_physics_constraint_data self);
SPINE_C_API void spine_physics_constraint_data_set_mix_global(spine_physics_constraint_data self, bool mixGlobal);
/**
* Resolve ambiguity by forwarding to PosedData's implementation
*/
SPINE_C_API const char *spine_physics_constraint_data_get_name(spine_physics_constraint_data self);
SPINE_C_API bool spine_physics_constraint_data_get_skin_required(spine_physics_constraint_data self);
SPINE_C_API spine_physics_constraint_pose spine_physics_constraint_data_get_setup_pose(spine_physics_constraint_data self);

View File

@ -20,8 +20,17 @@ SPINE_C_API void spine_physics_constraint_gravity_timeline_apply(spine_physics_c
spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
SPINE_C_API int spine_physics_constraint_gravity_timeline_get_constraint_index(spine_physics_constraint_gravity_timeline self);
SPINE_C_API void spine_physics_constraint_gravity_timeline_set_constraint_index(spine_physics_constraint_gravity_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_physics_constraint_gravity_timeline_set_frame(spine_physics_constraint_gravity_timeline self, size_t frame, float time,
float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_physics_constraint_gravity_timeline_get_curve_value(spine_physics_constraint_gravity_timeline self, float time);
SPINE_C_API float spine_physics_constraint_gravity_timeline_get_relative_value(spine_physics_constraint_gravity_timeline self, float time,
float alpha, spine_mix_blend blend, float current, float setup);

View File

@ -20,8 +20,17 @@ SPINE_C_API void spine_physics_constraint_inertia_timeline_apply(spine_physics_c
spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
SPINE_C_API int spine_physics_constraint_inertia_timeline_get_constraint_index(spine_physics_constraint_inertia_timeline self);
SPINE_C_API void spine_physics_constraint_inertia_timeline_set_constraint_index(spine_physics_constraint_inertia_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_physics_constraint_inertia_timeline_set_frame(spine_physics_constraint_inertia_timeline self, size_t frame, float time,
float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_physics_constraint_inertia_timeline_get_curve_value(spine_physics_constraint_inertia_timeline self, float time);
SPINE_C_API float spine_physics_constraint_inertia_timeline_get_relative_value(spine_physics_constraint_inertia_timeline self, float time,
float alpha, spine_mix_blend blend, float current, float setup);

View File

@ -20,7 +20,16 @@ SPINE_C_API void spine_physics_constraint_mass_timeline_apply(spine_physics_cons
spine_mix_direction direction, bool appliedPose);
SPINE_C_API int spine_physics_constraint_mass_timeline_get_constraint_index(spine_physics_constraint_mass_timeline self);
SPINE_C_API void spine_physics_constraint_mass_timeline_set_constraint_index(spine_physics_constraint_mass_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_physics_constraint_mass_timeline_set_frame(spine_physics_constraint_mass_timeline self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_physics_constraint_mass_timeline_get_curve_value(spine_physics_constraint_mass_timeline self, float time);
SPINE_C_API float spine_physics_constraint_mass_timeline_get_relative_value(spine_physics_constraint_mass_timeline self, float time, float alpha,
spine_mix_blend blend, float current, float setup);

View File

@ -20,7 +20,16 @@ SPINE_C_API void spine_physics_constraint_mix_timeline_apply(spine_physics_const
spine_mix_direction direction, bool appliedPose);
SPINE_C_API int spine_physics_constraint_mix_timeline_get_constraint_index(spine_physics_constraint_mix_timeline self);
SPINE_C_API void spine_physics_constraint_mix_timeline_set_constraint_index(spine_physics_constraint_mix_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_physics_constraint_mix_timeline_set_frame(spine_physics_constraint_mix_timeline self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_physics_constraint_mix_timeline_get_curve_value(spine_physics_constraint_mix_timeline self, float time);
SPINE_C_API float spine_physics_constraint_mix_timeline_get_relative_value(spine_physics_constraint_mix_timeline self, float time, float alpha,
spine_mix_blend blend, float current, float setup);

View File

@ -26,6 +26,10 @@ SPINE_C_API float spine_physics_constraint_pose_get_wind(spine_physics_constrain
SPINE_C_API void spine_physics_constraint_pose_set_wind(spine_physics_constraint_pose self, float wind);
SPINE_C_API float spine_physics_constraint_pose_get_gravity(spine_physics_constraint_pose self);
SPINE_C_API void spine_physics_constraint_pose_set_gravity(spine_physics_constraint_pose self, float gravity);
/**
* A percentage (0-1) that controls the mix between the constrained and
* unconstrained poses.
*/
SPINE_C_API float spine_physics_constraint_pose_get_mix(spine_physics_constraint_pose self);
SPINE_C_API void spine_physics_constraint_pose_set_mix(spine_physics_constraint_pose self, float mix);

View File

@ -9,6 +9,10 @@
extern "C" {
#endif
/**
*
* @param constraintIndex -1 for all physics constraints in the skeleton.
*/
SPINE_C_API spine_physics_constraint_reset_timeline spine_physics_constraint_reset_timeline_create(size_t frameCount, int constraintIndex);
SPINE_C_API void spine_physics_constraint_reset_timeline_dispose(spine_physics_constraint_reset_timeline self);
@ -20,6 +24,9 @@ SPINE_C_API void spine_physics_constraint_reset_timeline_apply(spine_physics_con
SPINE_C_API int spine_physics_constraint_reset_timeline_get_frame_count(spine_physics_constraint_reset_timeline self);
SPINE_C_API int spine_physics_constraint_reset_timeline_get_constraint_index(spine_physics_constraint_reset_timeline self);
SPINE_C_API void spine_physics_constraint_reset_timeline_set_constraint_index(spine_physics_constraint_reset_timeline self, int inValue);
/**
* Sets the time for the specified frame.
*/
SPINE_C_API void spine_physics_constraint_reset_timeline_set_frame(spine_physics_constraint_reset_timeline self, int frame, float time);
SPINE_C_API size_t spine_physics_constraint_reset_timeline_get_frame_entries(spine_physics_constraint_reset_timeline self);
SPINE_C_API spine_array_float spine_physics_constraint_reset_timeline_get_frames(spine_physics_constraint_reset_timeline self);

View File

@ -20,8 +20,17 @@ SPINE_C_API void spine_physics_constraint_strength_timeline_apply(spine_physics_
spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
SPINE_C_API int spine_physics_constraint_strength_timeline_get_constraint_index(spine_physics_constraint_strength_timeline self);
SPINE_C_API void spine_physics_constraint_strength_timeline_set_constraint_index(spine_physics_constraint_strength_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_physics_constraint_strength_timeline_set_frame(spine_physics_constraint_strength_timeline self, size_t frame, float time,
float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_physics_constraint_strength_timeline_get_curve_value(spine_physics_constraint_strength_timeline self, float time);
SPINE_C_API float spine_physics_constraint_strength_timeline_get_relative_value(spine_physics_constraint_strength_timeline self, float time,
float alpha, spine_mix_blend blend, float current, float setup);

View File

@ -17,7 +17,16 @@ SPINE_C_API void spine_physics_constraint_timeline_apply(spine_physics_constrain
spine_mix_direction direction, bool appliedPose);
SPINE_C_API int spine_physics_constraint_timeline_get_constraint_index(spine_physics_constraint_timeline self);
SPINE_C_API void spine_physics_constraint_timeline_set_constraint_index(spine_physics_constraint_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_physics_constraint_timeline_set_frame(spine_physics_constraint_timeline self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_physics_constraint_timeline_get_curve_value(spine_physics_constraint_timeline self, float time);
SPINE_C_API float spine_physics_constraint_timeline_get_relative_value(spine_physics_constraint_timeline self, float time, float alpha,
spine_mix_blend blend, float current, float setup);

View File

@ -20,7 +20,16 @@ SPINE_C_API void spine_physics_constraint_wind_timeline_apply(spine_physics_cons
spine_mix_direction direction, bool appliedPose);
SPINE_C_API int spine_physics_constraint_wind_timeline_get_constraint_index(spine_physics_constraint_wind_timeline self);
SPINE_C_API void spine_physics_constraint_wind_timeline_set_constraint_index(spine_physics_constraint_wind_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_physics_constraint_wind_timeline_set_frame(spine_physics_constraint_wind_timeline self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_physics_constraint_wind_timeline_get_curve_value(spine_physics_constraint_wind_timeline self, float time);
SPINE_C_API float spine_physics_constraint_wind_timeline_get_relative_value(spine_physics_constraint_wind_timeline self, float time, float alpha,
spine_mix_blend blend, float current, float setup);

View File

@ -13,7 +13,17 @@ SPINE_C_API spine_posed_data spine_posed_data_create(const char *name);
SPINE_C_API void spine_posed_data_dispose(spine_posed_data self);
/**
* The constraint's name, which is unique across all constraints in the skeleton
* of the same type.
*/
SPINE_C_API const char *spine_posed_data_get_name(spine_posed_data self);
/**
* When true, Skeleton::updateWorldTransform(Physics) only updates this
* constraint if the Skeleton::getSkin() contains this constraint.
*
* See Skin::getConstraints().
*/
SPINE_C_API bool spine_posed_data_get_skin_required(spine_posed_data self);
SPINE_C_API void spine_posed_data_set_skin_required(spine_posed_data self, bool skinRequired);

View File

@ -15,6 +15,14 @@ SPINE_C_API void spine_region_attachment_dispose(spine_region_attachment self);
SPINE_C_API spine_rtti spine_region_attachment_get_rtti(spine_region_attachment self);
SPINE_C_API void spine_region_attachment_update_region(spine_region_attachment self);
/**
* Transforms the attachment's four vertices to world coordinates.
*
* @param slot The parent slot.
* @param worldVertices The output world vertices. Must have a length greater than or equal to offset + 8.
* @param offset The worldVertices index to begin writing values.
* @param stride The number of worldVertices entries between the value pairs written.
*/
SPINE_C_API void spine_region_attachment_compute_world_vertices_1(spine_region_attachment self, spine_slot slot, /*@null*/ float *worldVertices,
size_t offset, size_t stride);
SPINE_C_API void spine_region_attachment_compute_world_vertices_2(spine_region_attachment self, spine_slot slot, spine_array_float worldVertices,

View File

@ -14,6 +14,12 @@ SPINE_C_API spine_rgb2_timeline spine_rgb2_timeline_create(size_t frameCount, si
SPINE_C_API void spine_rgb2_timeline_dispose(spine_rgb2_timeline self);
SPINE_C_API spine_rtti spine_rgb2_timeline_get_rtti(spine_rgb2_timeline self);
/**
* Sets the time, light color, and dark color for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_rgb2_timeline_set_frame(spine_rgb2_timeline self, int frame, float time, float r, float g, float b, float r2, float g2,
float b2);
SPINE_C_API void spine_rgb2_timeline_apply(spine_rgb2_timeline self, spine_skeleton skeleton, float lastTime, float time,

View File

@ -14,6 +14,12 @@ SPINE_C_API spine_rgb_timeline spine_rgb_timeline_create(size_t frameCount, size
SPINE_C_API void spine_rgb_timeline_dispose(spine_rgb_timeline self);
SPINE_C_API spine_rtti spine_rgb_timeline_get_rtti(spine_rgb_timeline self);
/**
* Sets the time and color for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_rgb_timeline_set_frame(spine_rgb_timeline self, int frame, float time, float r, float g, float b);
SPINE_C_API void spine_rgb_timeline_apply(spine_rgb_timeline self, spine_skeleton skeleton, float lastTime, float time,
/*@null*/ spine_array_event events, float alpha, spine_mix_blend blend, spine_mix_direction direction,

View File

@ -14,6 +14,12 @@ SPINE_C_API spine_rgba2_timeline spine_rgba2_timeline_create(size_t frameCount,
SPINE_C_API void spine_rgba2_timeline_dispose(spine_rgba2_timeline self);
SPINE_C_API spine_rtti spine_rgba2_timeline_get_rtti(spine_rgba2_timeline self);
/**
* Sets the time, light color, and dark color for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_rgba2_timeline_set_frame(spine_rgba2_timeline self, int frame, float time, float r, float g, float b, float a, float r2,
float g2, float b2);
SPINE_C_API void spine_rgba2_timeline_apply(spine_rgba2_timeline self, spine_skeleton skeleton, float lastTime, float time,

View File

@ -14,6 +14,12 @@ SPINE_C_API spine_rgba_timeline spine_rgba_timeline_create(size_t frameCount, si
SPINE_C_API void spine_rgba_timeline_dispose(spine_rgba_timeline self);
SPINE_C_API spine_rtti spine_rgba_timeline_get_rtti(spine_rgba_timeline self);
/**
* Sets the time and color for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_rgba_timeline_set_frame(spine_rgba_timeline self, int frame, float time, float r, float g, float b, float a);
SPINE_C_API void spine_rgba_timeline_apply(spine_rgba_timeline self, spine_skeleton skeleton, float lastTime, float time,
/*@null*/ spine_array_event events, float alpha, spine_mix_blend blend, spine_mix_direction direction,

View File

@ -19,7 +19,16 @@ SPINE_C_API void spine_rotate_timeline_apply(spine_rotate_timeline self, spine_s
bool appliedPose);
SPINE_C_API int spine_rotate_timeline_get_bone_index(spine_rotate_timeline self);
SPINE_C_API void spine_rotate_timeline_set_bone_index(spine_rotate_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_rotate_timeline_set_frame(spine_rotate_timeline self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_rotate_timeline_get_curve_value(spine_rotate_timeline self, float time);
SPINE_C_API float spine_rotate_timeline_get_relative_value(spine_rotate_timeline self, float time, float alpha, spine_mix_blend blend, float current,
float setup);

View File

@ -19,7 +19,16 @@ SPINE_C_API void spine_scale_x_timeline_apply(spine_scale_x_timeline self, spine
bool appliedPose);
SPINE_C_API int spine_scale_x_timeline_get_bone_index(spine_scale_x_timeline self);
SPINE_C_API void spine_scale_x_timeline_set_bone_index(spine_scale_x_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_scale_x_timeline_set_frame(spine_scale_x_timeline self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_scale_x_timeline_get_curve_value(spine_scale_x_timeline self, float time);
SPINE_C_API float spine_scale_x_timeline_get_relative_value(spine_scale_x_timeline self, float time, float alpha, spine_mix_blend blend,
float current, float setup);

View File

@ -19,7 +19,16 @@ SPINE_C_API void spine_scale_y_timeline_apply(spine_scale_y_timeline self, spine
bool appliedPose);
SPINE_C_API int spine_scale_y_timeline_get_bone_index(spine_scale_y_timeline self);
SPINE_C_API void spine_scale_y_timeline_set_bone_index(spine_scale_y_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_scale_y_timeline_set_frame(spine_scale_y_timeline self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_scale_y_timeline_get_curve_value(spine_scale_y_timeline self, float time);
SPINE_C_API float spine_scale_y_timeline_get_relative_value(spine_scale_y_timeline self, float time, float alpha, spine_mix_blend blend,
float current, float setup);

View File

@ -16,12 +16,18 @@ SPINE_C_API void spine_sequence_dispose(spine_sequence self);
SPINE_C_API spine_sequence spine_sequence_copy(spine_sequence self);
SPINE_C_API void spine_sequence_apply(spine_sequence self, /*@null*/ spine_slot_pose slot, /*@null*/ spine_attachment attachment);
SPINE_C_API const char *spine_sequence_get_path(spine_sequence self, const char *basePath, int index);
/**
* Returns a unique ID for this attachment.
*/
SPINE_C_API int spine_sequence_get_id(spine_sequence self);
SPINE_C_API void spine_sequence_set_id(spine_sequence self, int id);
SPINE_C_API int spine_sequence_get_start(spine_sequence self);
SPINE_C_API void spine_sequence_set_start(spine_sequence self, int start);
SPINE_C_API int spine_sequence_get_digits(spine_sequence self);
SPINE_C_API void spine_sequence_set_digits(spine_sequence self, int digits);
/**
* The index of the region to show for the setup pose.
*/
SPINE_C_API int spine_sequence_get_setup_index(spine_sequence self);
SPINE_C_API void spine_sequence_set_setup_index(spine_sequence self, int setupIndex);
SPINE_C_API spine_array_texture_region spine_sequence_get_regions(spine_sequence self);

View File

@ -17,6 +17,12 @@ SPINE_C_API spine_rtti spine_sequence_timeline_get_rtti(spine_sequence_timeline
SPINE_C_API void spine_sequence_timeline_apply(spine_sequence_timeline self, spine_skeleton skeleton, float lastTime, float time,
/*@null*/ spine_array_event events, float alpha, spine_mix_blend blend, spine_mix_direction direction,
bool appliedPose);
/**
* Sets the time, mode, index, and frame time for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param delay Seconds between frames.
*/
SPINE_C_API void spine_sequence_timeline_set_frame(spine_sequence_timeline self, int frame, float time, spine_sequence_mode mode, int index,
float delay);
SPINE_C_API spine_attachment spine_sequence_timeline_get_attachment(spine_sequence_timeline self);

View File

@ -19,7 +19,16 @@ SPINE_C_API void spine_shear_x_timeline_apply(spine_shear_x_timeline self, spine
bool appliedPose);
SPINE_C_API int spine_shear_x_timeline_get_bone_index(spine_shear_x_timeline self);
SPINE_C_API void spine_shear_x_timeline_set_bone_index(spine_shear_x_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_shear_x_timeline_set_frame(spine_shear_x_timeline self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_shear_x_timeline_get_curve_value(spine_shear_x_timeline self, float time);
SPINE_C_API float spine_shear_x_timeline_get_relative_value(spine_shear_x_timeline self, float time, float alpha, spine_mix_blend blend,
float current, float setup);

View File

@ -19,7 +19,16 @@ SPINE_C_API void spine_shear_y_timeline_apply(spine_shear_y_timeline self, spine
bool appliedPose);
SPINE_C_API int spine_shear_y_timeline_get_bone_index(spine_shear_y_timeline self);
SPINE_C_API void spine_shear_y_timeline_set_bone_index(spine_shear_y_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_shear_y_timeline_set_frame(spine_shear_y_timeline self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_shear_y_timeline_get_curve_value(spine_shear_y_timeline self, float time);
SPINE_C_API float spine_shear_y_timeline_get_relative_value(spine_shear_y_timeline self, float time, float alpha, spine_mix_blend blend,
float current, float setup);

View File

@ -13,32 +13,104 @@ SPINE_C_API spine_skeleton spine_skeleton_create(spine_skeleton_data skeletonDat
SPINE_C_API void spine_skeleton_dispose(spine_skeleton self);
/**
* Caches information about bones and constraints. Must be called if bones,
* constraints or weighted path attachments are added or removed.
*/
SPINE_C_API void spine_skeleton_update_cache(spine_skeleton self);
SPINE_C_API void spine_skeleton_print_update_cache(spine_skeleton self);
SPINE_C_API void spine_skeleton_constrained(spine_skeleton self, spine_posed object);
SPINE_C_API void spine_skeleton_sort_bone(spine_skeleton self, /*@null*/ spine_bone bone);
SPINE_C_API void spine_skeleton_sort_reset(spine_array_bone bones);
/**
* Updates the world transform for each bone and applies all constraints.
*
* See [World
* transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms)
* in the Spine Runtimes Guide.
*/
SPINE_C_API void spine_skeleton_update_world_transform(spine_skeleton self, spine_physics physics);
/**
* Sets the bones, constraints, and slots to their setup pose values.
*/
SPINE_C_API void spine_skeleton_setup_pose(spine_skeleton self);
/**
* Sets the bones and constraints to their setup pose values.
*/
SPINE_C_API void spine_skeleton_setup_pose_bones(spine_skeleton self);
SPINE_C_API void spine_skeleton_setup_pose_slots(spine_skeleton self);
SPINE_C_API spine_skeleton_data spine_skeleton_get_data(spine_skeleton self);
SPINE_C_API spine_array_bone spine_skeleton_get_bones(spine_skeleton self);
SPINE_C_API spine_array_update spine_skeleton_get_update_cache(spine_skeleton self);
SPINE_C_API /*@null*/ spine_bone spine_skeleton_get_root_bone(spine_skeleton self);
/**
*
* @return May be NULL.
*/
SPINE_C_API /*@null*/ spine_bone spine_skeleton_find_bone(spine_skeleton self, const char *boneName);
SPINE_C_API spine_array_slot spine_skeleton_get_slots(spine_skeleton self);
/**
*
* @return May be NULL.
*/
SPINE_C_API /*@null*/ spine_slot spine_skeleton_find_slot(spine_skeleton self, const char *slotName);
SPINE_C_API spine_array_slot spine_skeleton_get_draw_order(spine_skeleton self);
SPINE_C_API /*@null*/ spine_skin spine_skeleton_get_skin(spine_skeleton self);
/**
* Sets a skin by name (see setSkin).
*/
SPINE_C_API void spine_skeleton_set_skin_1(spine_skeleton self, const char *skinName);
/**
* Attachments from the new skin are attached if the corresponding attachment
* from the old skin was attached. If there was no old skin, each slot's setup
* mode attachment is attached from the new skin. After changing the skin, the
* visible attachments can be reset to those attached in the setup pose by
* calling See Skeleton::setSlotsToSetupPose() Also, often
* AnimationState::apply(Skeleton & ) is called before the next time the
* skeleton is rendered to allow any attachment keys in the current animation(s)
* to hide or show attachments from the new skin.
*
* @param newSkin May be NULL.
*/
SPINE_C_API void spine_skeleton_set_skin_2(spine_skeleton self, /*@null*/ spine_skin newSkin);
/**
*
* @return May be NULL.
*/
SPINE_C_API /*@null*/ spine_attachment spine_skeleton_get_attachment_1(spine_skeleton self, const char *slotName, const char *attachmentName);
/**
*
* @return May be NULL.
*/
SPINE_C_API /*@null*/ spine_attachment spine_skeleton_get_attachment_2(spine_skeleton self, int slotIndex, const char *attachmentName);
/**
*
* @param attachmentName May be empty.
*/
SPINE_C_API void spine_skeleton_set_attachment(spine_skeleton self, const char *slotName, const char *attachmentName);
SPINE_C_API spine_array_constraint spine_skeleton_get_constraints(spine_skeleton self);
SPINE_C_API spine_array_physics_constraint spine_skeleton_get_physics_constraints(spine_skeleton self);
/**
* Returns the axis aligned bounding box (AABB) of the region and mesh
* attachments for the current pose.
*
* @param outX The horizontal distance between the skeleton origin and the left side of the AABB.
* @param outY The vertical distance between the skeleton origin and the bottom side of the AABB.
* @param outWidth The width of the AABB
* @param outHeight The height of the AABB.
*/
SPINE_C_API void spine_skeleton_get_bounds_1(spine_skeleton self, float *outX, float *outY, float *outWidth, float *outHeight);
/**
* Returns the axis aligned bounding box (AABB) of the region and mesh
* attachments for the current pose.
*
* @param outX The horizontal distance between the skeleton origin and the left side of the AABB.
* @param outY The vertical distance between the skeleton origin and the bottom side of the AABB.
* @param outWidth The width of the AABB
* @param outHeight The height of the AABB.
* @param outVertexBuffer Reference to hold an array of floats. This method will assign it with new floats as needed.
* @param clipping Pointer to a SkeletonClipping instance or NULL. If a clipper is given, clipping attachments will be taken into account.
*/
SPINE_C_API void spine_skeleton_get_bounds_2(spine_skeleton self, float *outX, float *outY, float *outWidth, float *outHeight,
spine_array_float outVertexBuffer, /*@null*/ spine_skeleton_clipping clipping);
SPINE_C_API spine_color spine_skeleton_get_color(spine_skeleton self);
@ -63,7 +135,13 @@ SPINE_C_API float spine_skeleton_get_gravity_x(spine_skeleton self);
SPINE_C_API void spine_skeleton_set_gravity_x(spine_skeleton self, float gravityX);
SPINE_C_API float spine_skeleton_get_gravity_y(spine_skeleton self);
SPINE_C_API void spine_skeleton_set_gravity_y(spine_skeleton self, float gravityY);
/**
* Rotates the physics constraint so next {
*/
SPINE_C_API void spine_skeleton_physics_translate(spine_skeleton self, float x, float y);
/**
* Calls {
*/
SPINE_C_API void spine_skeleton_physics_rotate(spine_skeleton self, float x, float y, float degrees);
SPINE_C_API float spine_skeleton_get_time(spine_skeleton self);
SPINE_C_API void spine_skeleton_set_time(spine_skeleton self, float time);

View File

@ -13,26 +13,92 @@ SPINE_C_API spine_skeleton_bounds spine_skeleton_bounds_create(void);
SPINE_C_API void spine_skeleton_bounds_dispose(spine_skeleton_bounds self);
/**
* Clears any previous polygons, finds all visible bounding box attachments, and
* computes the world vertices for each bounding box's polygon.
*
* @param skeleton The skeleton.
* @param updateAabb If true, the axis aligned bounding box containing all the polygons is computed. If false, the SkeletonBounds AABB methods will always return true.
*/
SPINE_C_API void spine_skeleton_bounds_update(spine_skeleton_bounds self, spine_skeleton skeleton, bool updateAabb);
/**
* Returns true if the axis aligned bounding box contains the point.
*/
SPINE_C_API bool spine_skeleton_bounds_aabb_contains_point(spine_skeleton_bounds self, float x, float y);
/**
* Returns true if the axis aligned bounding box intersects the line segment.
*/
SPINE_C_API bool spine_skeleton_bounds_aabb_intersects_segment(spine_skeleton_bounds self, float x1, float y1, float x2, float y2);
/**
* Returns true if the axis aligned bounding box intersects the axis aligned
* bounding box of the specified bounds.
*/
SPINE_C_API bool spine_skeleton_bounds_aabb_intersects_skeleton(spine_skeleton_bounds self, spine_skeleton_bounds bounds);
/**
* Returns true if the polygon contains the point.
*/
SPINE_C_API bool spine_skeleton_bounds_contains_point_1(spine_skeleton_bounds self, spine_polygon polygon, float x, float y);
/**
* Returns the first bounding box attachment that contains the point, or null.
* When doing many checks, it is usually more efficient to only call this method
* if aabbContainsPoint(float, float) returns true.
*/
SPINE_C_API /*@null*/ spine_bounding_box_attachment spine_skeleton_bounds_contains_point_2(spine_skeleton_bounds self, float x, float y);
/**
* Returns the first bounding box attachment that contains any part of the line
* segment, or null. When doing many checks, it is usually more efficient to
* only call this method if aabbIntersectsSegment(float, float, float, float)
* returns true.
*/
SPINE_C_API /*@null*/ spine_bounding_box_attachment spine_skeleton_bounds_intersects_segment_1(spine_skeleton_bounds self, float x1, float y1,
float x2, float y2);
/**
* Returns true if the polygon contains any part of the line segment.
*/
SPINE_C_API bool spine_skeleton_bounds_intersects_segment_2(spine_skeleton_bounds self, spine_polygon polygon, float x1, float y1, float x2,
float y2);
/**
* Returns the polygon for the given bounding box attachment or null if no
* polygon can be found for the attachment. Requires a call to update() first.
*/
SPINE_C_API /*@null*/ spine_polygon spine_skeleton_bounds_get_polygon(spine_skeleton_bounds self, /*@null*/ spine_bounding_box_attachment attachment);
/**
* Returns the bounding box for the given polygon or null. Requires a call to
* update() first.
*/
SPINE_C_API /*@null*/ spine_bounding_box_attachment spine_skeleton_bounds_get_bounding_box(spine_skeleton_bounds self,
/*@null*/ spine_polygon polygon);
/**
* Returns all polygons or an empty array. Requires a call to update() first.
*/
SPINE_C_API spine_array_polygon spine_skeleton_bounds_get_polygons(spine_skeleton_bounds self);
/**
* Returns all bounding boxes. Requires a call to update() first.
*/
SPINE_C_API spine_array_bounding_box_attachment spine_skeleton_bounds_get_bounding_boxes(spine_skeleton_bounds self);
/**
* The left edge of the axis aligned bounding box.
*/
SPINE_C_API float spine_skeleton_bounds_get_min_x(spine_skeleton_bounds self);
/**
* The bottom edge of the axis aligned bounding box.
*/
SPINE_C_API float spine_skeleton_bounds_get_min_y(spine_skeleton_bounds self);
/**
* The right edge of the axis aligned bounding box.
*/
SPINE_C_API float spine_skeleton_bounds_get_max_x(spine_skeleton_bounds self);
/**
* The top edge of the axis aligned bounding box.
*/
SPINE_C_API float spine_skeleton_bounds_get_max_y(spine_skeleton_bounds self);
/**
* The width of the axis aligned bounding box.
*/
SPINE_C_API float spine_skeleton_bounds_get_width(spine_skeleton_bounds self);
/**
* The height of the axis aligned bounding box.
*/
SPINE_C_API float spine_skeleton_bounds_get_height(spine_skeleton_bounds self);
#ifdef __cplusplus

View File

@ -13,39 +13,127 @@ SPINE_C_API spine_skeleton_data spine_skeleton_data_create(void);
SPINE_C_API void spine_skeleton_data_dispose(spine_skeleton_data self);
/**
* Finds a bone by comparing each bone's name. It is more efficient to cache the
* results of this method than to call it multiple times.
*
* @return May be NULL.
*/
SPINE_C_API /*@null*/ spine_bone_data spine_skeleton_data_find_bone(spine_skeleton_data self, const char *boneName);
/**
*
* @return May be NULL.
*/
SPINE_C_API /*@null*/ spine_slot_data spine_skeleton_data_find_slot(spine_skeleton_data self, const char *slotName);
/**
*
* @return May be NULL.
*/
SPINE_C_API /*@null*/ spine_skin spine_skeleton_data_find_skin(spine_skeleton_data self, const char *skinName);
/**
*
* @return May be NULL.
*/
SPINE_C_API /*@null*/ spine_event_data spine_skeleton_data_find_event(spine_skeleton_data self, const char *eventDataName);
/**
*
* @return May be NULL.
*/
SPINE_C_API /*@null*/ spine_animation spine_skeleton_data_find_animation(spine_skeleton_data self, const char *animationName);
/**
* The skeleton's name, which by default is the name of the skeleton data file
* when possible, or null when a name hasn't been set.
*/
SPINE_C_API const char *spine_skeleton_data_get_name(spine_skeleton_data self);
SPINE_C_API void spine_skeleton_data_set_name(spine_skeleton_data self, const char *inValue);
/**
* The skeleton's bones, sorted parent first. The root bone is always the first
* bone.
*/
SPINE_C_API spine_array_bone_data spine_skeleton_data_get_bones(spine_skeleton_data self);
/**
* The skeleton's slots in the setup pose draw order.
*/
SPINE_C_API spine_array_slot_data spine_skeleton_data_get_slots(spine_skeleton_data self);
/**
* All skins, including the default skin.
*/
SPINE_C_API spine_array_skin spine_skeleton_data_get_skins(spine_skeleton_data self);
/**
* The skeleton's default skin. By default this skin contains all attachments
* that were not in a skin in Spine.
*
* @return May be NULL.
*/
SPINE_C_API /*@null*/ spine_skin spine_skeleton_data_get_default_skin(spine_skeleton_data self);
SPINE_C_API void spine_skeleton_data_set_default_skin(spine_skeleton_data self, /*@null*/ spine_skin inValue);
/**
* The skeleton's events.
*/
SPINE_C_API spine_array_event_data spine_skeleton_data_get_events(spine_skeleton_data self);
/**
* The skeleton's animations.
*/
SPINE_C_API spine_array_animation spine_skeleton_data_get_animations(spine_skeleton_data self);
/**
* The skeleton's constraints.
*/
SPINE_C_API spine_array_constraint_data spine_skeleton_data_get_constraints(spine_skeleton_data self);
/**
* The X coordinate of the skeleton's axis aligned bounding box in the setup
* pose.
*/
SPINE_C_API float spine_skeleton_data_get_x(spine_skeleton_data self);
SPINE_C_API void spine_skeleton_data_set_x(spine_skeleton_data self, float inValue);
/**
* The Y coordinate of the skeleton's axis aligned bounding box in the setup
* pose.
*/
SPINE_C_API float spine_skeleton_data_get_y(spine_skeleton_data self);
SPINE_C_API void spine_skeleton_data_set_y(spine_skeleton_data self, float inValue);
/**
* The width of the skeleton's axis aligned bounding box in the setup pose.
*/
SPINE_C_API float spine_skeleton_data_get_width(spine_skeleton_data self);
SPINE_C_API void spine_skeleton_data_set_width(spine_skeleton_data self, float inValue);
/**
* The height of the skeleton's axis aligned bounding box in the setup pose.
*/
SPINE_C_API float spine_skeleton_data_get_height(spine_skeleton_data self);
SPINE_C_API void spine_skeleton_data_set_height(spine_skeleton_data self, float inValue);
/**
* Baseline scale factor for applying physics and other effects based on
* distance to non-scalable properties, such as angle or scale. Default is 100.
*/
SPINE_C_API float spine_skeleton_data_get_reference_scale(spine_skeleton_data self);
SPINE_C_API void spine_skeleton_data_set_reference_scale(spine_skeleton_data self, float inValue);
/**
* The Spine version used to export this data, or NULL.
*/
SPINE_C_API const char *spine_skeleton_data_get_version(spine_skeleton_data self);
SPINE_C_API void spine_skeleton_data_set_version(spine_skeleton_data self, const char *inValue);
/**
* The skeleton data hash. This value will change if any of the skeleton data
* has changed.
*/
SPINE_C_API const char *spine_skeleton_data_get_hash(spine_skeleton_data self);
SPINE_C_API void spine_skeleton_data_set_hash(spine_skeleton_data self, const char *inValue);
/**
* The path to the images directory as defined in Spine, or null if nonessential
* data was not exported.
*/
SPINE_C_API const char *spine_skeleton_data_get_images_path(spine_skeleton_data self);
SPINE_C_API void spine_skeleton_data_set_images_path(spine_skeleton_data self, const char *inValue);
/**
* The path to the audio directory as defined in Spine, or null if nonessential
* data was not exported.
*/
SPINE_C_API const char *spine_skeleton_data_get_audio_path(spine_skeleton_data self);
SPINE_C_API void spine_skeleton_data_set_audio_path(spine_skeleton_data self, const char *inValue);
/**
* The dopesheet FPS in Spine. Available only when nonessential data was
* exported.
*/
SPINE_C_API float spine_skeleton_data_get_fps(spine_skeleton_data self);
SPINE_C_API void spine_skeleton_data_set_fps(spine_skeleton_data self, float inValue);

View File

@ -13,12 +13,37 @@ SPINE_C_API spine_skin spine_skin_create(const char *name);
SPINE_C_API void spine_skin_dispose(spine_skin self);
/**
* Adds an attachment to the skin for the specified slot index and name. If the
* name already exists for the slot, the previous value is replaced.
*/
SPINE_C_API void spine_skin_set_attachment(spine_skin self, size_t slotIndex, const char *name, spine_attachment attachment);
/**
* Returns the attachment for the specified slot index and name, or NULL.
*/
SPINE_C_API /*@null*/ spine_attachment spine_skin_get_attachment(spine_skin self, size_t slotIndex, const char *name);
/**
* Removes the attachment from the skin.
*/
SPINE_C_API void spine_skin_remove_attachment(spine_skin self, size_t slotIndex, const char *name);
/**
* Finds the attachments for a given slot. The results are added to the passed
* array of Attachments.
*
* @param slotIndex The target slotIndex. To find the slot index, use SkeletonData::findSlot and SlotData::getIndex.
* @param attachments Found Attachments will be added to this array.
*/
SPINE_C_API void spine_skin_find_attachments_for_slot(spine_skin self, size_t slotIndex, spine_array_attachment attachments);
SPINE_C_API const char *spine_skin_get_name(spine_skin self);
/**
* Adds all attachments, bones, and constraints from the specified skin to this
* skin.
*/
SPINE_C_API void spine_skin_add_skin(spine_skin self, spine_skin other);
/**
* Adds all attachments, bones, and constraints from the specified skin to this
* skin. Attachments are deep copied.
*/
SPINE_C_API void spine_skin_copy_skin(spine_skin self, spine_skin other);
SPINE_C_API spine_array_bone_data spine_skin_get_bones(spine_skin self);
SPINE_C_API spine_array_constraint_data spine_skin_get_constraints(spine_skin self);

View File

@ -22,6 +22,9 @@ SPINE_C_API void spine_slider_base_set_active(spine_slider_base self, bool activ
SPINE_C_API spine_rtti spine_slider_base_get_rtti(spine_slider_base self);
SPINE_C_API void spine_slider_base_sort(spine_slider_base self, spine_skeleton skeleton);
SPINE_C_API bool spine_slider_base_is_source_active(spine_slider_base self);
/**
* Inherited from Update
*/
SPINE_C_API void spine_slider_base_update(spine_slider_base self, spine_skeleton skeleton, spine_physics physics);
SPINE_C_API spine_rtti spine_slider_base_rtti(void);

View File

@ -14,6 +14,9 @@ SPINE_C_API spine_slider_data spine_slider_data_create(const char *name);
SPINE_C_API void spine_slider_data_dispose(spine_slider_data self);
SPINE_C_API spine_rtti spine_slider_data_get_rtti(spine_slider_data self);
/**
* Creates a slider instance.
*/
SPINE_C_API spine_constraint spine_slider_data_create_method(spine_slider_data self, spine_skeleton skeleton);
SPINE_C_API spine_animation spine_slider_data_get_animation(spine_slider_data self);
SPINE_C_API void spine_slider_data_set_animation(spine_slider_data self, spine_animation animation);
@ -31,6 +34,9 @@ SPINE_C_API float spine_slider_data_get_offset(spine_slider_data self);
SPINE_C_API void spine_slider_data_set_offset(spine_slider_data self, float offset);
SPINE_C_API bool spine_slider_data_get_local(spine_slider_data self);
SPINE_C_API void spine_slider_data_set_local(spine_slider_data self, bool local);
/**
* Resolve ambiguity by forwarding to PosedData's implementation
*/
SPINE_C_API const char *spine_slider_data_get_name(spine_slider_data self);
SPINE_C_API bool spine_slider_data_get_skin_required(spine_slider_data self);
SPINE_C_API spine_slider_pose spine_slider_data_get_setup_pose(spine_slider_data self);

View File

@ -19,7 +19,16 @@ SPINE_C_API void spine_slider_mix_timeline_apply(spine_slider_mix_timeline self,
spine_mix_direction direction, bool appliedPose);
SPINE_C_API int spine_slider_mix_timeline_get_constraint_index(spine_slider_mix_timeline self);
SPINE_C_API void spine_slider_mix_timeline_set_constraint_index(spine_slider_mix_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_slider_mix_timeline_set_frame(spine_slider_mix_timeline self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_slider_mix_timeline_get_curve_value(spine_slider_mix_timeline self, float time);
SPINE_C_API float spine_slider_mix_timeline_get_relative_value(spine_slider_mix_timeline self, float time, float alpha, spine_mix_blend blend,
float current, float setup);

View File

@ -19,7 +19,16 @@ SPINE_C_API void spine_slider_timeline_apply(spine_slider_timeline self, spine_s
bool appliedPose);
SPINE_C_API int spine_slider_timeline_get_constraint_index(spine_slider_timeline self);
SPINE_C_API void spine_slider_timeline_set_constraint_index(spine_slider_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_slider_timeline_set_frame(spine_slider_timeline self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_slider_timeline_get_curve_value(spine_slider_timeline self, float time);
SPINE_C_API float spine_slider_timeline_get_relative_value(spine_slider_timeline self, float time, float alpha, spine_mix_blend blend, float current,
float setup);

View File

@ -13,8 +13,14 @@ SPINE_C_API spine_slot spine_slot_create(spine_slot_data data, spine_skeleton sk
SPINE_C_API void spine_slot_dispose(spine_slot self);
/**
* The bone this slot belongs to.
*/
SPINE_C_API spine_bone spine_slot_get_bone(spine_slot self);
SPINE_C_API void spine_slot_setup_pose(spine_slot self);
/**
* The constraint's setup pose data.
*/
SPINE_C_API spine_slot_data spine_slot_get_data(spine_slot self);
SPINE_C_API spine_slot_pose spine_slot_get_pose(spine_slot self);
SPINE_C_API spine_slot_pose spine_slot_get_applied_pose(spine_slot self);

View File

@ -13,16 +13,43 @@ SPINE_C_API spine_slot_data spine_slot_data_create(int index, const char *name,
SPINE_C_API void spine_slot_data_dispose(spine_slot_data self);
/**
* The index of the slot in Skeleton::getSlots().
*/
SPINE_C_API int spine_slot_data_get_index(spine_slot_data self);
/**
* The bone this slot belongs to.
*/
SPINE_C_API spine_bone_data spine_slot_data_get_bone_data(spine_slot_data self);
SPINE_C_API void spine_slot_data_set_attachment_name(spine_slot_data self, const char *attachmentName);
/**
* The name of the attachment that is visible for this slot in the setup pose,
* or empty if no attachment is visible.
*/
SPINE_C_API const char *spine_slot_data_get_attachment_name(spine_slot_data self);
/**
* The blend mode for drawing the slot's attachment.
*/
SPINE_C_API spine_blend_mode spine_slot_data_get_blend_mode(spine_slot_data self);
SPINE_C_API void spine_slot_data_set_blend_mode(spine_slot_data self, spine_blend_mode blendMode);
/**
* False if the slot was hidden in Spine and nonessential data was exported.
* Does not affect runtime rendering.
*/
SPINE_C_API bool spine_slot_data_get_visible(spine_slot_data self);
SPINE_C_API void spine_slot_data_set_visible(spine_slot_data self, bool visible);
SPINE_C_API spine_slot_pose spine_slot_data_get_setup_pose(spine_slot_data self);
/**
* The constraint's name, which is unique across all constraints in the skeleton
* of the same type.
*/
SPINE_C_API const char *spine_slot_data_get_name(spine_slot_data self);
/**
* When true, Skeleton::updateWorldTransform(Physics) only updates this
* constraint if the Skeleton::getSkin() contains this constraint.
*
* See Skin::getConstraints().
*/
SPINE_C_API bool spine_slot_data_get_skin_required(spine_slot_data self);
SPINE_C_API void spine_slot_data_set_skin_required(spine_slot_data self, bool skinRequired);

View File

@ -14,14 +14,46 @@ SPINE_C_API spine_slot_pose spine_slot_pose_create(void);
SPINE_C_API void spine_slot_pose_dispose(spine_slot_pose self);
SPINE_C_API void spine_slot_pose_set(spine_slot_pose self, spine_slot_pose pose);
/**
* The color used to tint the slot's attachment. If getDarkColor() is set, this
* is used as the light color for two color tinting.
*/
SPINE_C_API spine_color spine_slot_pose_get_color(spine_slot_pose self);
/**
* The dark color used to tint the slot's attachment for two color tinting. The
* dark color's alpha is not used.
*/
SPINE_C_API spine_color spine_slot_pose_get_dark_color(spine_slot_pose self);
/**
* Returns true if this slot has a dark color.
*/
SPINE_C_API bool spine_slot_pose_has_dark_color(spine_slot_pose self);
SPINE_C_API void spine_slot_pose_set_has_dark_color(spine_slot_pose self, bool hasDarkColor);
/**
* The current attachment for the slot, or null if the slot has no attachment.
*/
SPINE_C_API /*@null*/ spine_attachment spine_slot_pose_get_attachment(spine_slot_pose self);
/**
* Sets the slot's attachment and, if the attachment changed, resets
* sequenceIndex and clears the deform. The deform is not cleared if the old
* attachment has the same VertexAttachment::getTimelineAttachment() as the
* specified attachment.
*/
SPINE_C_API void spine_slot_pose_set_attachment(spine_slot_pose self, /*@null*/ spine_attachment attachment);
/**
* The index of the texture region to display when the slot's attachment has a
* Sequence. -1 represents the Sequence::getSetupIndex().
*/
SPINE_C_API int spine_slot_pose_get_sequence_index(spine_slot_pose self);
SPINE_C_API void spine_slot_pose_set_sequence_index(spine_slot_pose self, int sequenceIndex);
/**
* Values to deform the slot's attachment. For an unweighted mesh, the entries
* are local positions for each vertex. For a weighted mesh, the entries are an
* offset for each vertex which will be added to the mesh's local vertex
* positions.
*
* See VertexAttachment::computeWorldVertices() and DeformTimeline.
*/
SPINE_C_API spine_array_float spine_slot_pose_get_deform(spine_slot_pose self);
#ifdef __cplusplus

View File

@ -12,6 +12,10 @@ extern "C" {
SPINE_C_API void spine_slot_timeline_dispose(spine_slot_timeline self);
SPINE_C_API spine_rtti spine_slot_timeline_get_rtti(spine_slot_timeline self);
/**
* The index of the slot in Skeleton::getSlots() that will be changed when this
* timeline is applied.
*/
SPINE_C_API int spine_slot_timeline_get_slot_index(spine_slot_timeline self);
SPINE_C_API void spine_slot_timeline_set_slot_index(spine_slot_timeline self, int inValue);
SPINE_C_API spine_rtti spine_slot_timeline_rtti(void);

View File

@ -12,6 +12,18 @@ extern "C" {
SPINE_C_API void spine_timeline_dispose(spine_timeline self);
SPINE_C_API spine_rtti spine_timeline_get_rtti(spine_timeline self);
/**
* Sets the value(s) for the specified time.
*
* @param skeleton The skeleton the timeline is being applied to. This provides access to the bones, slots, and other skeleton components the timeline may change.
* @param lastTime lastTime The time this timeline was last applied. Timelines such as EventTimeline trigger only at specific times rather than every frame. In that case, the timeline triggers everything between lastTime (exclusive) and time (inclusive).
* @param time The time within the animation. Most timelines find the key before and the key after this time so they can interpolate between the keys.
* @param events If any events are fired, they are added to this array. Can be NULL to ignore firing events or if the timeline does not fire events. May be NULL.
* @param alpha alpha 0 applies the current or setup pose value (depending on pose parameter). 1 applies the timeline value. Between 0 and 1 applies a value between the current or setup pose and the timeline value. By adjusting alpha over time, an animation can be mixed in or out. alpha can also be useful to apply animations on top of each other (layered).
* @param blend Controls how mixing is applied when alpha is than 1.
* @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions such as DrawOrderTimeline and AttachmentTimeline.
* @param appliedPose True to modify the applied pose.
*/
SPINE_C_API void spine_timeline_apply(spine_timeline self, spine_skeleton skeleton, float lastTime, float time, /*@null*/ spine_array_event events,
float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
SPINE_C_API size_t spine_timeline_get_frame_entries(spine_timeline self);

View File

@ -12,7 +12,13 @@ extern "C" {
SPINE_C_API void spine_to_property_dispose(spine_to_property self);
SPINE_C_API spine_rtti spine_to_property_get_rtti(spine_to_property self);
/**
* Reads the mix for this property from the specified pose.
*/
SPINE_C_API float spine_to_property_mix(spine_to_property self, spine_transform_constraint_pose pose);
/**
* Applies the value to this property.
*/
SPINE_C_API void spine_to_property_apply(spine_to_property self, spine_skeleton skeleton, spine_transform_constraint_pose pose, spine_bone_pose bone,
float value, bool local, bool additive);
SPINE_C_API spine_rtti spine_to_property_rtti(void);

View File

@ -13,59 +13,263 @@ SPINE_C_API spine_track_entry spine_track_entry_create(void);
SPINE_C_API void spine_track_entry_dispose(spine_track_entry self);
/**
* The index of the track where this entry is either current or queued.
*/
SPINE_C_API int spine_track_entry_get_track_index(spine_track_entry self);
/**
* The animation to apply for this track entry.
*/
SPINE_C_API spine_animation spine_track_entry_get_animation(spine_track_entry self);
/**
* Sets the animation for this track entry.
*/
SPINE_C_API void spine_track_entry_set_animation(spine_track_entry self, spine_animation animation);
SPINE_C_API /*@null*/ spine_track_entry spine_track_entry_get_previous(spine_track_entry self);
/**
* If true, the animation will repeat. If false, it will not, instead its last
* frame is applied if played beyond its duration.
*/
SPINE_C_API bool spine_track_entry_get_loop(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_loop(spine_track_entry self, bool inValue);
/**
* If true, when mixing from the previous animation to this animation, the
* previous animation is applied as normal instead of being mixed out.
*
* When mixing between animations that key the same property, if a lower track
* also keys that property then the value will briefly dip toward the lower
* track value during the mix. This happens because the first animation mixes
* from 100% to 0% while the second animation mixes from 0% to 100%. Setting
* holdPrevious to true applies the first animation at 100% during the mix so
* the lower track value is overwritten. Such dipping does not occur on the
* lowest track which keys the property, only when a higher track also keys the
* property.
*
* Snapping will occur if holdPrevious is true and this animation does not key
* all the same properties as the previous animation.
*/
SPINE_C_API bool spine_track_entry_get_hold_previous(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_hold_previous(spine_track_entry self, bool inValue);
SPINE_C_API bool spine_track_entry_get_reverse(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_reverse(spine_track_entry self, bool inValue);
SPINE_C_API bool spine_track_entry_get_shortest_rotation(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_shortest_rotation(spine_track_entry self, bool inValue);
/**
* Seconds to postpone playing the animation. Must be >= 0. When this track
* entry is the current track entry, delay postpones incrementing the
* getTrackTime(). When this track entry is queued, delay is the time from the
* start of the previous animation to when this track entry will become the
* current track entry (ie when the previous track entry getTrackTime() >= this
* track entry's delay).
*
* getTimeScale() affects the delay.
*
* When passing delay < = 0 to AnimationState::addAnimation(int, Animation,
* bool, float) this delay is set using a mix duration from AnimationStateData.
* To change the getMixDuration() afterward, use setMixDuration(float, float) so
* this delay is adjusted.
*/
SPINE_C_API float spine_track_entry_get_delay(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_delay(spine_track_entry self, float inValue);
/**
* Current time in seconds this track entry has been the current track entry.
* The track time determines getAnimationTime(). The track time can be set to
* start the animation at a time other than 0, without affecting looping.
*/
SPINE_C_API float spine_track_entry_get_track_time(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_track_time(spine_track_entry self, float inValue);
/**
* The track time in seconds when this animation will be removed from the track.
* Defaults to the highest possible float value, meaning the animation will be
* applied until a new animation is set or the track is cleared. If the track
* end time is reached, no other animations are queued for playback, and mixing
* from any previous animations is complete, then the properties keyed by the
* animation are set to the setup pose and the track is cleared.
*
* It may be desired to use AnimationState::addEmptyAnimation(int, float, float)
* rather than have the animation abruptly cease being applied.
*/
SPINE_C_API float spine_track_entry_get_track_end(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_track_end(spine_track_entry self, float inValue);
/**
* Seconds when this animation starts, both initially and after looping.
* Defaults to 0.
*
* When changing the animation start time, it often makes sense to set
* TrackEntry.AnimationLast to the same value to prevent timeline keys before
* the start time from triggering.
*/
SPINE_C_API float spine_track_entry_get_animation_start(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_animation_start(spine_track_entry self, float inValue);
/**
* Seconds for the last frame of this animation. Non-looping animations won't
* play past this time. Looping animations will loop back to
* TrackEntry.AnimationStart at this time. Defaults to the animation duration.
*/
SPINE_C_API float spine_track_entry_get_animation_end(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_animation_end(spine_track_entry self, float inValue);
/**
* The time in seconds this animation was last applied. Some timelines use this
* for one-time triggers. Eg, when this animation is applied, event timelines
* will fire all events between the animation last time (exclusive) and
* animation time (inclusive). Defaults to -1 to ensure triggers on frame 0
* happen the first time this animation is applied.
*/
SPINE_C_API float spine_track_entry_get_animation_last(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_animation_last(spine_track_entry self, float inValue);
/**
* Uses getTrackTime() to compute the animationTime. When the trackTime is 0,
* the animationTime is equal to the animationStart time.
*
* The animationTime is between getAnimationStart() and getAnimationEnd(),
* except if this track entry is non-looping and getAnimationEnd() is >= to the
* animation duration, then animationTime continues to increase past
* getAnimationEnd().
*/
SPINE_C_API float spine_track_entry_get_animation_time(spine_track_entry self);
/**
* Multiplier for the delta time when this track entry is updated, causing time
* for this animation to pass slower or faster. Defaults to 1.
*
* Values < 0 are not supported. To play an animation in reverse, use
* getReverse().
*
* getMixTime() is not affected by track entry time scale, so getMixDuration()
* may need to be adjusted to match the animation speed.
*
* When using AnimationState::addAnimation(int, Animation, bool, float) with a
* delay < = 0, the getDelay() is set using the mix duration from the
* AnimationStateData, assuming time scale to be 1. If the time scale is not 1,
* the delay may need to be adjusted.
*
* See AnimationState getTimeScale() for affecting all animations.
*/
SPINE_C_API float spine_track_entry_get_time_scale(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_time_scale(spine_track_entry self, float inValue);
/**
* Values less than 1 mix this animation with the last skeleton pose. Defaults
* to 1, which overwrites the last skeleton pose with this animation.
*
* Typically track 0 is used to completely pose the skeleton, then alpha can be
* used on higher tracks. It doesn't make sense to use alpha on track 0 if the
* skeleton pose is from the last frame render.
*/
SPINE_C_API float spine_track_entry_get_alpha(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_alpha(spine_track_entry self, float inValue);
/**
* When the mix percentage (mix time / mix duration) is less than the event
* threshold, event timelines for the animation being mixed out will be applied.
* Defaults to 0, so event timelines are not applied for an animation being
* mixed out.
*/
SPINE_C_API float spine_track_entry_get_event_threshold(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_event_threshold(spine_track_entry self, float inValue);
/**
* When the mix percentage (mix time / mix duration) is less than the attachment
* threshold, attachment timelines for the animation being mixed out will be
* applied. Defaults to 0, so attachment timelines are not applied for an
* animation being mixed out.
*/
SPINE_C_API float spine_track_entry_get_mix_attachment_threshold(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_mix_attachment_threshold(spine_track_entry self, float inValue);
SPINE_C_API float spine_track_entry_get_alpha_attachment_threshold(spine_track_entry self);
/**
* When getAlpha() is greater than alphaAttachmentThreshold, attachment
* timelines are applied. Defaults to 0, so attachment timelines are always
* applied. */
* / SPINE_C_API float spine_track_entry_get_alpha_attachment_threshold(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_alpha_attachment_threshold(spine_track_entry self, float inValue);
/**
* When the mix percentage (mix time / mix duration) is less than the draw order
* threshold, draw order timelines for the animation being mixed out will be
* applied. Defaults to 0, so draw order timelines are not applied for an
* animation being mixed out.
*/
SPINE_C_API float spine_track_entry_get_mix_draw_order_threshold(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_mix_draw_order_threshold(spine_track_entry self, float inValue);
/**
* The animation queued to start after this animation, or NULL.
*/
SPINE_C_API /*@null*/ spine_track_entry spine_track_entry_get_next(spine_track_entry self);
/**
* Returns true if at least one loop has been completed.
*/
SPINE_C_API bool spine_track_entry_is_complete(spine_track_entry self);
/**
* Seconds from 0 to the mix duration when mixing from the previous animation to
* this animation. May be slightly more than TrackEntry.MixDuration when the mix
* is complete.
*/
SPINE_C_API float spine_track_entry_get_mix_time(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_mix_time(spine_track_entry self, float inValue);
/**
* Seconds for mixing from the previous animation to this animation. Defaults to
* the value provided by AnimationStateData based on the animation before this
* animation (if any).
*
* The mix duration can be set manually rather than use the value from
* AnimationStateData.GetMix. In that case, the mixDuration must be set before
* AnimationState.update(float) is next called.
*
* When using AnimationState::addAnimation(int, Animation, bool, float) with a
* delay less than or equal to 0, note the Delay is set using the mix duration
* from the AnimationStateData
*/
SPINE_C_API float spine_track_entry_get_mix_duration(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_mix_duration_1(spine_track_entry self, float inValue);
/**
* Sets both getMixDuration() and getDelay().
*
* @param delay If > 0, sets TrackEntry::getDelay(). If < = 0, the delay set is the duration of the previous track entry minus the specified mix duration plus the specified delay (ie the mix ends at (delay = 0) or before (delay < 0) the previous track entry duration). If the previous entry is looping, its next loop completion is used instead of its duration.
*/
SPINE_C_API void spine_track_entry_set_mix_duration_2(spine_track_entry self, float mixDuration, float delay);
SPINE_C_API spine_mix_blend spine_track_entry_get_mix_blend(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_mix_blend(spine_track_entry self, spine_mix_blend blend);
/**
* The track entry for the previous animation when mixing from the previous
* animation to this animation, or NULL if no mixing is currently occuring. When
* mixing from multiple animations, MixingFrom makes up a double linked list
* with MixingTo.
*/
SPINE_C_API /*@null*/ spine_track_entry spine_track_entry_get_mixing_from(spine_track_entry self);
/**
* The track entry for the next animation when mixing from this animation, or
* NULL if no mixing is currently occuring. When mixing from multiple
* animations, MixingTo makes up a double linked list with MixingFrom.
*/
SPINE_C_API /*@null*/ spine_track_entry spine_track_entry_get_mixing_to(spine_track_entry self);
/**
* Resets the rotation directions for mixing this entry's rotate timelines. This
* can be useful to avoid bones rotating the long way around when using alpha
* and starting animations on other tracks.
*
* Mixing involves finding a rotation between two others, which has two possible
* solutions: the short way or the long way around. The two rotations likely
* change over time, so which direction is the short or long way also changes.
* If the short way was always chosen, bones would flip to the other side when
* that direction became the long way. TrackEntry chooses the short way the
* first time it is applied and remembers that direction.
*/
SPINE_C_API void spine_track_entry_reset_rotation_directions(spine_track_entry self);
SPINE_C_API float spine_track_entry_get_track_complete(spine_track_entry self);
/**
* Returns true if this entry is for the empty animation.
*/
SPINE_C_API bool spine_track_entry_is_empty_animation(spine_track_entry self);
/**
* Returns true if this track entry has been applied at least once.
*
* See AnimationState::apply(Skeleton).
*/
SPINE_C_API bool spine_track_entry_was_applied(spine_track_entry self);
/**
* Returns true if there is a getNext() track entry that is ready to become the
* current track entry during the next AnimationState::update(float)}
*/
SPINE_C_API bool spine_track_entry_is_next_ready(spine_track_entry self);
/**
* The AnimationState this track entry belongs to. May be NULL if TrackEntry is
* directly instantiated.
*/
SPINE_C_API /*@null*/ spine_animation_state spine_track_entry_get_animation_state(spine_track_entry self);
SPINE_C_API void spine_track_entry_set_animation_state(spine_track_entry self, /*@null*/ spine_animation_state state);
SPINE_C_API /*@null*/ void *spine_track_entry_get_renderer_object(spine_track_entry self);

View File

@ -15,10 +15,19 @@ SPINE_C_API void spine_transform_constraint_dispose(spine_transform_constraint s
SPINE_C_API spine_rtti spine_transform_constraint_get_rtti(spine_transform_constraint self);
SPINE_C_API spine_transform_constraint spine_transform_constraint_copy(spine_transform_constraint self, spine_skeleton skeleton);
/**
* Applies the constraint to the constrained bones.
*/
SPINE_C_API void spine_transform_constraint_update(spine_transform_constraint self, spine_skeleton skeleton, spine_physics physics);
SPINE_C_API void spine_transform_constraint_sort(spine_transform_constraint self, spine_skeleton skeleton);
SPINE_C_API bool spine_transform_constraint_is_source_active(spine_transform_constraint self);
/**
* The bones that will be modified by this transform constraint.
*/
SPINE_C_API spine_array_bone_pose spine_transform_constraint_get_bones(spine_transform_constraint self);
/**
* The bone whose world transform will be copied to the constrained bones.
*/
SPINE_C_API spine_bone spine_transform_constraint_get_source(spine_transform_constraint self);
SPINE_C_API void spine_transform_constraint_set_source(spine_transform_constraint self, spine_bone source);
SPINE_C_API spine_transform_constraint_data spine_transform_constraint_get_data(spine_transform_constraint self);

View File

@ -22,6 +22,9 @@ SPINE_C_API void spine_transform_constraint_base_set_active(spine_transform_cons
SPINE_C_API spine_rtti spine_transform_constraint_base_get_rtti(spine_transform_constraint_base self);
SPINE_C_API void spine_transform_constraint_base_sort(spine_transform_constraint_base self, spine_skeleton skeleton);
SPINE_C_API bool spine_transform_constraint_base_is_source_active(spine_transform_constraint_base self);
/**
* Inherited from Update
*/
SPINE_C_API void spine_transform_constraint_base_update(spine_transform_constraint_base self, spine_skeleton skeleton, spine_physics physics);
SPINE_C_API spine_rtti spine_transform_constraint_base_rtti(void);

View File

@ -15,30 +15,75 @@ SPINE_C_API void spine_transform_constraint_data_dispose(spine_transform_constra
SPINE_C_API spine_rtti spine_transform_constraint_data_get_rtti(spine_transform_constraint_data self);
SPINE_C_API spine_constraint spine_transform_constraint_data_create_method(spine_transform_constraint_data self, spine_skeleton skeleton);
/**
* The bones that will be modified by this transform constraint.
*/
SPINE_C_API spine_array_bone_data spine_transform_constraint_data_get_bones(spine_transform_constraint_data self);
/**
* The bone whose world transform will be copied to the constrained bones.
*/
SPINE_C_API spine_bone_data spine_transform_constraint_data_get_source(spine_transform_constraint_data self);
SPINE_C_API void spine_transform_constraint_data_set_source(spine_transform_constraint_data self, spine_bone_data source);
/**
* An offset added to the constrained bone rotation.
*/
SPINE_C_API float spine_transform_constraint_data_get_offset_rotation(spine_transform_constraint_data self);
SPINE_C_API void spine_transform_constraint_data_set_offset_rotation(spine_transform_constraint_data self, float offsetRotation);
/**
* An offset added to the constrained bone X translation.
*/
SPINE_C_API float spine_transform_constraint_data_get_offset_x(spine_transform_constraint_data self);
SPINE_C_API void spine_transform_constraint_data_set_offset_x(spine_transform_constraint_data self, float offsetX);
/**
* An offset added to the constrained bone Y translation.
*/
SPINE_C_API float spine_transform_constraint_data_get_offset_y(spine_transform_constraint_data self);
SPINE_C_API void spine_transform_constraint_data_set_offset_y(spine_transform_constraint_data self, float offsetY);
/**
* An offset added to the constrained bone scaleX.
*/
SPINE_C_API float spine_transform_constraint_data_get_offset_scale_x(spine_transform_constraint_data self);
SPINE_C_API void spine_transform_constraint_data_set_offset_scale_x(spine_transform_constraint_data self, float offsetScaleX);
/**
* An offset added to the constrained bone scaleY.
*/
SPINE_C_API float spine_transform_constraint_data_get_offset_scale_y(spine_transform_constraint_data self);
SPINE_C_API void spine_transform_constraint_data_set_offset_scale_y(spine_transform_constraint_data self, float offsetScaleY);
/**
* An offset added to the constrained bone shearY.
*/
SPINE_C_API float spine_transform_constraint_data_get_offset_shear_y(spine_transform_constraint_data self);
SPINE_C_API void spine_transform_constraint_data_set_offset_shear_y(spine_transform_constraint_data self, float offsetShearY);
/**
* Reads the source bone's local transform instead of its world transform.
*/
SPINE_C_API bool spine_transform_constraint_data_get_local_source(spine_transform_constraint_data self);
SPINE_C_API void spine_transform_constraint_data_set_local_source(spine_transform_constraint_data self, bool localSource);
/**
* Sets the constrained bones' local transforms instead of their world
* transforms.
*/
SPINE_C_API bool spine_transform_constraint_data_get_local_target(spine_transform_constraint_data self);
SPINE_C_API void spine_transform_constraint_data_set_local_target(spine_transform_constraint_data self, bool localTarget);
/**
* Adds the source bone transform to the constrained bones instead of setting it
* absolutely.
*/
SPINE_C_API bool spine_transform_constraint_data_get_additive(spine_transform_constraint_data self);
SPINE_C_API void spine_transform_constraint_data_set_additive(spine_transform_constraint_data self, bool additive);
/**
* Prevents constrained bones from exceeding the ranged defined by offset and
* max.
*/
SPINE_C_API bool spine_transform_constraint_data_get_clamp(spine_transform_constraint_data self);
SPINE_C_API void spine_transform_constraint_data_set_clamp(spine_transform_constraint_data self, bool clamp);
/**
* The mapping of transform properties to other transform properties.
*/
SPINE_C_API spine_array_from_property spine_transform_constraint_data_get_properties(spine_transform_constraint_data self);
/**
* Resolve ambiguity by forwarding to PosedData's implementation
*/
SPINE_C_API const char *spine_transform_constraint_data_get_name(spine_transform_constraint_data self);
SPINE_C_API bool spine_transform_constraint_data_get_skin_required(spine_transform_constraint_data self);
SPINE_C_API spine_transform_constraint_pose spine_transform_constraint_data_get_setup_pose(spine_transform_constraint_data self);

View File

@ -14,16 +14,40 @@ SPINE_C_API spine_transform_constraint_pose spine_transform_constraint_pose_crea
SPINE_C_API void spine_transform_constraint_pose_dispose(spine_transform_constraint_pose self);
SPINE_C_API void spine_transform_constraint_pose_set(spine_transform_constraint_pose self, spine_transform_constraint_pose pose);
/**
* A percentage (0-1) that controls the mix between the constrained and
* unconstrained rotation.
*/
SPINE_C_API float spine_transform_constraint_pose_get_mix_rotate(spine_transform_constraint_pose self);
SPINE_C_API void spine_transform_constraint_pose_set_mix_rotate(spine_transform_constraint_pose self, float mixRotate);
/**
* A percentage (0-1) that controls the mix between the constrained and
* unconstrained translation X.
*/
SPINE_C_API float spine_transform_constraint_pose_get_mix_x(spine_transform_constraint_pose self);
SPINE_C_API void spine_transform_constraint_pose_set_mix_x(spine_transform_constraint_pose self, float mixX);
/**
* A percentage (0-1) that controls the mix between the constrained and
* unconstrained translation Y.
*/
SPINE_C_API float spine_transform_constraint_pose_get_mix_y(spine_transform_constraint_pose self);
SPINE_C_API void spine_transform_constraint_pose_set_mix_y(spine_transform_constraint_pose self, float mixY);
/**
* A percentage (0-1) that controls the mix between the constrained and
* unconstrained scale X.
*/
SPINE_C_API float spine_transform_constraint_pose_get_mix_scale_x(spine_transform_constraint_pose self);
SPINE_C_API void spine_transform_constraint_pose_set_mix_scale_x(spine_transform_constraint_pose self, float mixScaleX);
/**
* A percentage (0-1) that controls the mix between the constrained and
* unconstrained scale Y.
*/
SPINE_C_API float spine_transform_constraint_pose_get_mix_scale_y(spine_transform_constraint_pose self);
SPINE_C_API void spine_transform_constraint_pose_set_mix_scale_y(spine_transform_constraint_pose self, float mixScaleY);
/**
* A percentage (0-1) that controls the mix between the constrained and
* unconstrained shear Y.
*/
SPINE_C_API float spine_transform_constraint_pose_get_mix_shear_y(spine_transform_constraint_pose self);
SPINE_C_API void spine_transform_constraint_pose_set_mix_shear_y(spine_transform_constraint_pose self, float mixShearY);

View File

@ -18,6 +18,13 @@ SPINE_C_API spine_rtti spine_transform_constraint_timeline_get_rtti(spine_transf
SPINE_C_API void spine_transform_constraint_timeline_apply(spine_transform_constraint_timeline self, spine_skeleton skeleton, float lastTime,
float time, /*@null*/ spine_array_event events, float alpha, spine_mix_blend blend,
spine_mix_direction direction, bool appliedPose);
/**
* Sets the time, rotate mix, translate mix, scale mix, and shear mix for the
* specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_transform_constraint_timeline_set_frame(spine_transform_constraint_timeline self, int frame, float time, float mixRotate,
float mixX, float mixY, float mixScaleX, float mixScaleY, float mixShearY);
SPINE_C_API int spine_transform_constraint_timeline_get_constraint_index(spine_transform_constraint_timeline self);

View File

@ -19,7 +19,16 @@ SPINE_C_API void spine_translate_x_timeline_apply(spine_translate_x_timeline sel
spine_mix_direction direction, bool appliedPose);
SPINE_C_API int spine_translate_x_timeline_get_bone_index(spine_translate_x_timeline self);
SPINE_C_API void spine_translate_x_timeline_set_bone_index(spine_translate_x_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_translate_x_timeline_set_frame(spine_translate_x_timeline self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_translate_x_timeline_get_curve_value(spine_translate_x_timeline self, float time);
SPINE_C_API float spine_translate_x_timeline_get_relative_value(spine_translate_x_timeline self, float time, float alpha, spine_mix_blend blend,
float current, float setup);

View File

@ -19,7 +19,16 @@ SPINE_C_API void spine_translate_y_timeline_apply(spine_translate_y_timeline sel
spine_mix_direction direction, bool appliedPose);
SPINE_C_API int spine_translate_y_timeline_get_bone_index(spine_translate_y_timeline self);
SPINE_C_API void spine_translate_y_timeline_set_bone_index(spine_translate_y_timeline self, int inValue);
/**
* Sets the time and value for the specified frame.
*
* @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds.
*/
SPINE_C_API void spine_translate_y_timeline_set_frame(spine_translate_y_timeline self, size_t frame, float time, float value);
/**
* Returns the interpolated value for the specified time.
*/
SPINE_C_API float spine_translate_y_timeline_get_curve_value(spine_translate_y_timeline self, float time);
SPINE_C_API float spine_translate_y_timeline_get_relative_value(spine_translate_y_timeline self, float time, float alpha, spine_mix_blend blend,
float current, float setup);

View File

@ -12,6 +12,10 @@ extern "C" {
SPINE_C_API void spine_update_dispose(spine_update self);
SPINE_C_API spine_rtti spine_update_get_rtti(spine_update self);
/**
*
* @param physics Determines how physics and other non-deterministic updates are applied.
*/
SPINE_C_API void spine_update_update(spine_update self, spine_skeleton skeleton, spine_physics physics);
SPINE_C_API spine_rtti spine_update_rtti(void);

View File

@ -12,12 +12,28 @@ extern "C" {
SPINE_C_API void spine_vertex_attachment_dispose(spine_vertex_attachment self);
SPINE_C_API spine_rtti spine_vertex_attachment_get_rtti(spine_vertex_attachment self);
/**
* Transforms the attachment's local vertices to world coordinates. If the
* slot's SlotPose::getDeform() is not empty, it is used to deform the vertices.
*
* See https://esotericsoftware.com/spine-runtime-skeletons#World-transforms
* World transforms in the Spine Runtimes Guide.
*
* @param start The index of the first vertices value to transform. Each vertex has 2 values, x and y.
* @param count The number of world vertex values to output. Must be < = WorldVerticesLength - start.
* @param worldVertices The output world vertices. Must have a length >= offset + count * stride / 2.
* @param offset The worldVertices index to begin writing values.
* @param stride The number of worldVertices entries between the value pairs written.
*/
SPINE_C_API void spine_vertex_attachment_compute_world_vertices_1(spine_vertex_attachment self, spine_skeleton skeleton, spine_slot slot,
size_t start, size_t count, /*@null*/ float *worldVertices, size_t offset,
size_t stride);
SPINE_C_API void spine_vertex_attachment_compute_world_vertices_2(spine_vertex_attachment self, spine_skeleton skeleton, spine_slot slot,
size_t start, size_t count, spine_array_float worldVertices, size_t offset,
size_t stride);
/**
* Gets a unique ID for this attachment.
*/
SPINE_C_API int spine_vertex_attachment_get_id(spine_vertex_attachment self);
SPINE_C_API spine_array_int spine_vertex_attachment_get_bones(spine_vertex_attachment self);
SPINE_C_API void spine_vertex_attachment_set_bones(spine_vertex_attachment self, spine_array_int bones);

View File

@ -112,8 +112,8 @@ void PhysicsConstraint::update(Skeleton &skeleton, Physics physics) {
_ux = bx;
_uy = by;
} else {
float a = _remaining, i = p._inertia, f = skeleton._data.getReferenceScale(), d = -1, m = 0, e = 0,
qx = _data._limit * delta, qy = qx * MathUtil::abs(skeleton.getScaleY());
float a = _remaining, i = p._inertia, f = skeleton._data.getReferenceScale(), d = -1, m = 0, e = 0, qx = _data._limit * delta,
qy = qx * MathUtil::abs(skeleton.getScaleY());
qx *= MathUtil::abs(skeleton._scaleX);
if (x || y) {
if (x) {

View File

@ -40,9 +40,9 @@ int width = 800, height = 600;
// Mouse position for IK targeting
double mouseX = 400, mouseY = 300;
Skeleton* ikSkeleton = nullptr;
Skeleton *ikSkeleton = nullptr;
void cursor_position_callback(GLFWwindow* window, double xpos, double ypos) {
void cursor_position_callback(GLFWwindow *window, double xpos, double ypos) {
mouseX = xpos;
mouseY = ypos;
}
@ -124,9 +124,9 @@ int main() {
skeleton.update(delta);
// Update the crosshair bone position based on mouse position
Bone* crosshairBone = skeleton.findBone("crosshair");
Bone *crosshairBone = skeleton.findBone("crosshair");
if (crosshairBone != nullptr) {
Bone* parent = crosshairBone->getParent();
Bone *parent = crosshairBone->getParent();
if (parent != nullptr) {
// Convert mouse position to world coordinates
float worldX = mouseX;

Some files were not shown because too many files have changed in this diff Show More