Hello,
when I use listenerDirectivityModelParameters:
let simpleCone = PHASEConeDirectivityModelParameters(subbandParameters: sub)
spatialMixerDefinition.listenerDirectivityModelParameters = simpleCone
I have to flip my listener around like so:
listener!.transform = position * Transform(yaw: .pi, roll: .pi).matrix
Without listenerDirectivityModelParameters everything works as expected. For example distanceModelParameters or sourceDirectivityModelParameters work fine with a listener position of:
listener!.transform = position
I found no way of getting the rotation or transform matrix of the cone or cardoid. So im kinda stuck with this solution right now.
Post
Replies
Boosts
Views
Activity
Hi guys,
Is RealityKit in any way compatible with the PHASE Audio Engine?
It seems like RealityKit has its own audio engine which is not interchangeable. Or is there any way to stream the audio output from RealityKit into PHASE? And would that be smart?
It makes me wonder. Because I thought RealityKit is the video simulation part of a game engine and PHASE the audio simulation part.
Greetings
Gabe
Hi guys,
I followed the documentation on animationEvents like this:
private func onAnimationCompleted(_ event:
AnimationEvents.PlaybackCompleted) {
print("EVENT ENDED")
}
var anim1 = FromToByAnimation(by: Transform(translation: [3, 0, 0]), duration: 3, bindTarget: .transform)
let animationResource = try! AnimationResource.generate(with: anim1)
// Pass the animation to an entity and get a controller.
entity.playAnimation(named: animationName, transitionDuration: 0.0)
entitySubscription = view.scene.publisher(for:
AnimationEvents.PlaybackCompleted.self, on: entity)
.sink(receiveValue: onAnimationCompleted)
I never get a print after the animation ended. Nor any other code is run that I put into the completion handler.
What am I missing/doing wrong?
Greetings
Gabe
Hi guys,
i want to animate a box that moves 1 unit along the x-axis, after that -1 on the y-axis and lastly 2 on the x-axis. I try to do this with a animation group:
var anim1 = FromToByAnimation(by: Transform(translation: [1,0,0]), bindTarget: .transform, duration: 3)
var anim2 = FromToByAnimation(by: Transform(translation: [0,-1,0]), bindTarget: .transform, duration: 3, delay: 3)
var anim3 = FromToByAnimation(by: Transform(translation: [2,0,0]), bindTarget: .transform, duration: 3, delay: 6)
var animGroup = AnimationGroup(group: [anim1, anim2, anim3], name: "group")
animGroup.additive = true
let animationResource = try! AnimationResource.generate(with: animGroup)
box.playAnimation(animationResource)
Instead of doing the animations on top of each other, each animation resets my box to its initial position. So it's like:
Box moving 1 on x-axis
Box goes back to initial position
Box moving -1 on y-axis
Box goes back to initial position
Box moving 2 on x-axis
I thought that setting the additive property would change that for me by setting it to true.
But it's not working that way I guess.
What do I have to get a animation group that's not resetting to initial position?
Greetings
Gabe
Hello folks,
im animating a Box in my RealityKit-App like this:
let animationDefinition = FromToByAnimation(
by: Transform(translation: [0, 0, 1]),
duration: 3,
bindTarget: .transform,
repeatMode: .cumulative
)
let animationResource = try! AnimationResource.generate(with: animationDefinition)
box.playAnimation(animationResource)
The animation plays, but it's not cumulative its repeating. Auto-reverse works.
Does this work for you?
Greetings
Gabe