00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00025
00026
00027 #ifndef DampedDynamic_H
00028 #define DampedDynamic_H
00029
00030 #include "H3DNetworkingUtils/Config.h"
00031 #include "H3DNetworkingUtils/GrabableDynamic.h"
00032 #include <H3DUtil/AutoRef.h>
00033 #include <iostream>
00034 #include <functional>
00035 #include <H3D/Transform.h>
00036 #include <H3D/TraverseInfo.h>
00037 #include <H3D/Scene.h>
00038 #include <H3D/H3DTypes.h>
00039
00040 namespace H3DNetworkingUtils {
00041
00060
00061 class H3D_NETWORKING_UTILS_DLL_SPEC DampedDynamic : public GrabableDynamic {
00062 public:
00063
00065 class H3D_NETWORKING_UTILS_DLL_SPEC SFMotion: public GrabableDynamic::SFMotion {
00066 protected:
00067 virtual void updateState(H3D::LMState &state, H3D::H3DTime dt);
00068 };
00069
00071 DampedDynamic(
00072 H3D::Inst< AddChildren > _addChildren = 0,
00073 H3D::Inst< RemoveChildren > _removeChildren = 0,
00074 H3D::Inst< MFChild > _children = 0,
00075 H3D::Inst< H3D::SFNode > _metadata = 0,
00076 H3D::Inst< SFBound > _bound = 0,
00077 H3D::Inst< H3D::SFVec3f > _bboxCenter = 0,
00078 H3D::Inst< H3D::SFVec3f > _bboxSize = 0,
00079 H3D::Inst< SFTransformedBound > _transformedBound = 0,
00080 H3D::Inst< SFMatrix4f > _matrix = 0,
00081 H3D::Inst< SFMatrix4f > _accumulatedForward = 0,
00082 H3D::Inst< SFMatrix4f > _accumulatedInverse = 0,
00083 H3D::Inst< H3D::SFVec3f > _position = 0,
00084 H3D::Inst< H3D::SFRotation > _orientation = 0,
00085 H3D::Inst< SFVelocity > _velocity = 0,
00086 H3D::Inst< H3D::SFVec3f > _momentum = 0,
00087
00088 H3D::Inst< H3D::SFVec3f > _force = 0,
00089 H3D::Inst< SFAngularVelocity > _angularVelocity = 0,
00090 H3D::Inst< H3D::SFVec3f > _angularMomentum = 0,
00091 H3D::Inst< SFSpin > _spin = 0,
00092 H3D::Inst< H3D::SFVec3f > _torque = 0,
00093 H3D::Inst< H3D::SFFloat > _mass = 0,
00094 H3D::Inst< H3D::SFMatrix3f > _inertiaTensor = 0,
00095 H3D::Inst< SFMotion > _motion = 0,
00096
00097 H3D::Inst<H3D::MFVec3f > _contactForces = 0,
00098 H3D::Inst<H3D::MFVec3f > _contactTorques = 0,
00099 H3D::Inst<SumMFVec3f > _totalContactForce = 0,
00100 H3D::Inst<CalcTorque > _totalContactTorque = 0,
00101 H3D::Inst<SumForces > _externalForces = 0,
00102 H3D::Inst<SumTorques > _externalTorques = 0,
00103 H3D::Inst<H3D::SFVec3f > _freedom = 0,
00104 H3D::Inst<H3D::SFVec3f > _angularFreedom = 0,
00105 H3D::Inst<H3D::SFFloat > _linearDamping = 0,
00106 H3D::Inst<H3D::SFFloat > _rotationalDamping = 0,
00107 H3D::Inst<MFCollidableGeometry > _collisionSpheres = 0,
00108 H3D::Inst<H3D::SFFloat > _collisionStiffness = 0,
00109 H3D::Inst< H3D::SFFloat > _collisionResolution = 0,
00110 H3D::Inst<H3D::SFBool > _grabbed = 0,
00111 H3D::Inst<H3D::SFVec3f > _grabPoint = 0,
00112 H3D::Inst<H3D::SFFloat > _grabStrength = 0,
00113 H3D::Inst<H3D::SFFloat > _grabSlackRadius = 0,
00114 H3D::Inst<GrabSpring > _grabForce = 0,
00115 H3D::Inst<NegVec3f > _grabReactionForce = 0,
00116 H3D::Inst<MovedPos > _grabSpringAnchorPt = 0,
00117 H3D::Inst<GrabTorque > _grabTorque = 0,
00118 H3D::Inst<H3D::SFInt32 > _grabSmoothing = 0,
00119 H3D::Inst<H3D::SFFloat > _grabDamping = 0,
00120 H3D::Inst<SlaveSwitch > _slaveMode = 0,
00121 H3D::Inst<DiffVec3f > _appliedForce = 0,
00122 H3D::Inst<DiffVec3f > _appliedTorque = 0);
00123
00125 static H3D::H3DNodeDatabase database;
00126
00127 virtual void traverseSG(H3D::TraverseInfo & ti);
00128
00129 };
00130
00131 typedef H3D::TypedSFNode< DampedDynamic > SFDampedDynamic;
00132 }
00133
00134 #endif