Shape OpenCOLLADA extension

From COLLADA Public Wiki
Jump to: navigation, search
Extension information
This article is part of the COLLADA extensions directory
Adding to the extensions directory

<shape>/<extra>/<technique profile="PhysX_3.x"> Element

Specification Version: 1.4.1
Category: (Physics) Physics Model

Introduction

COLLADA format allows Physics scene description. However only a small set of parameters are supported. This extension allows to embed full set of parameters supported by PhysX 3.x.
See PhysX 3.x documentation for further details about each parameter.

Note relative to transforms

COLLADA does not define any transform for <rigid_body> element and supposes rigid body's initial transform is taken from <instance_rigid_body>’s target. In Maya, a rigid body can have a different transform than its targeted node. Importers can use <global_pose> element to get the actual transform used by PhysX SDK in Maya. Importing and using <global_pose> is optional but if an importer chooses to use <global_pose> then it must use <shape>/<extra>/<technique profile=”PhysX_3.3”>/<local_pose> and <rigid_constraint>/<extra>/<technique profile=”PhysX_3.3”>/<local_pose0>|<local_pose1> and ignore standard COLLADA shape transform and constraint <ref_attachment>/<attachment> transforms.
Related Elements
Affected Parent element(s) <shape>
Extra and/or Technique <extra>/<technique profile=”PhysX_3.x”>
Child elements See following section
Child Elements
Name Description Default Occurrences
<px_shape> Extension’s root element. N/A 0 or 1

Child Elements for px_shape

Child elements must appear in the following order if present:
Name Description Default Occurrences
<local_pose sid=”...”> 7 floating point values: 4 for rotation quaternion and 3 for translation. N/A 1
<simulation_filter_data> Four integers defining user collision filter data. 0 0 0 0 0 or 1
<query_filter_data> Four integers defining user query filter data. 0 0 0 0 0 or 1
<contact_offset sid=”...”> Floating point value. A contact will be generated when the distance between two shapes is lower than the sum of their contact offsets. 0.02 0 or 1
<rest_offset sid=”...”> Floating point value. Two shapes will come to rest at a distance equal to the sum of their rest offsets. 0 0 or 1
<shape_flags> PxShape flags. Can be any combination of SIMULATION_SHAPE, SCENE_QUERY_SHAPE, TRIGGER_SHAPE, VISUALIZATION, PARTICLE_DRAIN. VISUALIZATION SIMULATION_SHAPE SCENE_QUERY_SHAPE 0 or 1
<name> Optional string used as debug name by PhysX. "" 0 or 1

Example

   <shape>
       <instance_geometry url=”#geom_id”>
       </instance_geometry>
       <rotate>0 0 0 0</rotate>
       <translate>0 0 0 0</translate>
       <extra>
           <technique profile="PhysX_3.x">
               <px_shape>
                   <local_pose>0 0 0 1 0 0 0</local_pose>
                   <simulation_filter_data>0 0 0 0 </simulation_filter_data>
                   <query_filter_data>0 0 0 0 </query_filter_data>
                   <contact_offset>2.5e-4</contact_offset>
                   <rest_offset>0</rest_offset>
                   <shape_flags>
                       SIMULATION_SHAPE
                       SCENE_QUERY_SHAPE             
                   </shape_flags>
                   <name>Ground</name>
               </px_shape>
           </technique>
       </extra>
   </shape>