Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the recommended class for representing a box?

Tags:

c++

3d

ogre

In Ogre, there's a class Ogre::Box that looks like it can support a three-dimensional box. However, this class is using a size_t data type for storage of its coordinates. Since size_t is essentially an unsigned integer, it cannot handle negative numbers, and so using it for any real geometry is not possible. I know I can just keep a few numbers or invent a homebrew box class by myself, but what is the usual Ogre way of doing this? Also, I don't care if the box is using integers or floats for storage, it just happens so that it doesn't matter for the task at hand.

like image 751
Septagram Avatar asked Oct 22 '22 15:10

Septagram


1 Answers

You can have a look at Ogre::AxisAlignedBox. If you are looking for a class representing a cube as mesh, you won't find it. However, there is a convenience class which creates an Ogre::Mesh for you: Ogre::PrefabFactory

like image 108
c_k Avatar answered Oct 28 '22 22:10

c_k