|
@@ -63,7 +63,6 @@ Renderer2D::Renderer2D(Context* context) :
|
|
|
Drawable(context, DRAWABLE_GEOMETRY),
|
|
Drawable(context, DRAWABLE_GEOMETRY),
|
|
|
material_(new Material(context)),
|
|
material_(new Material(context)),
|
|
|
indexBuffer_(new IndexBuffer(context_)),
|
|
indexBuffer_(new IndexBuffer(context_)),
|
|
|
- frustum_(0),
|
|
|
|
|
viewMask_(DEFAULT_VIEWMASK)
|
|
viewMask_(DEFAULT_VIEWMASK)
|
|
|
{
|
|
{
|
|
|
material_->SetName("Urho2D");
|
|
material_->SetName("Urho2D");
|
|
@@ -273,10 +272,7 @@ bool Renderer2D::CheckVisibility(Drawable2D* drawable) const
|
|
|
return false;
|
|
return false;
|
|
|
|
|
|
|
|
const BoundingBox& box = drawable->GetWorldBoundingBox();
|
|
const BoundingBox& box = drawable->GetWorldBoundingBox();
|
|
|
- if (frustum_)
|
|
|
|
|
- return frustum_->IsInsideFast(box) != OUTSIDE;
|
|
|
|
|
-
|
|
|
|
|
- return frustumBoundingBox_.IsInsideFast(box) != OUTSIDE;
|
|
|
|
|
|
|
+ return frustum_.IsInsideFast(box) != OUTSIDE;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void Renderer2D::OnWorldBoundingBoxUpdate()
|
|
void Renderer2D::OnWorldBoundingBoxUpdate()
|
|
@@ -336,13 +332,7 @@ void Renderer2D::HandleBeginViewUpdate(StringHash eventType, VariantMap& eventDa
|
|
|
URHO3D_PROFILE(UpdateRenderer2D);
|
|
URHO3D_PROFILE(UpdateRenderer2D);
|
|
|
|
|
|
|
|
Camera* camera = static_cast<Camera*>(eventData[P_CAMERA].GetPtr());
|
|
Camera* camera = static_cast<Camera*>(eventData[P_CAMERA].GetPtr());
|
|
|
- frustum_ = &camera->GetFrustum();
|
|
|
|
|
- if (camera->IsOrthographic() && camera->GetNode()->GetWorldDirection() == Vector3::FORWARD)
|
|
|
|
|
- {
|
|
|
|
|
- // Define bounding box with min and max points
|
|
|
|
|
- frustumBoundingBox_.Define(frustum_->vertices_[2], frustum_->vertices_[4]);
|
|
|
|
|
- frustum_ = 0;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ frustum_ = camera->GetFrustum();
|
|
|
viewMask_ = camera->GetViewMask();
|
|
viewMask_ = camera->GetViewMask();
|
|
|
|
|
|
|
|
// Check visibility
|
|
// Check visibility
|