Sign in to follow this  
Synthesizer

C# - store a "reference" of an object : performance killer?

Recommended Posts

Synthesizer    188
Hi,

I've been programming in C# for a long time & one thing I'd love to have there (optionally) are pointers.

I've been developing a game project for several years, & I usually declare attributes in my classes in order to store other handy objects.
For example, I've created a custom ModelMesh in which I store it's parent (container) Model:

class ExtendedModelMesh()
{
-Model theModelWhoContainsMe;
}

I do this for example to be able to access easy & quickly to the model's position, rotation, scale attributes & some other things.


My question is: Is it a performance killer? (in this particular case I store the same model along all it's meshes (imagine 150 meshes per model).
Is it not only eating a lot of memory but also slowing down things when fetching up the model?

Thanks a lot,

Synth

Share this post


Link to post
Share on other sites
Synthesizer    188
Good to know that!
Thanks a lot, that was an ultrasonic speed answer!! [img]http://public.gamedev.net//public/style_emoticons/default/laugh.png[/img]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this