Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Oni Contacts - is there a way to extend the data?
#1
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:
   

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
Reply
#2
(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.
Reply