Particle forces FCOLLADA extension

From COLLADA Public Wiki
Jump to navigation Jump to search
Extension information
  • Purpose: unstated
  • Company(s): [[Feeling Software]]
  • Product(s): [[FCollada]]
  • Last updated: unstated
  • Contact for technical issues:
This article is part of the COLLADA extensions directory
Adding to the extensions directory

Particle forces extension

This extension describes the additional parameters added to the physics' <force_field> definition, in order to support particle systems.

FCollada currently support five types of particle forces: <force_deflector>, <force_drag>, <force_gravity>, <force_pbomb> and <force_wind>. Each type of force is described in more details in the sub-sections below. Each <force_field> element may contain one or zero force(s). The forces are used to move or accelerate the particles in different fashion, depending on their position and, in some cases, the orientation and position of the force field instance.

These particles forces are strongly based on their 3dsMax equivalent.

<force_deflector>

Described as a surface, the deflector effectively bounces the particles away. Just like a mesh, the deflector is placed and oriented using the transform of the scene node where the force field is instanced.

Element Attributes Description
<form> Contains one enumerated type with the following token values: PLANAR or SPHERICAL. A PLANAR deflector describes a bounded-plane that the particles cannot traverse. A SPHERICAL deflector describes a sphere that the particles cannot traverse.
<bounce> sid Contains one floating-point value: the bounce factor for particles that hit the deflector. A bounce factor of 1.0 will fully reflect the particle away from the deflector. A bounce factor smaller than 1.0 means that the particle loose some of its force when hitting the deflector. A bounce factor or 0.0 means that the particle sticks to the deflector. The sid attribute can be used to animate this parameter.
<diameter> sid Contains one floating-point value: the diameter of the sphere. This parameter is only used for the SPHERICAL form. The sid attribute can be used to animate this parameter.
<width> sid Contains one floating-point value: the width of the plane. This parameter is only used for the PLANAR form. The sid attribute can be used to animate this parameter.
<length> sid Contains one floating-point value: the length of the plane. This parameter is only used for the PLANAR form. The sid attribute can be used to animate this parameter.

In local-space, the PLANAR geometry is therefore centered around the origin and has vertices at (+/- width/2, +/- length/2, 0.0). Its normal points in the positive-Z axis.

<force_drag>

Placed at the center of the force field is instance, the drag force acts to reduce the velocity of particles within its box range.

Element Attributes Description
<start_time> sid Contains one floating-point value: the relative time at which the force is active. The sid attribute can be used to animate this parameter.
<end_time> sid Contains one floating-point value: the relative time at which the force is inactive. The sid attribute can be used to animate this parameter.
<unlimited_range> Contains one boolean value: whether the drag affects all particles uniformly, regardless of their positions. An unlimited range drag force still needs to describe the damping parameters explained in the following table rows, but only the <percent> values are used.
<damping_x>
<damping_y>
<damping_z>
Complex elements: contains the <percent>, <range> and <falloff> elements described in the following table rows. Each element is used to identify the damping along one axis, in local-space. For a limited range drag force, all three element must be provided.
<percent> sid Contains one floating-point value: the damping factor along the current axis. A damping factor of 0.0 means that no drag should be applied along the current axis. A damping factor of 1.0 means that any particle placed at the world-position of the drag force instance are stopped. The sid attribute can be used to animate this parameter.
<range> sid Contains one floating-point value: the near-range of the force, along the current axis. If a particle is within this range, it will be fully affected by the drag force. The sid attribute can be used to animate this parameter.
<falloff> sid Contains one floating-point value: the far-range of the force, along the current axis. If a particle is within this range, but farther than the near-range, it will be partially affected by the drag. The sid attribute can be used to animate this parameter.

<force_gravity>

The simplest of the force fields: the gravity force will influence the velocity of particles in order to move them in a specific direction or towards a given point.

Element Attributes Description
<form> Contains one enumerated type with the following token values: PLANAR or SPHERICAL.

PLANAR indicated directional gravity, oriented using the transformation of the force field node. In local-space, the PLANAR gravity points in the positive-Z axis. SPHERICAL gravity is used to accelerate objects towards a given point. The position of the gravity well is the world-space translation of the node where the force field is instanced.

