Browse Source

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

Lasse Öörni 12 years ago
parent
commit
c6a38db74f
2 changed files with 6 additions and 6 deletions
  1. 5 3
      Engine/Graphics/TerrainPatch.cpp
  2. 1 3
      Engine/Scene/SmoothedTransform.cpp

+ 5 - 3
Engine/Graphics/TerrainPatch.cpp

@@ -70,7 +70,7 @@ TerrainPatch::~TerrainPatch()
 
 
 void TerrainPatch::RegisterObject(Context* context)
 void TerrainPatch::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<TerrainPatch>(GEOMETRY_CATEGORY);
+    context->RegisterFactory<TerrainPatch>();
 }
 }
 
 
 void TerrainPatch::ProcessRayQuery(const RayOctreeQuery& query, PODVector<RayQueryResult>& results)
 void TerrainPatch::ProcessRayQuery(const RayOctreeQuery& query, PODVector<RayQueryResult>& results)
@@ -205,8 +205,10 @@ bool TerrainPatch::DrawOcclusion(OcclusionBuffer* buffer)
     if (!vertexData || !indexData)
     if (!vertexData || !indexData)
         return true;
         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
     // Draw and check for running out of triangles
     return buffer->Draw(occlusionTransform, vertexData, vertexSize, indexData, indexSize, minLodGeometry_->GetIndexStart(),
     return buffer->Draw(occlusionTransform, vertexData, vertexSize, indexData, indexSize, minLodGeometry_->GetIndexStart(),

+ 1 - 3
Engine/Scene/SmoothedTransform.cpp

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