Rigid constraint 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

<rigid_constraint>/<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) <rigid_constraint>
Extra and/or Technique <extra>/<technique profile=”PhysX_3.x”>
Child elements See following section
Child Elements
Name Description Default Occurrences
<px_d6joint> Extension’s root element. N/A 0 or 1

Child Elements for px_d6joint

Child elements must appear in the following order if present:
Name Description Default Occurrences
<local_pose0 sid=”..”> 7 floating point values: 4 for rotation quaternion and 3 for translation. N/A 1
<local_pose1 sid=”...”> 7 floating point values: 4 for rotation quaternion and 3 for translation. N/A 1
<break_force sid=”...”> Float INF 0 or 1
<break_torque sid=”...”> Float INF 0 or 1
<constraint_flags> List of xs:NCNAME. See PxConstraintFlags documentation. Can be any combination of BROKEN, PROJECT_TO_ACTOR0, PROJECT_TO_ACTOR1, PROJECTION, COLLISION_ENABLED, REPORTING, VISUALIZATION, DRIVE_LIMITS_ARE_FORCES, IMPROVED_SLERP No flag 0 or 1
<inv_mass_scale0 sid=”...”> Float 1 0 or 1
<inv_inertia_scale0 sid=”...”> Float 1 0 or 1
<inv_mass_scale1 sid=”...”> Float 1 0 or 1
<inv_inertia_scale1 sid=”...”> Float 1 0 or 1
<projection_linear_tolerance sid=”...”> Float 1e10f 0 or 1
<projection_angular_tolerance sid=”...”> Float 180 0 or 1
<limits_extra>* 0 or 1
<linear_extra>* 0 or 1
<restitution sid=”...”> Float 0 0 or 1
<bounce_threshold sid=”...”> Float 0 0 or 1
<contact_distance sid=”...”> Float 0 0 or 1
</linear_extra>
<swing_cone_and_twist_extra>* 0 or 1
<restitution sid=”...”> Vector2. For swingY/Z and twist. 0 0 0 or 1
<bounce_threshold sid=”...”> Vector2. For swingY/Z and twist. 0 0 0 or 1
<contact_distance sid=”...”> Vector2. For swingY/Z and twist. 0 0 0 or 1
</swing_cone_and_twist_extra>
</limits_extra>
<spring_extra>* 0 or 1
<angular_extra>* 0 or 1
<stiffness sid=”...”> Float. Additional value for twist. 1 0 or 1
<damping sid=”...”> Float. Additional value for twist. 0 0 or 1
</angular_extra>
</spring_extra>
<drive>
<linear_x> Also accepts <linear_y>, <linear_z>, <swing>, <twist> and <slerp>. 0 or 1
<stiffness sid=”...”> Float 1 0 or 1
<damping sid=”...”> Float 0 0 or 1
<force_limit sid=”...”> Float INF 0 or 1
<drive_flags> List of xs:NCNAME. Only flag is ACCELERATION. No flag 0 or 1
</linear_x> Or </linear_y>, </linear_z>, </swing>, </twist> and </slerp>
<translate> Transformation of drive position. Any combination of these elements in any order. 0 0 0 0 or more
<rotate> 0 0 0 0 0 or more
<linear_velocity sid=”...”> Vector3 0 0 0 0 or 1
<angular_velocity sid=”...”> Vector3 0 0 0 0 or 1
</drive>

Example

   <rigid_constraint>
       ...
       <technique_common>
           <enabled>true</enabled>
           <interpenetrate>true</interpenetrate>
           <limits>
               <swing_cone_and_twist>
                   <min>-15.0 -15.0 -INF</min>
                   <max>15.0 15.0 INF</max>
               </swing_cone_and_twist>
               <linear>
                   <min>0 0 0</min>
                   <max>0 0 0</max>
               </linear>
           </limits>
           <spring>
               <linear>
                   <stiffness>5.4544</stiffness>
                   <damping>0.4132</damping>
                   <target_value>3</target_value>
               </linear>
               <angular>
                   <stiffness>5.4544</stiffness>
                   <damping>0.4132</damping>
                   <target_value>90</target_value>
               </angular>
           </spring>
       </technique_common>
       <extra>
           <technique profile=”PhysX_3.x”>
               <px_d6joint>
                   <local_pose0>0 0 0 1 0 0 0</local_pose0>
                   <local_pose1>0 0 0 1 0 -2 0</local_pose1>
                   <break_force>INF</break_force>
                   <break_torque>INF</break_torque>
                   <constraint_flags>PROJECT_TO_ACTOR0 PROJECT_TO_ACTOR1 PROJECTION</constraint_flags>
                   <inv_mass_scale0>1</inv_mass_scale0>
                   <inv_inertia_scale0>1</inv_inertia_scale0>
                   <inv_mass_scale1>1</inv_mass_scale1>
                   <inv_inertia_scale1>1</inv_inertia_scale1>
                   <limits_extra>
                       <linear_extra>
                           <restitution>0</restitution>
                           <bounce_threshold>0</bounce_threshold>
                           <contact_distance>0.01</contact_distance>
                       </linear_extra>
                       <swing_cone_and_twist_extra>
                           <restitution>0.4 0</restitution>
                           <bounce_threshold>0.5 0.5</bounce_threshold>
                           <contact_distance>0.0392699 0.1</contact_distance>
                       </swing_cone_and_twist_extra>
                   </limits_extra>
                   <spring_extra>
                       <angular_extra>
                           <stiffness>0</stiffness>
                           <damping>0</damping>
                       </angular_extra>
                   </spring_extra>
                   <drive>
                       <linear_x>
                           <stiffness>0</stiffness>
                           <damping>0.005</damping>
                           <force_limit>INF</force_limit>
                           <drive_flags>ACCELERATION</drive_flags>
                       </linear_x>
                       <linear_y>
                           <stiffness>0</stiffness>
                           <damping>0.005</damping>
                           <force_limit>INF</force_limit>
                           <drive_flags>ACCELERATION</drive_flags>
                       </linear_y>
                       <linear_z>
                           <stiffness>0</stiffness>
                           <damping>0.005</damping>
                           <force_limit>INF</force_limit>
                           <drive_flags>ACCELERATION</drive_flags>
                       </linear_z>
                       <swing>
                           <stiffness>0</stiffness>
                           <damping>5.23599e-5</damping>
                           <force_limit>INF</force_limit>
                           <drive_flags>ACCELERATION</drive_flags>
                       </swing>
                       <twist>
                           <stiffness>0</stiffness>
                           <damping>5.23599e-5</damping>
                           <force_limit>INF</force_limit>
                           <drive_flags>ACCELERATION</drive_flags>
                       </twist>
                       <slerp>
                           <stiffness>0</stiffness>
                           <damping>5.23599e-5</damping>
                           <force_limit>INF</force_limit>
                       </slerp>
                       <translate>0 1 2</translate>
                       <rotate>0 1 0 45</rotate>
                       <linear_velocity>0 0 0</linear_velocity>
                       <angular_velocity>0 0 0</angular_velocity>
                   </drive>
                   <projection_linear_tolerance>1e10</projection_linear_tolerance>
                   <projection_angular_tolerance>180</projection_angular_tolerance>
               </px_d6joint>
           </technique>
       </extra>
   </rigid_constraint>