XNA Game Development Forums
2012/05/21 20:32:19 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Calendar Login Register  
Pages: [1]
  Print  
Author Topic: Post Tutorial 8 - advice needed!  (Read 2245 times)
solthar
Newbie
*
Offline Offline

Posts: 4


View Profile
« on: 2008/09/02 21:00:55 »

Well, I've completed all the current XNA tutorials ( up to the 8th), and now I have a rather burning question...

How the heck do I go about modifying an object once it has been added to the objectmanager?

For instance, let's say that I want an object to move left on keypress - the InputManager part of things makes perfect sense to me, but the ObjectManager seems to be a riddle inside a mystery wrapped in an enigma...  No matter how I look at it, I can't seem to identify the proper way of access an object from it.

Looking at all the example code, also, I notice that they never do anything with the objects themselves - just the camera.

So, any advice on this front? Am I missing something stupidly simple (again)?

Thanks in advance!
Logged
Nemo Krad
Global Moderator
Hero Member
*****
Offline Offline

Posts: 512


I have seen the fnords


View Profile WWW
« Reply #1 on: 2008/09/03 02:00:10 »

It's been a while since I looked at the tutorials, but in my version of the manager I am sure I added the ability to give each object a name in the list so I could pull them out by name, that way I can get the exact model I want any time and do what I need with it.

I really need to get some time to get back into this engine, Mike, sorry I have not been around, life kind of overtakes you some times.

I'll have to get onto the SVN at some point and get some stuff up there...

solthar, let me know if you need more detail and I will get some sample code up here to show what I mean.
Logged
solthar
Newbie
*
Offline Offline

Posts: 4


View Profile
« Reply #2 on: 2008/09/03 09:37:29 »

I think I know what you're talking about, but yeah - I wouldn't mind a touch more detail  Grin.

thanks!
Logged
mikeschuld
Administrator
Sr. Member
*****
Offline Offline

Posts: 389


View Profile WWW
« Reply #3 on: 2008/09/03 10:38:46 »

I will probably be adding the dictionary functionality into the XNA 3.0 version of the tutorials as well. There are a few other things (broken ones Wink) that I found in some places that are being fixed or replaced in those versions as well. Hopefully I will have them all done and updated by the public release! Smiley
Logged
Nemo Krad
Global Moderator
Hero Member
*****
Offline Offline

Posts: 512


I have seen the fnords


View Profile WWW
« Reply #4 on: 2008/09/03 13:34:08 »

solthar,

I added a name property to the ObjectNode

Code:
        private string myName;
        public string Name
        {
            get { return myName; }
        }

Then in the RCSceneGraph I have

Code:
public RCObjectNode GetObject(string Name) [...]
public void RemoveObject(string name) [...]
public void SetObject(string name, RCObject newObject) [...]

So when adding an object I call SetObject
Code:
        public void SetObject(string name, RCObject newObject)
        {
            for (int on = 0; on < myRoot.Nodes.Count; on++)
            {
                if (((RCObjectNode)myRoot.Nodes[on]).Name == name)
                    myRoot.Nodes[on] = new RCObjectNode(newObject,name);
            }
        }

When retreiving an object
Code:
        public RCObjectNode GetObject(string Name)
        {           
            for(int on=0;on<myRoot.Nodes.Count;on++)
            {
                if (((RCObjectNode)myRoot.Nodes[on]).Name == Name)
                    return (RCObjectNode)myRoot.Nodes[on];
            }
            return null;
        }
Logged
solthar
Newbie
*
Offline Offline

Posts: 4


View Profile
« Reply #5 on: 2008/09/03 20:47:57 »

I guess I should add a request for a scenegraph tutorial in the XNA request section Wink.    As what i've got has no scenegraph - and to be quite honest, I'm rather lacking in regards as to how I should go about implimenting one.

Heh, ah well - I guess I'm ad libing this one.
Logged
Pages: [1]
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Tutorial 14 Hazy Mind 3D Engine serus 3 3901 Last post 2008/12/19 10:32:01
by mikeschuld
Next Tutorial Hazy Mind XNA Engine mikeschuld 12 4871 Last post 2006/11/12 15:40:51
by mikeschuld
Having issues with tutorial 3 Hazy Mind XNA Engine siferion 4 2377 Last post 2006/11/26 14:04:03
by mikeschuld
Tutorial 8 :: Post Processing Framework Tutorial Discussion « 1 2 3 4 » Chr0n1x 59 18080 Last post 2007/06/15 03:41:52
by Chr0n1x
Working on tutorial 7 Hazy Mind 3D Engine tuxdalinux 6 2572 Last post 2006/12/11 17:37:02
by tuxdalinux
Strange Problem ( Advice/Assistance Needed Please :-) ) General Discussion DaphydTheBard 4 1778 Last post 2007/03/17 10:23:52
by DaphydTheBard
Tutorial 3 Hazy Mind XNA Engine hansonc 4 2482 Last post 2007/03/27 09:23:23
by hansonc
Post Processing Hazy Mind XNA Engine Robin Sarac 3 1595 Last post 2007/04/21 19:23:20
by Arkcann
Tutorial 2 Hazy Mind XNA Engine Classicwarrior 5 2687 Last post 2008/05/17 23:01:31
by Classicwarrior
Powered by MySQL Powered by PHP Powered by SMF 1.1.12 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.595 seconds with 19 queries.