feat!: add Node3D to constructor for Marionette and Performer

This commit is contained in:
Cassandra de la Cruz-Munoz 2023-10-20 10:05:54 -04:00
parent c0f028bb55
commit 9201215b06
2 changed files with 9 additions and 3 deletions

View File

@ -29,8 +29,10 @@ namespace godotVmcSharp
private CameraReceiver cam;
private DeviceReceiver devices;
private DirectionalLightReceiver lights;
public Marionette(int port)
private Node3D node;
public Marionette(int port, Node3D node)
{
this.node = node;
receiver = new OscReceiver(port);
receiver.MessageReceived += (sender, e) =>
{
@ -46,6 +48,7 @@ namespace godotVmcSharp
};
devices = new DeviceReceiver();
lights = new DirectionalLightReceiver();
cam = new CameraReceiver(node.GetViewport().GetCamera3D());
}
private void ProcessMessage(OscMessage m)
{

View File

@ -29,8 +29,10 @@ namespace godotVmcSharp
private CameraReceiver cam;
private DeviceReceiver devices;
private DirectionalLightReceiver lights;
public Performer(IPAddress host, int port)
private Node3D node;
public Performer(IPAddress host, int port, Node3D node)
{
this.node = node;
receiver = new OscReceiver(port);
sender = new OscSender(host, port);
receiver.MessageReceived += (sender, e) =>
@ -44,6 +46,7 @@ namespace godotVmcSharp
};
devices = new DeviceReceiver();
lights = new DirectionalLightReceiver();
cam = new CameraReceiver(node.GetViewport().GetCamera3D());
}
private void ProcessMessage(OscMessage m)
{
@ -96,4 +99,4 @@ namespace godotVmcSharp
}
}
}
}
}