Obi Official Forum
Oni Contacts - is there a way to extend the data? - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html)
+--- Thread: Oni Contacts - is there a way to extend the data? (/thread-1376.html)



Oni Contacts - is there a way to extend the data? - TimLewis - 19-09-2019

Hi there!

I'm trying to extend the Oni Contacts data struct to include a further variable

[attachment=406]

I'm wondering if there's a way to populate this when the Contact data gets set?

I have a BitMask variable that is in ObiEmitter that denotes what FluidType the fluid counts as:
[attachment=407]

And another FluidType variable which denotes what fluid containers accept (ie. wine glasses accept wine fluid).

I'm hoping there's a way to do this, as I'm trying to parallelise, into jobs, the logic to sort the contacts into containers - so I don't have the option of grabbing the particle emitter from Obi Solver.

Thanks in advance for all your help.

Tim


RE: Oni Contacts - is there a way to extend the data? - josemendez - 05-10-2019

(19-09-2019, 03:30 PM)TimLewis Wrote: Hi there!

I'm trying to extend the Oni Contacts data struct to include a further variable



I'm wondering if there's a way to populate this when the Contact data gets set?

I have a BitMask variable that is in ObiEmitter that denotes what FluidType the fluid counts as:


And another FluidType variable which denotes what fluid containers accept (ie. wine glasses accept wine fluid).

I'm hoping there's a way to do this, as I'm trying to parallelise, into jobs, the logic to sort the contacts into containers - so I don't have the option of grabbing the particle emitter from Obi Solver.

Thanks in advance for all your help.

Tim

Hi,

You should not modify the contact struct, as it the C++ size of things assumes a certain memory layout (hence the StructLayout attribute). Modifying it or changing its size will result in undefined behavior --> most likely an instant crash if you're lucky, or memory corruption.

There's currently no way to extend contacts with user-defined data.