H3D API  2.4.1
WindPhysicsModel.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
27 //
29 #ifndef __WINDPHYSICSMODEL_H__
30 #define __WINDPHYSICSMODEL_H__
31 
33 
34 namespace H3D {
35 
64  class H3DAPI_API WindPhysicsModel : public X3DParticlePhysicsModelNode {
65  public:
66 
68  WindPhysicsModel( Inst< SFNode > _metadata = 0,
69  Inst< SFBool > _enabled = 0,
70  Inst< SFVec3f > _direction = 0,
71  Inst< SFFloat > _gustiness = 0,
72  Inst< SFFloat > _speed = 0,
73  Inst< SFFloat > _turbulence = 0 );
74 
76  virtual void traverseSG( TraverseInfo &ti );
77 
78  virtual void updateParticleValues(
79  const X3DParticleEmitterNode::Particle &last_particle,
80  X3DParticleEmitterNode::Particle &particle,
81  H3DTime last_time,
82  H3DTime current_time );
83 
89  H3DUniquePtr< SFVec3f > direction;
90 
98  H3DUniquePtr< SFFloat > gustiness;
99 
105  H3DUniquePtr< SFFloat > speed;
106 
115  H3DUniquePtr< SFFloat > turbulence;
116 
119 
120  protected:
124  };
125 }
126 
127 #endif
Header file for X3DParticlePhysicsModelNode, X3D scene-graph node.
TraverseInfo is a structure that is passed along when traversing the scene graph.
Definition: TraverseInfo.h:57
The WindPhysicsModel node specifies a physics model that applies a wind effect to the particles.
Definition: WindPhysicsModel.h:64
H3DUniquePtr< SFFloat > gustiness
The gustiness specifies how much the wind speed varies from the average value defined by the speed fi...
Definition: WindPhysicsModel.h:98
H3DUniquePtr< SFFloat > speed
The speed field specifies the current wind speed in metres per second.
Definition: WindPhysicsModel.h:105
H3DUniquePtr< SFVec3f > direction
The direction field specifies the direction in which the wind is travelling in the form of a normaliz...
Definition: WindPhysicsModel.h:89
H3DUniquePtr< SFFloat > turbulence
The turbulence field specifies how much the wind acts directly in line with the direction,...
Definition: WindPhysicsModel.h:115
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: WindPhysicsModel.h:118
H3DFloat wind_speed
The wind speed updated once per frame with gustiness taken into consideration.
Definition: WindPhysicsModel.h:123
The X3DParticlePhysicsModelNode is the abstract representation of any node that will apply a form of ...
Definition: X3DParticlePhysicsModelNode.h:46
float H3DFloat
double H3DTime
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194