IncludeCollision

IncludeCollision

#Overview

name: IncludeCollision

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of IncludeCollision is to control whether collision data should be imported and included when importing SpeedTree assets into Unreal Engine.

This setting variable is primarily used by the SpeedTree Importer plugin, which is part of the Unreal Engine editor tools. It’s specifically related to the mesh and physics systems, as it determines whether collision objects from SpeedTree assets should be converted into collision data for static meshes in Unreal Engine.

The value of this variable is set in the SpeedTreeImportData class, which is a subclass of UAssetImportData. It’s defined as a bit field within a UPROPERTY, meaning it can be edited in the Unreal Engine editor and is also configurable.

IncludeCollision interacts with other import settings in the SpeedTreeImportData class, such as ImportGeometryType, LODType, and various other import options like MakeMaterialsCheck, IncludeNormalMapCheck, etc. These settings collectively determine how SpeedTree assets are imported and processed.

Developers must be aware that:

  1. This setting only applies to SpeedTree version 8 assets, as indicated by the meta tag in the property definition.
  2. Enabling this option will increase the complexity of the imported mesh by adding collision data, which may impact performance.
  3. The collision data is created based on the collision objects provided by the SpeedTree asset.

Best practices when using this variable include:

  1. Only enable IncludeCollision when you actually need collision for the imported SpeedTree asset in your game.
  2. Consider the performance implications of including collision, especially for complex SpeedTree assets or when importing a large number of assets.
  3. Verify the imported collision data to ensure it meets your game’s requirements, as the automatic import may not always produce ideal results.
  4. Use this in conjunction with other import settings to achieve the desired balance between visual fidelity, physics accuracy, and performance.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:943, section: [/Script/SpeedTreeImporter.SpeedTreeImportData]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/Editor/SpeedTreeImporter/Source/SpeedTreeImporter/Classes/SpeedTreeImportData.h:61

Scope (from outer to inner):

file
class        class USpeedTreeImportData : public UAssetImportData

Source code excerpt:

	/**  */
	UPROPERTY(EditAnywhere, config, Category=Mesh, meta = (DisplayName = "Include Collision", SpeedTreeVersion = "8"))
	uint32 IncludeCollision : 1;

	/**  */
	UPROPERTY(EditAnywhere, config, Category=Materials, meta = (DisplayName = "Create Materials", SpeedTreeVersion = "8"))
	uint32 MakeMaterialsCheck : 1;
	
	/**  */

#Loc: <Workspace>/Engine/Plugins/Editor/SpeedTreeImporter/Source/SpeedTreeImporter/Private/SpeedTreeImportData.cpp:39

Scope (from outer to inner):

file
function     void USpeedTreeImportData::CopyFrom

Source code excerpt:

	ImportGeometryType = Other->ImportGeometryType;
	LODType = Other->LODType;
	IncludeCollision = Other->IncludeCollision;
	MakeMaterialsCheck = Other->MakeMaterialsCheck;
	IncludeNormalMapCheck = Other->IncludeNormalMapCheck;
	IncludeDetailMapCheck = Other->IncludeDetailMapCheck;
	IncludeSpecularMapCheck = Other->IncludeSpecularMapCheck;
	IncludeBranchSeamSmoothing = Other->IncludeBranchSeamSmoothing;
	IncludeSpeedTreeAO = Other->IncludeSpeedTreeAO;

#Loc: <Workspace>/Engine/Plugins/Editor/SpeedTreeImporter/Source/SpeedTreeImporter/Private/SpeedTreeImportFactory.cpp:2427

Scope (from outer to inner):

file
function     UObject* USpeedTreeImportFactory::FactoryCreateBinary7

Source code excerpt:

				StaticMesh->Build();

				if (SpeedTreeImportData->IncludeCollision)
				{
					int32 NumCollisionObjects = 0;
					const SpeedTree::SCollisionObject* CollisionObjects = SpeedTree.GetCollisionObjects(NumCollisionObjects);
					if (CollisionObjects != NULL && NumCollisionObjects > 0)
					{
						MakeBodyFromCollisionObjects7(StaticMesh, CollisionObjects, NumCollisionObjects);

#Loc: <Workspace>/Engine/Plugins/Editor/SpeedTreeImporter/Source/SpeedTreeImporter/Private/SpeedTreeImportFactory.cpp:2806

Scope (from outer to inner):

file
function     UObject* USpeedTreeImportFactory::FactoryCreateBinary8

Source code excerpt:


		// collision objects
		if (SpeedTreeImportData->IncludeCollision)
		{
			MakeBodyFromCollisionObjects8(StaticMesh, SpeedTree.CollisionObjects());
		}
		else
		{
			StaticMesh->CreateBodySetup();