Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fb4a182edf1cb341f664c5315434936d95ebf267
      
https://github.com/WebKit/WebKit/commit/fb4a182edf1cb341f664c5315434936d95ebf267
  Author: Phipson Lee <phipsonle...@gmail.com>
  Date:   2025-02-27 (Thu, 27 Feb 2025)

  Changed paths:
    M Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.h
    M Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.mm
    M Source/WebKit/WebKitSwift/RealityKit/RKEntity.swift
    M Source/WebKit/WebKitSwift/RealityKit/RealityKitBridging.h
    M Source/WebKit/WebKitSwift/StageMode/WKStageMode.h
    M Source/WebKit/WebKitSwift/StageMode/WKStageMode.swift

  Log Message:
  -----------
  Use drag recognizer in WebKit to send transform updates to Model Process for 
Stage Mode behavior
https://bugs.webkit.org/show_bug.cgi?id=287601
rdar://141251753

Reviewed by Wenson Hsieh.

This PR implements the WKStageModeInteractionDriver to read the updates set 
from the modelInteractionPanGestureRecognizer
and then transform the model accordingly based on the type of model interaction 
that is defined. It also adds a new
delegate called WKStageModeInteractionAware that is implemented by the model 
player that is used to receive transform
updates and report them back to the entityTransform. In order to do so, we have 
to also modify the coordinate space in which
the entityTransform is reported, as it is currently relative to the interaction 
container rather than the scene.

* Source/WebKit/ModelProcess/StageMode/WKStageMode.h:
* Source/WebKit/ModelProcess/StageMode/WKStageMode.swift:
(WKStageModeInteractionDriver.delegate):
(WKStageModeInteractionDriver.driverInitialized):
(WKStageModeInteractionDriver.initialManipulationPose):
(WKStageModeInteractionDriver.previousManipulationPose):
(WKStageModeInteractionDriver.initialTargetPose):
(WKStageModeInteractionDriver.interactionDidBegin(_:)):
(WKStageModeInteractionDriver.interactionDidUpdate(_:)):
(WKStageModeInteractionDriver.interactionDidEnd):
(WKStageModeInteractionDriver.stageModeInteractionInProgress):
- Updated all the interaction update calls with the appropriate implementation 
to orbit model when stagemode is set

(simd_float3._inMeters):
(simd_float3.xy):
(simd_float3.double3):
(simd_quatd.quatf):
- Added helper calls to properly convert between the right data types

* Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.h:
* Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.mm:
(-[WKModelProcessModelPlayerProxyObjCAdapter 
stageModeInteractionDidUpdateModel]):i
(WebKit::ModelProcessModelPlayerProxy::computeTransform):
(WebKit::ModelProcessModelPlayerProxy::updateTransform):
(WebKit::ModelProcessModelPlayerProxy::stageModeInteractionDidUpdateModel):
(WebKit::ModelProcessModelPlayerProxy::stageModeInteractionInProgress):
- Added the appropriate calls to update entityTransform when the stage mode 
interaction is in progress

* Source/WebKit/WebKitSwift/RealityKit/RKEntity.swift:
(WKSRKEntity.interactionContainerDidRecenter(_:)):
(WKSRKEntity.transform):
* Source/WebKit/WebKitSwift/RealityKit/RealityKitBridging.h:
- Adds calls to the RKEntity to recenter the entity transform after javascript 
changes
- Updates the transform such that it tracks the entity's world transform such 
that it reports the correct
transform updates back to the HTMLModelElement

Canonical link: https://commits.webkit.org/291305@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to