Scene graph

Started by
11 comments, last by kunos 10 years, 11 months ago

that has nothing to do with loading 1, 10, 100 or 1 million objects.

That's just a problem trying to upcast and Effect into something that is not (a BasicEffect), just as the error message is complaining about.

The rest of the thread doesn't make a lot of sense either... unless you want to draw 1 million zombies in the same pose, you'll need to draw them separately.

Having the animation data shared for all the zombies or one for every zombie is a memory problem.. are you having problems with memory? If you have, I bet there are MANY other places eating up your memory.. but seriously, considering the fact that you can't understand a simple error message like that means you don't have problems with memory solvable by sharing animation data.. so my suggestion is.. keep coding and forget about all this.

Stefano Casillo
TWITTER: [twitter]KunosStefano[/twitter]
AssettoCorsa - netKar PRO - Kunos Simulazioni

Advertisement

kunos thanks , so I did not see your advice and answer for my problem !! I still can't figure out the problem as show in the picture above !!

well.. sorry to be blunt, but if you dont understand why a cast is failing at runtime you should go back to basics and study C#, inheritance and all that before moving on.

Let's have a base class Effect, and then BasicEffect and CustomEffect derived from that. You cannot cast an Effect into a BasicEffect if that is pointing to a CustomEffect... .NET is gentle enough to point that out for you.

Stefano Casillo
TWITTER: [twitter]KunosStefano[/twitter]
AssettoCorsa - netKar PRO - Kunos Simulazioni

This topic is closed to new replies.

Advertisement