How to add an entity dynamically?

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
Posts: 2
Joined: Mon Jul 25, 2022 2:33 pm

How to add an entity dynamically?

Post by caoyanfeng »

I have read the official guide, such as ... scene.html.
I want to know how to dynamically create a node and add a entity. Is it added in this callback ?

Code: Select all

bool frameStarted(const Ogre::FrameEvent& evt)

If the answer is yes,I doubt whether adding too much code will cause frame delay ?

Posts: 530
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 38

Re: How to add an entity dynamically?

Post by Lax »


you can add your entity where you want. If you derive from FrameListener, you can add your entity each frame in the FrameStarted function. Or you write your own game loop and call RenderOneFrame from Ogre and add your entity...

See also this page for some tutorials:

Best Regards
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: ... b97b79be62

Post Reply