Add actor animation playback and path follow capabilities

This commit is contained in:
2026-04-14 13:39:54 +02:00
parent b4c33dee3b
commit abca73c7c1

View File

@@ -11,6 +11,8 @@ export const CONTROL_INTERACTION_TARGET_KINDS = [
] as const; ] as const;
export const CONTROL_CAPABILITY_KINDS = [ export const CONTROL_CAPABILITY_KINDS = [
"actorPresence", "actorPresence",
"actorAnimationPlayback",
"actorPathFollow",
"animationPlayback", "animationPlayback",
"modelVisibility", "modelVisibility",
"soundPlayback", "soundPlayback",
@@ -31,6 +33,9 @@ export type ControlInteractionTargetKind =
(typeof CONTROL_INTERACTION_TARGET_KINDS)[number]; (typeof CONTROL_INTERACTION_TARGET_KINDS)[number];
export type ControlCapabilityKind = (typeof CONTROL_CAPABILITY_KINDS)[number]; export type ControlCapabilityKind = (typeof CONTROL_CAPABILITY_KINDS)[number];
export const ACTOR_PATH_PROGRESS_MODES = ["deriveFromTime"] as const;
export type ActorPathProgressMode = (typeof ACTOR_PATH_PROGRESS_MODES)[number];
export interface ActorControlTargetRef { export interface ActorControlTargetRef {
kind: "actor"; kind: "actor";
actorId: string; actorId: string;
@@ -91,6 +96,22 @@ export interface SetActorPresenceControlEffect {
active: boolean; active: boolean;
} }
export interface PlayActorAnimationControlEffect {
type: "playActorAnimation";
target: ActorControlTargetRef;
clipName: string;
loop?: boolean;
}
export interface FollowActorPathControlEffect {
type: "followActorPath";
target: ActorControlTargetRef;
pathId: string;
speed: number;
loop: boolean;
progressMode: ActorPathProgressMode;
}
export interface PlayModelAnimationControlEffect { export interface PlayModelAnimationControlEffect {
type: "playModelAnimation"; type: "playModelAnimation";
target: ModelInstanceControlTargetRef; target: ModelInstanceControlTargetRef;
@@ -175,6 +196,8 @@ export interface SetSunLightColorControlEffect {
export type ControlEffect = export type ControlEffect =
| SetActorPresenceControlEffect | SetActorPresenceControlEffect
| PlayActorAnimationControlEffect
| FollowActorPathControlEffect
| PlayModelAnimationControlEffect | PlayModelAnimationControlEffect
| StopModelAnimationControlEffect | StopModelAnimationControlEffect
| SetModelInstanceVisibleControlEffect | SetModelInstanceVisibleControlEffect
@@ -257,6 +280,24 @@ export interface RuntimeResolvedActorPresenceState {
source: RuntimeResolvedControlSource; source: RuntimeResolvedControlSource;
} }
export interface RuntimeResolvedActorAnimationPlaybackState {
type: "actorAnimationPlayback";
target: ActorControlTargetRef;
clipName: string | null;
loop: boolean | undefined;
source: RuntimeResolvedControlSource;
}
export interface RuntimeResolvedActorPathAssignmentState {
type: "actorPathAssignment";
target: ActorControlTargetRef;
pathId: string | null;
speed: number | null;
loop: boolean;
progressMode: ActorPathProgressMode | null;
source: RuntimeResolvedControlSource;
}
export interface RuntimeResolvedInteractionEnabledState { export interface RuntimeResolvedInteractionEnabledState {
type: "interactionEnabled"; type: "interactionEnabled";
target: InteractionControlTargetRef; target: InteractionControlTargetRef;
@@ -309,6 +350,8 @@ export interface RuntimeResolvedSunLightColorState {
export type RuntimeResolvedDiscreteControlState = export type RuntimeResolvedDiscreteControlState =
| RuntimeResolvedActorPresenceState | RuntimeResolvedActorPresenceState
| RuntimeResolvedActorAnimationPlaybackState
| RuntimeResolvedActorPathAssignmentState
| RuntimeResolvedLightEnabledState | RuntimeResolvedLightEnabledState
| RuntimeResolvedInteractionEnabledState | RuntimeResolvedInteractionEnabledState
| RuntimeResolvedModelInstanceVisibilityState | RuntimeResolvedModelInstanceVisibilityState