unreal.GeometryScript_Collision¶
- class unreal.GeometryScript_Collision(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
BlueprintFunctionLibraryGeometry Script Library Collision Functions
C++ Source:
Plugin: GeometryScripting
Module: GeometryScriptingCore
File: CollisionFunctions.h
- classmethod approximate_convex_hulls_with_simpler_collision_shapes(simple_collision, approximate_options, debug=None) -> (simple_collision=GeometryScriptSimpleCollision, has_approximated=bool)¶
Attempt to approximate any convex hulls in the given simple collision representation. Updates the passed-in Simple Collision. Convex hulls that aren’t well approximated (to tolerances set in ApproximateOptions) will remain as convex hulls.
- Parameters:
simple_collision (GeometryScriptSimpleCollision) – The collision in which to attempt to approximate the convex hulls
approximate_options (GeometryScriptConvexHullApproximationOptions)
debug (GeometryScriptDebug)
- Returns:
simple_collision (GeometryScriptSimpleCollision): The collision in which to attempt to approximate the convex hulls
has_approximated (bool): Indicates whether any convex hulls were replaced with simpler approximations
- Return type:
tuple
- classmethod combine_simple_collision(collision_to_update, append_collision, debug=None) GeometryScriptSimpleCollision¶
Add simple collision shapes from AppendCollision to CollisionToUpdate
- Parameters:
collision_to_update (GeometryScriptSimpleCollision)
append_collision (GeometryScriptSimpleCollision)
debug (GeometryScriptDebug)
- Returns:
collision_to_update (GeometryScriptSimpleCollision):
- Return type:
- classmethod combine_simple_collision_array(simple_collision_array, debug=None) GeometryScriptSimpleCollision¶
Combine the SimpleCollisionArray collision shapes into a single SimpleCollision
- Parameters:
simple_collision_array (Array[GeometryScriptSimpleCollision])
debug (GeometryScriptDebug)
- Returns:
simple_collision (GeometryScriptSimpleCollision):
- Return type:
Compute the ‘navigable’ convex decomposition of an input mesh surface, i.e. a convex decomposition appropriate for a character of (or larger than) a given size
- Parameters:
target_mesh (DynamicMesh) – Mesh to decompose to convex hulls
options (NavigableConvexDecompositionOptions) – Options controlling the convex decomposition
debug (GeometryScriptDebug)
- Returns:
The resulting convex hulls as simple collision shapes
- Return type:
- classmethod compute_negative_space(mesh_bvh, negative_space_options, debug=None) GeometryScriptSphereCovering¶
Compute the negative space of an input mesh surface that should be protected when merging simple collision shapes
- Parameters:
mesh_bvh (GeometryScriptDynamicMeshBVH) – A Dynamic Mesh BVH structure of the surface for which we will compute negative space
negative_space_options (ComputeNegativeSpaceOptions) – Options controlling how the negative space is generated
debug (GeometryScriptDebug)
- Returns:
A set of spheres that cover the negative space of the input shape
- Return type:
- classmethod conv_geometry_script_sphere_covering_to_sphere_array(sphere_covering) Array[Sphere]¶
- Parameters:
sphere_covering (GeometryScriptSphereCovering)
- Returns:
An array of the spheres in the given Sphere Covering
- Return type:
- classmethod conv_sphere_array_to_geometry_script_sphere_covering(spheres) GeometryScriptSphereCovering¶
- Parameters:
- Returns:
A sphere covering containing the spheres in the given Spheres array
- Return type:
- classmethod generate_collision_from_mesh(from_dynamic_mesh, options, debug=None) GeometryScriptSimpleCollision¶
Generate Simple Collision shapes for an input Dynamic Mesh shape
- Parameters:
from_dynamic_mesh (DynamicMesh)
options (GeometryScriptCollisionFromMeshOptions)
debug (GeometryScriptDebug)
- Return type:
- classmethod get_simple_collision_from_component(component, debug=None) GeometryScriptSimpleCollision¶
Get the simple collision from a Primitive Component
- Parameters:
component (PrimitiveComponent)
debug (GeometryScriptDebug)
- Return type:
- classmethod get_simple_collision_from_static_mesh(static_mesh, debug=None) GeometryScriptSimpleCollision¶
Get the simple collision from a Static Mesh
- Parameters:
static_mesh (StaticMesh)
debug (GeometryScriptDebug)
- Return type:
- classmethod get_simple_collision_shape_count(simple_collision) int32¶
Count of number of simple collision shapes
- Parameters:
simple_collision (GeometryScriptSimpleCollision)
- Return type:
int32
- classmethod merge_simple_collision_shapes(simple_collision, merge_options, debug=None) -> (GeometryScriptSimpleCollision, has_merged=bool)¶
Attempt to merge collision shapes to create a representation with fewer overall shapes.
- Parameters:
simple_collision (GeometryScriptSimpleCollision) – The collision to attempt to simplify by merging shapes
merge_options (GeometryScriptMergeSimpleCollisionOptions) – Options controlling how shapes can be merged
debug (GeometryScriptDebug)
- Returns:
Simple Collision with collision shapes merged, as allowed by settings
has_merged (bool): Indicates whether any shapes have been merged
- Return type:
- classmethod reset_dynamic_mesh_collision(component, emit_transaction=False, debug=None) None¶
Clears Simple Collisions from the Dynamic Mesh Component.
- Parameters:
component (DynamicMeshComponent)
emit_transaction (bool)
debug (GeometryScriptDebug)
- classmethod reset_simple_collision(simple_collision) GeometryScriptSimpleCollision¶
Clears the Simple Collision shapes
- Parameters:
simple_collision (GeometryScriptSimpleCollision)
- Returns:
simple_collision (GeometryScriptSimpleCollision):
- Return type:
- classmethod set_dynamic_mesh_collision_from_mesh(from_dynamic_mesh, to_dynamic_mesh_component, options, debug=None) DynamicMesh¶
Generate Simple Collision shapes for a Dynamic Mesh Component based on the input Dynamic Mesh.
- Parameters:
from_dynamic_mesh (DynamicMesh)
to_dynamic_mesh_component (DynamicMeshComponent)
options (GeometryScriptCollisionFromMeshOptions)
debug (GeometryScriptDebug)
- Return type:
- classmethod set_simple_collision_of_dynamic_mesh_component(simple_collision, dynamic_mesh_component, options, debug=None) None¶
Set the simple collision on a Dynamic Mesh Component
- Parameters:
simple_collision (GeometryScriptSimpleCollision)
dynamic_mesh_component (DynamicMeshComponent)
options (GeometryScriptSetSimpleCollisionOptions)
debug (GeometryScriptDebug)
- classmethod set_simple_collision_of_static_mesh(simple_collision, static_mesh, options, static_mesh_collision_options=[True], debug=None) None¶
Set the simple collision on a Static Mesh
- Parameters:
simple_collision (GeometryScriptSimpleCollision)
static_mesh (StaticMesh)
options (GeometryScriptSetSimpleCollisionOptions)
static_mesh_collision_options (GeometryScriptSetStaticMeshCollisionOptions)
debug (GeometryScriptDebug)
- classmethod set_static_mesh_collision_from_component(static_mesh_asset, source_component, options=[True], static_mesh_collision_options=[True], debug=None) None¶
Copy the Simple Collision Geometry from the Source Component to the Static Mesh Asset.
- Parameters:
static_mesh_asset (StaticMesh)
source_component (PrimitiveComponent)
options (GeometryScriptSetSimpleCollisionOptions)
static_mesh_collision_options (GeometryScriptSetStaticMeshCollisionOptions)
debug (GeometryScriptDebug)
- classmethod set_static_mesh_collision_from_mesh(from_dynamic_mesh, to_static_mesh_asset, options, static_mesh_collision_options=[True], debug=None) DynamicMesh¶
Generates Simple Collision shapes for a Static Mesh Asset based on the input Dynamic Mesh.
- Parameters:
from_dynamic_mesh (DynamicMesh)
to_static_mesh_asset (StaticMesh)
options (GeometryScriptCollisionFromMeshOptions)
static_mesh_collision_options (GeometryScriptSetStaticMeshCollisionOptions)
debug (GeometryScriptDebug)
- Return type:
- classmethod set_static_mesh_custom_complex_collision(static_mesh_asset, static_mesh_collision_asset, emit_transaction, mark_collision_as_customized=True, debug=None) bool¶
Set a static mesh as the custom collision for another static mesh to use. Note: Only works if editor-only data is available.
- Parameters:
static_mesh_asset (StaticMesh)
static_mesh_collision_asset (StaticMesh)
emit_transaction (bool)
mark_collision_as_customized (bool)
debug (GeometryScriptDebug)
- Returns:
true on success.
- Return type:
- classmethod simplify_convex_hulls(simple_collision, simplify_options, debug=None) -> (simple_collision=GeometryScriptSimpleCollision, has_simplified=bool)¶
Simplify any convex hulls in the given simple collision representation. Updates the passed-in Simple Collision.
- Parameters:
simple_collision (GeometryScriptSimpleCollision) – The collision in which to attempt to simplify the convex hulls
simplify_options (GeometryScriptConvexHullSimplificationOptions)
debug (GeometryScriptDebug)
- Returns:
simple_collision (GeometryScriptSimpleCollision): The collision in which to attempt to simplify the convex hulls
has_simplified (bool): Indicates whether any convex hulls were modified
- Return type:
tuple
- classmethod static_mesh_has_customized_collision(static_mesh_asset) bool¶
- Parameters:
static_mesh_asset (StaticMesh)
- Returns:
true if the static mesh has customized collision. If no editor data is available, returns false.
- Return type:
- classmethod transform_simple_collision_shapes(simple_collision, transform, transform_options, debug=None) -> (GeometryScriptSimpleCollision, success=bool)¶
Transform simple collision shapes
- Parameters:
simple_collision (GeometryScriptSimpleCollision)
transform (Transform)
transform_options (GeometryScriptTransformCollisionOptions)
debug (GeometryScriptDebug)
- Returns:
success (bool): Indicates whether all collision shapes were accurately transformed. On failure, shapes will still be copied over and a best-effort transform will still be applied.
- Return type: