FMOD.Geometry.setRotation C# (CSharp) Method

setRotation() public method

public setRotation ( VECTOR &forward, VECTOR &up ) : RESULT
forward VECTOR
up VECTOR
return RESULT
        public RESULT setRotation           (ref VECTOR forward, ref VECTOR up)
        {
            return FMOD_Geometry_SetRotation(rawPtr, ref forward, ref up);
        }
        public RESULT getRotation           (out VECTOR forward, out VECTOR up)

Usage Example

Example #1
0
    // Start is called before the first frame update
    void Start()
    {
        SoundSystem.instance.ErrorCheck(SoundSystem.instance.GetSoundSystem().createGeometry(1, 4, out _geometry));

        // Cogemos la rotación y la posición
        FMOD.VECTOR position = FMODUnity.RuntimeUtils.ToFMODVector(gameObject.transform.position);
        FMOD.VECTOR forward  = FMODUnity.RuntimeUtils.ToFMODVector(gameObject.transform.forward);
        FMOD.VECTOR up       = FMODUnity.RuntimeUtils.ToFMODVector(gameObject.transform.up);

        //Ponemos la pared en la posición y mirando hacia donde mira el gameobject
        _geometry.setPosition(ref position);
        _geometry.setRotation(ref forward, ref up);

        Vector3 size = gameObject.transform.localScale;

        FMOD.VECTOR[] vertices = new FMOD.VECTOR[4];
        vertices[0].x = ((-size.x / 2));
        vertices[0].y = (size.y);
        vertices[0].z = 0;
        vertices[1].x = ((size.x / 2));
        vertices[1].y = (size.y);
        vertices[1].z = 0;
        vertices[2].x = ((size.x / 2));
        vertices[2].y = (-size.y);
        vertices[2].z = 0;
        vertices[3].x = ((-size.x / 2));
        vertices[3].y = (-size.y);
        vertices[3].z = 0;

        SoundSystem.instance.ErrorCheck(_geometry.addPolygon(directOcclusion, reverbOcclusion, true, 4, vertices, out _polygonIndex));
    }