Esempio n. 1
0
    /// Get the world space bounding box for the object
    BBoxf SceneObject::getTransformedBoundingBox() const
    {
        if ( mSceneNode )
        {
            BBoxf box = mSceneNode->getTransformedBoundingBox();
            return BBoxf( ConvertIrrlichtToNeroPosition( box.MinEdge),
                         ConvertIrrlichtToNeroPosition( box.MaxEdge) );
        }

        return BBoxf();
    }
Esempio n. 2
0
 void Entity::validateGeometry() const {
     assert(!m_geometryValid);
     
     if (m_definition == NULL || m_definition->type() == EntityDefinition::BrushEntity) {
         if (!m_brushes.empty()) {
             m_bounds = m_brushes[0]->bounds();
             for (unsigned int i = 1; i < m_brushes.size(); i++)
                 m_bounds.mergeWith(m_brushes[i]->bounds());
         } else {
             m_bounds = BBoxf(Vec3f(-8, -8, -8), Vec3f(8, 8, 8));
             m_bounds.translate(origin());
         }
     } else {
         PointEntityDefinition* pointDefinition = static_cast<PointEntityDefinition*>(m_definition);
         m_bounds = pointDefinition->bounds();
         m_bounds.translate(origin());
     }
     
     m_center = m_bounds.center();
     m_geometryValid = true;
 }
PhysicsBodyf::PhysicsBodyf() {
  objects = new Array<PhysicsObjectf*>();
  bbox = BBoxf();
  proximity = 0.0f;
}
BBoxf Geometryf::getBBox() {
  // to be extended
  return BBoxf();
}
BBoxf TriMeshf::getBBox() {
  // to be implemented
  return BBoxf();
}