static void MapIntensity(OscMessage message, Light light, LightData lightdata) { float val = message.GetFloat(0); val = Unicom.Utility.MapValue(val, lightdata.inputRange.x, lightdata.inputRange.y, lightdata.outputRange.x, lightdata.outputRange.y); // Mathf.Clamp(val, 0.0f, 1.0f); light.intensity = val; }
static void MapColorGradient(OscMessage message, Light light, LightData lightdata) { float val = message.GetFloat(0); val = Unicom.Utility.MapValue(val, lightdata.inputRange.x, lightdata.inputRange.y, lightdata.outputRange.x, lightdata.outputRange.y); // Mathf.Clamp(val, 0.0f, 1.0f); light.color = lightdata.colorGradient.Evaluate(val); }
void OnReceive(OscMessage message) { if (message.address == "/noisiness") { float data = message.GetFloat(0); float scaled = Mathf.Lerp(0.1f, 4f, data); // Scale to new range noisinessGameObject.transform.localScale = new Vector3(scaled, scaled, scaled); } else if (message.address == "/brightness") { float data = message.GetFloat(0); Color c = new Color(data, data, data); brightnessGameObject.GetComponent <Renderer>().material.color = c; } }
// Function that receives the message void OnReceive(OscMessage message) { float data = message.GetFloat(0); float scaled = Mathf.Lerp(0.1f, 8f, data); // Scale to new range transform.localScale = new Vector3(scaled, scaled, scaled); }
void OnReceiveAcc(OscMessage message) { for (int i = 0; i < 3; i++) { accData[i] = message.GetFloat(i); } lastTimeUpdated = Time.time; }
void OnRotRight(OscMessage message) { float x = message.GetFloat(0); float rotation = x * Time.deltaTime; playerBody.Rotate(Vector3.up * rotation); Debug.Log("osc update, received rotright: " + x); }
void onReceiveScale(OscMessage message) { rawScale = message.GetFloat(0); //make this code smarter //to determine if it's actually been receiving data for a while isReceiving = true; }
public void OnReceive(OscMessage message) { if (showMsg) { Debug.Log("osc: " + message.address + ", " + message.GetFloat(0)); } input = message.GetFloat(0); output = MapParameter(input); if (clamp) { output = Mathf.Clamp(output, outputMin, outputMax); } if (isActive) { visualEffect.SetFloat(vfxParameterName, output); } }
void OnReceiveEnd(OscMessage message) { float endStatus = message.GetFloat(0); if (endStatus == 1) { sceneManagement.StopProject(); } }
public void RecibirNumPeople(OscMessage m) { float num0 = m.GetFloat(0); Debug.Log("Tiempo: " + num0); float num1 = m.GetFloat(1); Debug.Log("Porcentaje: " + num1); float num2 = m.GetFloat(2); Debug.Log("Persons: " + num2); float num3 = m.GetFloat(3); Debug.Log("average x: " + num3); float num4 = m.GetFloat(4); Debug.Log("average y: " + num4); }
void OnReceiveCleanser(OscMessage message) { float state = message.GetFloat(0); if (state == 1) { Bees.burst("FlyingBlue"); Count10Sec++; } }
void OnReceiveHex(OscMessage message) { float state = message.GetFloat(0); if (state == 1) { Bees.burst("Walking"); Count10Sec++; } }
void OnReceiveEEG(OscMessage message) { for (int i = 0; i < 4; i++) { eegData[currBufferPositionEEG % bufferSize][i] = message.GetFloat(i); } currBufferPositionEEG++; lastTimeUpdated = Time.time; }
void GetAbsoluteBandPower(OscMessage m, ref BrainWave brainWave) { // get band powers float[] floats = { m.GetFloat(0), m.GetFloat(1), m.GetFloat(2), m.GetFloat(3) }; // set band power float averageBandPower = Average(floats); brainWave.AbsoluteBandPower = averageBandPower; // record band power brainWave.RecordAbsoluteBandPower(averageBandPower); }
void OnBackward(OscMessage message) { float z = message.GetFloat(0); Debug.Log("osc update, received backward: " + z); Vector3 move = transform.forward * -z; controller.Move(move * Time.deltaTime); }
void OnReceiveZ(OscMessage message) { float z = message.GetFloat(0); Vector3 position = transform.position; position.z = z; transform.position = position; }
void OnReceiveX(OscMessage message) { float x = message.GetFloat(0); Vector3 position = transform.position; position.x = x; transform.position = position; }
void OnReceiveY(OscMessage message) { float y = message.GetFloat(0); Vector3 position = transform.position; position.y = y; transform.position = position; }
void OnReceiveZ(OscMessage message) { float z = message.GetFloat(0); valorVector = transform.position; valorVector.z = z; transform.position = valorVector; }
void PlaneFunc(OscMessage msg) { int x = msg.GetInt(0); int y = msg.GetInt(1); int z = msg.GetInt(2); float degree = msg.GetInt(3); float amp = msg.GetFloat(4) * scaleAmp; clones[x + (y * numX)].localScale = new Vector3(amp, amp, amp); }
/* void OnReceiveX (OscMessage message) * { * float x = message.GetFloat (0); * * valorVector = transform.position; * * valorVector.x = x; * * transform.position = valorVector; * * } */ void OnReceiveY(OscMessage message) { float y = message.GetFloat(0); valorVector = transform.position; valorVector.y = y; transform.position = valorVector; }
public override void ToOSCDataHandler(OscMessage message) { float ax = message.GetFloat(0); float ay = message.GetFloat(1); float az = message.GetFloat(2); float gx = message.GetFloat(3); float gy = message.GetFloat(4); float gz = message.GetFloat(5); float mx = message.GetFloat(6); float my = message.GetFloat(7); float mz = message.GetFloat(8); accelerometer = new Vector3(ax, ay, az); gyroscope = new Vector3(gx, gy, gz); magnetometer = new Vector3(mx, my, mz); }
void OnReceiveZ(OscMessage message) { float z = message.GetFloat(0); print("valorZ_______" + z); valorVector.z = map(z, -70, 70, -25, 25); transform.localPosition = valorVector; print(valorVector.z); }
void OnReceiveAll(OscMessage message) { // var values = message.values; values.Count // output = message. ToFloat(); // output = "" + message.GetString(0); //output = "" + message.GetFloat(0); //output = message.values.; inputs[i] = message.GetFloat(i); // onOSCReceivedFloat.Invoke(message.GetFloat(0)); if (showAllMsgs) { print("osc: " + message.address + ", " + message.GetFloat(0)); //+ ", " + message.values } if (showMyPrefixMsgs) { if (message.address.Contains(prefix + "/")) { print("osc: " + message.address + ", " + message.GetFloat(0)); //+ ", " + message.values } } }
void OnReceiveY(OscMessage message) { float y = message.GetFloat(0); Vector3 position = transform.position; position.y = y; transform.position = originalCam + position; Debug.Log(y); }
void OnReceiveHandStatusLeft(OscMessage message) { ObjectGrabberControllerLeft ogc; float handStatus = message.GetFloat(0); if (IsObjectGrabberLeftSet(out ogc)) { ogc.setGrabState(handStatus == 1); cursorTransformLeft.gameObject.GetComponent <Image>().enabled = handStatus == 0 || ogc.currentSelectedObject == null; } }
//Recordar que esto hay que modificarlo!__K void OnReceiveX(OscMessage message) { float x = message.GetFloat(0); //valorVector = transform.position; valorVector.x = x; transform.position = valorVector; print(valorVector); }
void OnReceiveX(OscMessage message) { Debug.Log("Received X !"); float x = message.GetFloat(0); Vector3 position = transform.position; position.x = x; transform.position = position; }
void OnReceiveZ(OscMessage message) { float z = message.GetFloat(0); Vector3 position = transform.position; position.z = z; transform.position = originalCam + position; Debug.Log(z); }
void OnReceiveY(OscMessage message) { float y = message.GetFloat(0); print("valorY_______" + y); valorVector.y = map(y, 90, -90, -10, 10); transform.localPosition = valorVector; print(valorVector.y); }