-
I am creating a physics library where each body can emit sound. CORE CLASS:
BODY:
Which would be the best practice to create an "ma_engine"? Thanks so much and hopefully this is understandable! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There's no single right answer. It's up to you to decide what works best for your own project, but here's some answers to your questions.
You should only ever have a single
Up to you, but yes storing a pointer to the engine object in the physics body object might be a good option. So long as they have visibility of the
Up to you, but be careful with this. The address of your |
Beta Was this translation helpful? Give feedback.
-
Nice, that's the answer I was looking for. Thanks so much for the response! |
Beta Was this translation helpful? Give feedback.
There's no single right answer. It's up to you to decide what works best for your own project, but here's some answers to your questions.
You should only ever have a single
ma_engine
object for your whole program. You want manyma_sound
's to onema_engine
. You should absolutely not have onema_engine
for each physics body.Up to you, but yes storing a pointer to the engine object in the physics body object might be a good option. So long as they have visibility of the
ma_engine
object it shouldn'…