Entity displayed in viewport

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
kubatp
Gnome
Posts: 368
Joined: Tue Jan 06, 2009 1:12 pm
x 43

Entity displayed in viewport

Post by kubatp »

Hi,
I have very basic question and I hope there is also very basic answer:)
Is there a way how to find out if entity or its sceneNode is currently displayed in viewport/camera?

Basically I have animals running around and I want to stop calculating their moving curves and calculate it only lets say every hundredth frame and jump directly to the new position.

If there are more options, which is the most performance considerate?

Thank you for help
kubatp
Gnome
Posts: 368
Joined: Tue Jan 06, 2009 1:12 pm
x 43

Re: Entity displayed in viewport

Post by kubatp »

I found one way of doing this:

Code: Select all

Camera.IsVisible(entity.GetWorldBoundingBox())
However, I am not sure how performance considerate this method is.

What would be the performance impact of using this for hundreds of entities every frame and are there any other ways?
kubatp
Gnome
Posts: 368
Joined: Tue Jan 06, 2009 1:12 pm
x 43

Re: Entity displayed in viewport

Post by kubatp »

I am surprised that noone had similar problem:)
Post Reply