2
0
Эх сурвалжийг харах

Do not show the internal TerrainPatch & SmoothedTransform components in editor creation menu.
Fixed reconstruction of the TerrainPatch's occlusion transform.

Lasse Öörni 12 жил өмнө
parent
commit
c6a38db74f

+ 5 - 3
Engine/Graphics/TerrainPatch.cpp

@@ -70,7 +70,7 @@ TerrainPatch::~TerrainPatch()
 
 void TerrainPatch::RegisterObject(Context* context)
 {
-    context->RegisterFactory<TerrainPatch>(GEOMETRY_CATEGORY);
+    context->RegisterFactory<TerrainPatch>();
 }
 
 void TerrainPatch::ProcessRayQuery(const RayOctreeQuery& query, PODVector<RayQueryResult>& results)
@@ -205,8 +205,10 @@ bool TerrainPatch::DrawOcclusion(OcclusionBuffer* buffer)
     if (!vertexData || !indexData)
         return true;
     
-    Matrix3x4 occlusionTransform(node_->GetWorldPosition() + node_->GetWorldTransform() * Vector4(0.0f, occlusionOffset_, 0.0f,
-        0.0f), node_->GetWorldRotation(), node_->GetWorldScale());
+    const Matrix3x4& worldTransform = node_->GetWorldTransform();
+    
+    Matrix3x4 occlusionTransform(worldTransform.Translation() + worldTransform * Vector4(0.0f, occlusionOffset_, 0.0f,
+        0.0f), worldTransform.Rotation(), worldTransform.Scale());
     
     // Draw and check for running out of triangles
     return buffer->Draw(occlusionTransform, vertexData, vertexSize, indexData, indexSize, minLodGeometry_->GetIndexStart(),

+ 1 - 3
Engine/Scene/SmoothedTransform.cpp

@@ -31,8 +31,6 @@
 namespace Urho3D
 {
 
-static const char* NETWORK_CATEGORY = "Network";
-
 OBJECTTYPESTATIC(SmoothedTransform);
 
 SmoothedTransform::SmoothedTransform(Context* context) :
@@ -50,7 +48,7 @@ SmoothedTransform::~SmoothedTransform()
 
 void SmoothedTransform::RegisterObject(Context* context)
 {
-    context->RegisterFactory<SmoothedTransform>(NETWORK_CATEGORY);
+    context->RegisterFactory<SmoothedTransform>();
 }
 
 void SmoothedTransform::Update(float constant, float squaredSnapThreshold)