H3D::WindPhysicsModel Class Reference
[X3D node classes.]

The WindPhysicsModel node specifies a physics model that applies a wind effect to the particles. More...

#include <H3D/WindPhysicsModel.h>

Inheritance diagram for H3D::WindPhysicsModel:

Inheritance graph

List of all members.

Public Member Functions

 WindPhysicsModel (Inst< SFNode > _metadata=0, Inst< SFBool > _enabled=0, Inst< SFVec3f > _direction=0, Inst< SFFloat > _gustiness=0, Inst< SFFloat > _speed=0, Inst< SFFloat > _turbulence=0)
 Constructor.
virtual void traverseSG (TraverseInfo &ti)
 Traverse the scene graph. Updates the wind_speed member.
virtual void updateParticleValues (const X3DParticleEmitterNode::Particle &last_particle, X3DParticleEmitterNode::Particle &particle, H3DTime last_time, H3DTime current_time)

Public Attributes

auto_ptr< SFVec3fdirection
 The direction field specifies the direction in which the wind is travelling in the form of a normalized, unit vector.
auto_ptr< SFFloatgustiness
 The gustiness specifies how much the wind speed varies from the average value defined by the speed field.
auto_ptr< SFFloatspeed
 The speed field specifies the current wind speed in metres per second.
auto_ptr< SFFloatturbulence
 The turbulence field specifies how much the wind acts directly in line with the direction, and how much variation is applied in directions other than the wind direction.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.

Protected Attributes

H3DFloat wind_speed
 The wind speed updated once per frame with gustiness taken into consideration.


Detailed Description

The WindPhysicsModel node specifies a physics model that applies a wind effect to the particles.

The wind has a random variation factor that allows for the gustiness of the wind to be modelled.

The direction field specifies the direction in which the wind is travelling in the form of a normalized, unit vector.

The speed field specifies the current wind speed in metres per second. From the wind speed, the force applied per unit-area on the particle is calculated using the following formula:

pressure = 10(2 log(speed)) 0.64615

The gustiness specifies how much the wind speed varies from the average value defined by the speed field. The wind speed variation is calculated once per frame and applied equally to all particles.

The turbulence field specifies how much the wind acts directly in line with the direction, and how much variation is applied in directions other than the wind direction. This is determined per-particle to model how the particle is effected by turbulence.


Member Function Documentation

void WindPhysicsModel::updateParticleValues ( const X3DParticleEmitterNode::Particle &  last_particle,
X3DParticleEmitterNode::Particle &  particle,
H3DTime  last_time,
H3DTime  current_time 
) [virtual]

TODO: this is not random direction, fix it

TODO: what should happen really with turbulation

Implements H3D::X3DParticlePhysicsModelNode.

References direction, H3D::X3DParticlePhysicsModelNode::enabled, H3D::ParticleSystem::getRandomPointOnUnitSphere(), gustiness, speed, and turbulence.


Member Data Documentation

The direction field specifies the direction in which the wind is travelling in the form of a normalized, unit vector.

Access type: inputOutput
Default value: Vec3f( 0, 0, 0 )
Valid range: [-1, 1]

Referenced by updateParticleValues(), and WindPhysicsModel().

The gustiness specifies how much the wind speed varies from the average value defined by the speed field.

The wind speed variation is calculated once per frame and applied equally to all particles.

Access type: inputOutput
Default value: 0.1

Referenced by traverseSG(), updateParticleValues(), and WindPhysicsModel().

The speed field specifies the current wind speed in metres per second.

Access type: inputOutput
Default value: 0.1

Referenced by traverseSG(), updateParticleValues(), and WindPhysicsModel().

The turbulence field specifies how much the wind acts directly in line with the direction, and how much variation is applied in directions other than the wind direction.

This is determined per-particle to model how the particle is effected by turbulence.

Access type: inputOutput
Default value: 0
Valid range: [0,1]

Referenced by updateParticleValues(), and WindPhysicsModel().

The wind speed updated once per frame with gustiness taken into consideration.

Referenced by traverseSG().


The documentation for this class was generated from the following files:

Generated on Fri Nov 7 10:31:22 2008 for H3D API by  doxygen 1.5.7