<strength> sid Contains one floating-point value: the constant strength of the gravity force in world units/seconds squared. The sid attribute can be used to animate this parameter.
<decay> sid Contains one floating-point value: a linear decay factor to diminish the acceleration applied by the gravity on the particles, depending on their distance to the gravity force instance. A decay factor of 0.0 implies that all particles are affected equally. A decay factor of 1.0 implies that only particles less than 1.0 world-units away from the gravity force instance are affected. The sid attribute can be used to animate this parameter.

<force_pbomb>

A more complex type of gravity, which can be turned off.

Element Attributes Description
<start_time> sid Contains one floating-point value: the relative time at which the force is active. The sid attribute can be used to animate this parameter.
<duration> sid Contains one floating-point value: the lifetime of the force. The sid attribute can be used to animate this parameter.
<form> Contains one enumerated type with the following token values: PLANAR, SPHERICAL or CYLINDRICAL. A PLANAR bomb describes an infinite plane that repulses particles. In local-space, the infinite place is the XY-plane and repulses particles on both sides of the plane. A SPHERICAL bomb indicates that particles will accelerated away from a 3D singularity. A CYLINDRICAL bomb describes a positioned and oriented axis that repulses particles. In local-space, the cylinder's axis is the positive-Z axis.
<strength> sid Contains one floating-point value: the acceleration to apply on the particles during the particle bomb. The sid attribute can be used to animate this parameter.
<decay> sid Contains one floating-point value: a linear decay factor to diminish the acceleration applied by the bomb on the particles, depending on their distance to the bomb form. A decay factor of 0.0 implies that all particles are affected equally, regardless of their distance to the bomb force instance. A decay factor of 1.0 implies that only particles less than 1.0 world-units away from the bomb force instance are affected. The sid attribute can be used to animate this parameter.

<force_wind>

A more complex type of gravity, which affects particles less uniformly.

Element Attributes Description
<form> Contains one enumerated type with the following token values: PLANAR, SPHERICAL. A PLANAR wind describes an infinite plane that repulses particles. In local-space, the infinite place is the XY-plane and repulses particles on both sides of the plane. A SPHERICAL wind indicates that particles will accelerated away from a 3D singularity.
<strength> sid Contains one floating-point value: the acceleration to apply on the particles, in world-units per seconds squared. The sid attribute can be used to animate this parameter.
<decay> sid Contains one floating-point value: a linear decay factor to diminish the acceleration applied by the wind on the particles, depending on their distance to the wind force instance. A decay factor of 0.0 implies that all particles are affected equally, regardless of their positions. A decay factor of 1.0 implies that only particles less than 1.0 world-units away from the wind force instance are affected. The sid attribute can be used to animate this parameter.
<turbulence> sid Contains one floating-point value: the wind turbulence. This cosine function parameter independently affects each particle to bring it closer and further from the wind force instance according to a sinusoidal curve. Editors Note: could use more description, maybe a mathematical formula?. The sid attribute can be used to animate this parameter.
<frequency> sid Contains one floating-point value: the frequency of the wind. Editors Note: could not figure it out from 3dsMax, but the name suggests what turbulence seems to be doing. The sid attribute can be used to animate this parameter.

A frequency and a turbulence of 0 will result in normal gravity.

Example

A gravity force field.

 <library_force_fields>
   <force_field id="Gravity_field">
     <asset><units name="meters" meters="1.0"/></asset>
     <technique profile="FCOLLADA">
       <force_gravity>
         <form>PLANAR</form>
         <strength>-9.8</strength>
       </force_gravity>
     </technique>
   </force_field>
 </library_force_fields>

A drag force field that affects the X-axis of local particles.

 <library_force_fields>
   <force_field id="Drag_field">
     <technique profile="FCOLLADA">
       <force_drag>
         <start_time>-INF</start_time>
         <end_time>INF</end_time>
         <unlimited_range>true</unlimited_range>
         <damping_x>
           <percent>0.01</percent>
         </damping_x>
         <damping_y>
           <percent>0.00</percent>
         </damping_y>
         <damping_z>
           <percent>0.00</percent>
         </damping_z>
       </force_drag>
     </technique>
   </force_field>
 </library_force_fields>