Page 1 of 1
Grouping models (Array?)
Posted: Sat Oct 09, 2004 4:01 am
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.
Posted: Sat Oct 09, 2004 6:01 am
by zgock
1. create empty Scene Node by addEmptySceneNode
2. add any Scene Node setting parent = emptySceneNode created on 1
enjoy

Posted: Sat Oct 09, 2004 7:39 am
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]
Posted: Sat Oct 09, 2004 8:19 am
by XargoL
I think it is
Code: Select all
scene::ISceneNode* parent = sm->addEmptySceneNode();
model->setParent(parent);
parent->setPosition(core::vector3df(0,0,0));
Posted: Sat Oct 09, 2004 8:36 am
by bal
That's just the same

.
I would personally use parent->addChild() (seems more logical to me).
Posted: Sat Oct 09, 2004 5:26 pm
by Xenocide
addChild crashes too.

(parent->addChild(child node)?)
Posted: Sat Oct 09, 2004 7:47 pm
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
Posted: Sat Oct 09, 2004 11:40 pm
by Xenocide
that just confused me further
