If Object Exists?

Editor
Feb 8, 2010 at 10:43 PM
Edited Feb 8, 2010 at 11:11 PM

is there a way to check if a component exists?

im going to use "marker" objects to populate a terrain with scenery(trees/shrubs), and i want it to be universal, but also "toggleable" (new word) so that if the markers arent built in the scene editor, the engine wont search for them, causing an error.

thanks.

bubzy

edit - if i use one of my *AWESOME* (cough), custom created models, and load it in, its black, as if it has no lighting, what am i doing wrong.

ty

 

Coordinator
Feb 9, 2010 at 1:30 AM

hey bubz~!

Engine.ContainsComponent should do fine :)

I really can't tell from here what might be wrong with your model. If you like, you can send the model to me and I can check it out. You might first try opening the model up in the DirectX viewer to see if it appears as you expect.

Cheers!

Editor
Feb 9, 2010 at 6:47 AM

http://www.greymatterscomic.com/oxgameengine/OxGame11.zip

 

heres the file in its context. the file "cube.x" is one model that im having trouble with and the file www.x has similar problems, both look ok in dxviewer.

thanks mate (sorry for messy code) :)

Coordinator
Feb 9, 2010 at 4:49 PM

The model is certainly going to render black without any diffuse texturing. Neither XNA's out-of-box BasicEffect nor Ox's standard effects use the vertex Color property for rendering, so the color you apply to mesh parts isn't going to apply.

Just use uv diffuse texture mapping :)

 

Editor
Feb 9, 2010 at 7:22 PM

well, thats a lot of work for sure :D now im an expert in lithunwrap and softmod :) thanks for the pointers mate