Skip to content

Commit 2fe4278

Browse files
b-maorottier
authored andcommitted
feat: add set_orientation and set_position methods
1 parent d086a96 commit 2fe4278

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/node/panner.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,12 @@ impl PannerNode {
454454
&self.position_z
455455
}
456456

457+
pub fn set_position(&self, x: f32, y: f32, z: f32) {
458+
self.position_x.set_value(x);
459+
self.position_y.set_value(y);
460+
self.position_z.set_value(z);
461+
}
462+
457463
pub fn orientation_x(&self) -> &AudioParam {
458464
&self.orientation_x
459465
}
@@ -466,6 +472,12 @@ impl PannerNode {
466472
&self.orientation_z
467473
}
468474

475+
pub fn set_orientation(&self, x: f32, y: f32, z: f32) {
476+
self.orientation_x.set_value(x);
477+
self.orientation_y.set_value(y);
478+
self.orientation_z.set_value(z);
479+
}
480+
469481
pub fn distance_model(&self) -> DistanceModelType {
470482
self.distance_model.load(Ordering::Acquire).into()
471483
}

0 commit comments

Comments
 (0)