createProxyTemplate()

Usage

physicsWorld.createProxyTemplate( ModelResourceRef, #proxyTemplateSymbol, decomposition parameter list)

Description

This method creates a rigid body with the specified proxy shape.

Parameters

Parameter

Description

ModelResourceRef

Required. Reference of the model for which a dynamic concave proxy has to be created.

proxyTemplateSymbol

Required. Symbol that takes one of the following:

#convexDecomposed - Creates a dynamic concave proxy template using convex mesh decomposition method.]

#concave - Creates a static concave proxy template.

#convex - Creates a convex mesh proxy template.

ConvexDecomposition for Dynamic Concave Rigid Body

Optional. Property list

#depth - Default value: 3, : 0-10.

#concavity - Default Value: 10. Range: 0-100.

#mergeVolume - Default Value: 10. Range: 0-100.

A reference to the proxy created for the specified model resource. If the creation fails, void is returned.

Note: -31 error is thrown if model resource used is invalid. A -29 error is thrown if there is a duplicate model resource.
The proxy returned is a property list which contains the properties of the proxy created from the model.
numMeshes
Number of convex meshes that were used to create the concaveshape.

vertexList
A list containing the vertices of each mesh.

indexList
A list containing the index of each mesh.

meshType
Symbol returning #concave or #convex.

proxyTemplate Symbol

proxyTemplate.meshType

Rigid bodies that can be created using the proxyTemplate

#convexdecomposed

#convex

Concave-dynamic, Concave-static

#concave

#concave

Concave-static

#convex

#convex

Convex-static, convex-dynamic

Director 3D primitives of modelresource type other than #mesh cannot be used for creating proxy templates using this method. A -31 error is thrown.

Example

--Lingo syntax 
ProxyTemplate = member("PhysicsWorld").createProxyTemplate(modelResource Reference ,#convexDecomposed,[#concavity:4, #depth:6,#mergeVolume:4]) 
// JavaScript syntax 
var ProxyTemplate = member("PhysicsWorld"). createProxyTemplate(member("3dWorld").getPropRef("modelResource",2) ,symbol("convexDecomposed"),propList(symbol("concavity"),2, symbol("depth"),8, symbol("mergeVolume"),2));