- Main Page
- Classes
- Files

- Search for |

# StickyDynamic.h

Go to the documentation of this file.

    00001 /*****************************
    00002 File:      StickyDynamic.h
    00003 Language:   C++ (header)
    00004 Project:    H3DNetworkingUtils
    00005 The contents of this file are subject to the Mozilla Public License
    00006 Version 1.1 (the "License"); you may not use this file except in
    00007 compliance with the License. You may obtain a copy of the License at
    00008 http://www.mozilla.org/MPL/
    00009
    00010 Software distributed under the License is distributed on an "AS IS"
    00011 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
    00012 License for the specific language governing rights and limitations
    00013 under the License.
    00014
    00015 The Original Code is H3DNetworkingUtils v1.0.
    00016
    00017 The Initial Developer of the Original Code is CSIRO.
    00018 Portions created by the Initial Developer are Copyright (C) 1009 CSIRO. All Rights Reserved.
    00019 Contributor(s):
    00020     Chris Gunn  <Chris.Gunn@csiro.au> <ChrisJGunn@gmail.com>
    00021 ***************************/
    00022
    00025
    00026 #ifndef StickyDynamic_H
    00027 #define StickyDynamic_H
    00028
    00029
    00030 #include "H3DNetworkingUtils/Config.h"
    00031 #include "H3DNetworkingUtils/Dynamic.h"
    00032 #include <H3D/X3DGeometryNode.h> // Can't see any reason to require this line but the is a compilation error without it.
    00033 #include <H3D/SFBool.h>
    00034 #include <H3D/SFFloat.h>
    00035 #include <H3D/SFTime.h>
    00036
    00037 namespace H3DNetworkingUtils {
    00038
    00051
    00052 class H3D_NETWORKING_UTILS_DLL_SPEC StickyDynamic : public H3DNetworkingUtils::Dynamic {
    00053 public:
    00055    StickyDynamic(H3D::Inst<H3D::SFBool> locked = 0,
    00056                  H3D::Inst<H3D::SFFloat> startForce = 0,
    00057                  H3D::Inst<H3D::SFFloat> slideForce = 0,
    00058                  H3D::Inst<H3D::SFFloat> friction = 0,
    00059                  H3D::Inst<H3D::SFTime> stopDelay = 0);
    00060
    00061    // The X3D interface
    00062    static H3D::H3DNodeDatabase database;
    00063
    00064    // Public fields
    00065
    00070    auto_ptr<H3D::SFBool> locked;
    00071
    00076    auto_ptr<H3D::SFFloat> startForce;
    00077
    00082    auto_ptr<H3D::SFFloat> slideForce;
    00083
    00088    auto_ptr<H3D::SFFloat> friction;
    00089
    00096    auto_ptr<H3D::SFTime> stopDelay;
    00097
    00098 protected:
    00099
    00100    virtual void traverseSG(H3D::TraverseInfo & ti);
    00101
    00102    class FrictionForce : public H3D::TypedField<H3D::SFVec3f, H3D::Types<H3D::SFFloat, H3D::SFVec3f> > {
    00103    public:
    00104       virtual void update();
    00105    };
    00106
    00107    auto_ptr<FrictionForce> friction_force;
    00108    bool stopped;
    00109    H3D::H3DTime stop_time;
    00110 };
    00111
    00112 }
    00113
    00114 #endif
    00115