Version: Unity 6.6 Alpha (6000.6)
LanguageEnglish
  • C#

PhysicsSpace.Clone

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public int Clone(PhysicsWorld world, QueryFilter filter, bool destroyExistingProxies);

Parameters

Parameter Description
world The world to find the PhysicsShape in.
filter The filter to control what proxies are created.
destroyExistingProxies Controls if any existing proxies are destroyed before cloning from the specified world. If false, care should be taken that any existing proxies refer to PhysicsShape otherwise a mix of user-handles will be present.

Returns

int How many proxies were cloned.

Description

Clear any existing proxies and clone all PhysicsShape found in the specified PhysicsWorld. Each proxy created will have a user-handle assigned as PhysicsShape.physicsHandle. This means you can get the referenced shape by using PhysicsShape.PhysicsShape.


Declaration

public int Clone(PhysicsWorld world, QueryFilter filter, PhysicsAABB aabb, bool destroyExistingProxies);

Parameters

Parameter Description
world The world to find the PhysicsShape in.
aabb The AABB used to discover PhysicsShape in the specified world. If the AABB size is size (default) then the whole world will be discovered.
filter The filter to control what proxies are created.
destroyExistingProxies Controls if any existing proxies are destroyed before cloning from the specified world. If false, care should be taken that any existing proxies refer to PhysicsShape otherwise a mix of user-handles will be present.

Returns

int How many proxies were cloned.

Description

Clear any existing proxies and clone any PhysicsShape found in the specified PhysicsWorld overlapping the specified PhysicsAABB. Each proxy created will have a user-handle assigned as PhysicsShape.physicsHandle. This means you can get the referenced shape by using PhysicsShape.PhysicsShape.