Version: Unity 6.7 Alpha (6000.7)
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. On a world-bound space this must be the world the space is bound to.
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. On a world-bound space this must be the world the space is bound to.
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.


Declaration

public int Clone(QueryFilter filter, bool destroyExistingProxies);

Parameters

Parameter Description
filter The filter to control what proxies are created.
destroyExistingProxies Controls if any existing proxies are destroyed before cloning from the bound 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 every PhysicsShape found in the world this space is bound to. Each proxy created will have a user-handle assigned as PhysicsShape.physicsHandle. This only applies to a space bound to a world.


Declaration

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

Parameters

Parameter Description
aabb The AABB used to discover PhysicsShape in the bound 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 bound 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 world this space is bound to overlapping the specified PhysicsAABB. Each proxy created will have a user-handle assigned as PhysicsShape.physicsHandle. This only applies to a space bound to a world.