Obi Official Forum

Full Version: Oni Contacts - is there a way to extend the data?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
(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.