MathEngine
Home Page       Structures       File List       Functions and Macros      

MdtBclLimit.h

Go to the documentation of this file.
00001 #ifndef _MDTBCLLIMIT_H
00002 #define _MDTBCLLIMIT_H
00003 /*
00004   Copyright MathEngine 2000
00005 
00006   $Name: t-release-0-0-5-msvcrt $
00007 
00008   $Id: MdtBclLimit.h,v 1.3 2000/06/27 17:15:00 gilesc Exp $
00009 */
00010 
00011 /** @file
00012  * Constraint library limits.
00013  *
00014  * This implements hard and soft limits for the remaining degrees of freedom
00015  * of constraints.  All angles are specified in radians.
00016  */
00017 
00018 /**
00019  * MdtBcl Single Limit structure.
00020  *
00021  * Specifies behaviour of the constraint at a specific individual limit
00022  * (either an upper or lower limit) of a motion which is otherwise
00023  * unconstrained by the joint's hard constraints.
00024  */
00025 typedef struct
00026 {
00027     /**
00028      * Minimum (for lower limit) or maximum (for upper limit) linear or
00029      * angular separation of the attached bodies, projected onto the
00030      * relevant axis.
00031      *
00032      * For a soft limit, the stop is a boundary rather than an absolute
00033      * limit.
00034      */
00035     MeReal stop;
00036 
00037     /**
00038      * The spring constant (kp) used for restitution force when a limited
00039      * joint reaches one of its stops.
00040      *
00041      * This limit property must be zero or positive: the default value is
00042      * MEINFINITY.  If the stiffness and damping of an individual limit are
00043      * both zero, it is effectively deactivated.
00044      */
00045     MeReal stiffness;
00046 
00047     /**
00048      * The damping term (kd) for this limit.
00049      *
00050      * This must not be negative: the default value is zero.  This property
00051      * is used only if the limit hardness is less than or equal to the
00052      * damping threshold.  If the hardness and damping of an individual
00053      * limit are both zero, it is effectively deactivated.
00054      */
00055     MeReal damping;
00056 
00057     /**
00058      * The ratio of rebound velocity to impact velocity
00059      * when the joint reaches the low or high stop.
00060      *
00061      * This is used only if the limit hardness exceeds the damping
00062      * threshold.  Restitution must be in the range zero to one inclusive:
00063      * the default value is one.
00064      */
00065     MeReal restitution;
00066 }
00067 MdtBclSingleLimit;
00068 
00069 /**
00070  * MdtBcl Limit structure.
00071  *
00072  * Specifies behaviour of the constraint for a motion which is otherwise
00073  * unconstrained by the joint's hard constraints.  This motion may be
00074  * constrained at either an upper limit or a lower limit, or both, or
00075  * actuated (powered) by a force-limited motor between such limits or in the
00076  * absence of limits.
00077  */
00078 typedef struct
00079 {
00080     /**
00081      * Set if the corresponding degree of freedom of the joint is limited.
00082      *
00083      * Cleared (set 0) if the degree of freedom is not limited.
00084      */
00085     int limited;
00086 
00087     /**
00088      * Non-zero if the joint has overshot a limit and is
00089      * relaxing back to that limit, zero if bouncing.
00090      */
00091     int bRelaxingToLimit;
00092 
00093     /**
00094      * The overshoot distance.
00095      *
00096      * This is set to zero between the limits; otherwise it is the amount by
00097      * which the joint has overshot its limit.  This is positive beyond the
00098      * upper limit, negative beyond the lower.
00099      */
00100     MeReal overshoot;
00101 
00102     /**
00103      * Relative position of the attached bodies, projected onto the
00104      * relevant axis.
00105      */
00106     MeReal position;
00107 
00108     /**
00109      * Relative linear or angular velocity of the attached
00110      * bodies, projected onto the relevant axis.
00111      */
00112     MeReal velocity;
00113 
00114     /**
00115      * The limit hardness threshold.
00116      *
00117      * This value depends on the timestep and is recalculated in each
00118      * timestep in which a limit is exceeded.  When a limit hardness exceeds
00119      * this value, damping is ignored and only the restitution property is
00120      * used.  When the limit hardness is at or below this threshold,
00121      * restitution is ignored, and the hardness and damping terms are used
00122      * to simulate a damped spring.
00123      */
00124     MeReal damping_thresh;
00125 
00126     /**
00127      * The specific properties of the lower and upper limits.
00128      */
00129     MdtBclSingleLimit limit[2];
00130 
00131     /*
00132       Power.
00133     */
00134 
00135     /**
00136      * 0 for non-powered joint, -1 for powered joint
00137      */
00138     int powered;
00139 
00140     /**
00141      * Powered joint, desired velocity.
00142      *
00143      * A lower limiting velocity may be achieved if the attached bodies are
00144      * subject to velocity or angular velocity damping.
00145      */
00146     MeReal desired_vel;
00147 
00148     /**
00149      * Powered joint, maximum force that should be 
00150      * applied to reach the desired velocity.
00151      */
00152     MeReal fmax;
00153 }
00154 MdtBclLimit;
00155 
00156 #endif

MathEngine Dynamics Toolkit - Version 0.0.5 Alpha - Reference Manual generated using doxygen at Wed Oct 11 00:34:45 2000

Copyright MathEngine PLC 2000, all rights reserved.