Grouping models (Array?)

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Xenocide

Grouping models (Array?)

Post by Xenocide »

I'm making a RTS (real-time strategy) game, and I have it setup so you command small fleets of star fighters. How would I go about grouping a lot of fighters together so they move as one and such? Like a model array or something...if one exists.
zgock
Posts: 12
Joined: Wed Sep 29, 2004 2:06 pm
Location: Japan
Contact:

Post by zgock »

1. create empty Scene Node by addEmptySceneNode
2. add any Scene Node setting parent = emptySceneNode created on 1

enjoy :wink:
Xenocide

Post by Xenocide »

Could you be more specific? My game crashes when I try to move the node.
Here's how I'm trying to do it...

Code: Select all

scene::ISceneNode* parent = 0;
sm->addEmptySceneNode(parent);
model->setParent(parent);
parent->setPosition(core::vector3df(0,0,0));
[/code]
XargoL
Posts: 22
Joined: Sun Aug 01, 2004 7:55 pm

Post by XargoL »

I think it is

Code: Select all

scene::ISceneNode* parent = sm->addEmptySceneNode();
model->setParent(parent);
parent->setPosition(core::vector3df(0,0,0));
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

That's just the same :P.
I would personally use parent->addChild() (seems more logical to me).
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Xenocide

Post by Xenocide »

addChild crashes too. :cry: (parent->addChild(child node)?)
zgock
Posts: 12
Joined: Wed Sep 29, 2004 2:06 pm
Location: Japan
Contact:

Post by zgock »

here is example (shoot em game)
mothership is build by this tech.
(cannot read readme in this zip? yes shouldbe. cos written in japanese)

http://gamdev.org/up/img/955.zip
Xenocide

Post by Xenocide »

that just confused me further :(
Post Reply