[1378] | 1 | #ifndef NX_PHYSICS_NXPULLEYJOINT
|
---|
| 2 | #define NX_PHYSICS_NXPULLEYJOINT
|
---|
| 3 | /*----------------------------------------------------------------------------*\
|
---|
| 4 | |
|
---|
| 5 | | Public Interface to NovodeX Technology
|
---|
| 6 | |
|
---|
| 7 | | www.novodex.com
|
---|
| 8 | |
|
---|
| 9 | \*----------------------------------------------------------------------------*/
|
---|
| 10 | /** \addtogroup physics
|
---|
| 11 | @{
|
---|
| 12 | */
|
---|
| 13 |
|
---|
| 14 | #include "Nxp.h"
|
---|
| 15 | #include "NxJoint.h"
|
---|
| 16 |
|
---|
| 17 | class NxPulleyJointDesc;
|
---|
| 18 |
|
---|
| 19 | /**
|
---|
| 20 | \brief A pulley joint simulates a rope between two objects passing over 2 pulleys.
|
---|
| 21 |
|
---|
| 22 | \image html pulleyJoint.png
|
---|
| 23 | <h3>Creation</h3>
|
---|
| 24 |
|
---|
| 25 | Example:
|
---|
| 26 |
|
---|
| 27 | \include NxPulleyJoint_Create.cpp
|
---|
| 28 |
|
---|
| 29 | <h3>Visulizations:</h3>
|
---|
| 30 | \li #NX_VISUALIZE_JOINT_LOCAL_AXES
|
---|
| 31 | \li #NX_VISUALIZE_JOINT_WORLD_AXES
|
---|
| 32 | \li #NX_VISUALIZE_JOINT_LIMITS
|
---|
| 33 | \li #NX_VISUALIZE_JOINT_ERROR
|
---|
| 34 | \li #NX_VISUALIZE_JOINT_FORCE
|
---|
| 35 | \li #NX_VISUALIZE_JOINT_REDUCED
|
---|
| 36 |
|
---|
| 37 | @see NxJoint NxPulleyJointDesc NxScene.createJoint()
|
---|
| 38 | */
|
---|
| 39 | class NxPulleyJoint: public NxJoint
|
---|
| 40 | {
|
---|
| 41 | public:
|
---|
| 42 | /**
|
---|
| 43 | \brief Use this for changing a significant number of joint parameters at once.
|
---|
| 44 |
|
---|
| 45 | Use the set() methods for changing only a single property at once.
|
---|
| 46 |
|
---|
| 47 | \param[in] desc The descriptor used to set the state of the object.
|
---|
| 48 |
|
---|
| 49 | <b>Platform:</b>
|
---|
| 50 | \li PC SW: Yes
|
---|
| 51 | \li PPU : No
|
---|
| 52 | \li PS3 : Yes
|
---|
| 53 | \li XB360: Yes
|
---|
| 54 |
|
---|
| 55 | @see saveToDesc NxPulleyJointDesc
|
---|
| 56 | */
|
---|
| 57 | virtual void loadFromDesc(const NxPulleyJointDesc& desc) = 0;
|
---|
| 58 |
|
---|
| 59 | /**
|
---|
| 60 | \brief Writes all of the object's attributes to the desc struct.
|
---|
| 61 |
|
---|
| 62 | \param[out] desc The descriptor used to retrieve the state of the object.
|
---|
| 63 |
|
---|
| 64 | <b>Platform:</b>
|
---|
| 65 | \li PC SW: Yes
|
---|
| 66 | \li PPU : No
|
---|
| 67 | \li PS3 : Yes
|
---|
| 68 | \li XB360: Yes
|
---|
| 69 |
|
---|
| 70 | @see loadFromDesc() NxPulleyJointDesc
|
---|
| 71 | */
|
---|
| 72 | virtual void saveToDesc(NxPulleyJointDesc& desc) = 0;
|
---|
| 73 |
|
---|
| 74 | /**
|
---|
| 75 | \brief Sets motor parameters for the joint.
|
---|
| 76 |
|
---|
| 77 | For a positive velTarget, the motor pulls the first body towards its pulley,
|
---|
| 78 | for a negative velTarget, the motor pulls the second body towards its pulley.
|
---|
| 79 |
|
---|
| 80 | <ul>
|
---|
| 81 | <li>velTarget - the relative velocity the motor is trying to achieve. The motor will only be able
|
---|
| 82 | to reach this velocity if the maxForce is sufficiently large. If the joint is
|
---|
| 83 | moving faster than this velocity, the motor will actually try to brake. If you set this
|
---|
| 84 | to infinity then the motor will keep speeding up, unless there is some sort of resistance
|
---|
| 85 | on the attached bodies. </li>
|
---|
| 86 | <li>maxForce - the maximum force the motor can exert. Zero disables the motor.
|
---|
| 87 | Default is 0, should be >= 0. Setting this to a very large value if velTarget is also
|
---|
| 88 | very large may not be a good idea.</li>
|
---|
| 89 | <li>freeSpin - if this flag is set, and if the joint is moving faster than velTarget, then neither
|
---|
| 90 | braking nor additional acceleration will result.
|
---|
| 91 | default: false.</li>
|
---|
| 92 | </ul>
|
---|
| 93 | This automatically enables the motor.
|
---|
| 94 |
|
---|
| 95 | <b>Sleeping:</b> This call wakes the actor(s) if they are sleeping.
|
---|
| 96 |
|
---|
| 97 | \param[in] motorDesc
|
---|
| 98 |
|
---|
| 99 | <b>Platform:</b>
|
---|
| 100 | \li PC SW: Yes
|
---|
| 101 | \li PPU : No
|
---|
| 102 | \li PS3 : Yes
|
---|
| 103 | \li XB360: Yes
|
---|
| 104 |
|
---|
| 105 | @see NxMotorDesc getMotor()
|
---|
| 106 | */
|
---|
| 107 | virtual void setMotor(const NxMotorDesc &motorDesc) = 0;
|
---|
| 108 |
|
---|
| 109 | /**
|
---|
| 110 | \brief Reads back the motor parameters. Returns true if it is enabled.
|
---|
| 111 |
|
---|
| 112 | \param[out] motorDesc Used to retrieve the settings for this joint.
|
---|
| 113 | \return True if the motor is enabled.
|
---|
| 114 |
|
---|
| 115 | <b>Platform:</b>
|
---|
| 116 | \li PC SW: Yes
|
---|
| 117 | \li PPU : No
|
---|
| 118 | \li PS3 : Yes
|
---|
| 119 | \li XB360: Yes
|
---|
| 120 |
|
---|
| 121 | @see setMotor NxMotorDesc
|
---|
| 122 | */
|
---|
| 123 | virtual bool getMotor(NxMotorDesc &motorDesc) = 0;
|
---|
| 124 |
|
---|
| 125 | /**
|
---|
| 126 | \brief Sets the flags. This is a combination of the ::NxPulleyJointFlag bits.
|
---|
| 127 |
|
---|
| 128 | <b>Sleeping:</b> This call wakes the actor(s) if they are sleeping.
|
---|
| 129 |
|
---|
| 130 | \param[in] flags New set of flags for this joint. See #NxPulleyJointFlag
|
---|
| 131 |
|
---|
| 132 | <b>Platform:</b>
|
---|
| 133 | \li PC SW: Yes
|
---|
| 134 | \li PPU : No
|
---|
| 135 | \li PS3 : Yes
|
---|
| 136 | \li XB360: Yes
|
---|
| 137 |
|
---|
| 138 | @see NxPulleyJointFlag getFlags()
|
---|
| 139 | */
|
---|
| 140 | virtual void setFlags(NxU32 flags) = 0;
|
---|
| 141 |
|
---|
| 142 | /**
|
---|
| 143 | \brief returns the current flag settings. see #NxPulleyJointFlag
|
---|
| 144 |
|
---|
| 145 | \return The flag settings for this object.
|
---|
| 146 |
|
---|
| 147 | <b>Platform:</b>
|
---|
| 148 | \li PC SW: Yes
|
---|
| 149 | \li PPU : No
|
---|
| 150 | \li PS3 : Yes
|
---|
| 151 | \li XB360: Yes
|
---|
| 152 |
|
---|
| 153 | @see setFlags() NxPulleyJointFlag
|
---|
| 154 | */
|
---|
| 155 | virtual NxU32 getFlags() = 0;
|
---|
| 156 |
|
---|
| 157 | };
|
---|
| 158 |
|
---|
| 159 | /** @} */
|
---|
| 160 | #endif
|
---|
| 161 |
|
---|
| 162 |
|
---|
| 163 | //AGCOPYRIGHTBEGIN
|
---|
| 164 | ///////////////////////////////////////////////////////////////////////////
|
---|
| 165 | // Copyright © 2005 AGEIA Technologies.
|
---|
| 166 | // All rights reserved. www.ageia.com
|
---|
| 167 | ///////////////////////////////////////////////////////////////////////////
|
---|
| 168 | //AGCOPYRIGHTEND
|
---|
| 169 |
|
---|