The ISpring graph node interface. More...
#include "murl_graph_i_spring.h"
Public Member Functions | |
virtual INode * | GetNodeInterface ()=0 |
Get the mutable Graph::INode interface. More... | |
virtual const INode * | GetNodeInterface () const =0 |
Get the constant Graph::INode interface. More... | |
virtual ITransform * | GetTransformInterface ()=0 |
Get the mutable Graph::ITransform interface. More... | |
virtual const ITransform * | GetTransformInterface () const =0 |
Get the constant Graph::ITransform interface. More... | |
virtual IBodyNodeTarget * | GetBodyNodeTarget ()=0 |
Get the mutable Graph::IBodyNodeTarget container. More... | |
virtual const IBodyNodeTarget * | GetBodyNodeTarget () const =0 |
Get the constant Graph::IBodyNodeTarget container. More... | |
virtual Bool | SetBodyPosition (UInt32 index, const Vector &position)=0 |
Set the relative attachment point of a body. More... | |
virtual const Vector & | GetBodyPosition (UInt32 index) const =0 |
Get the relative attachment point of a body. More... | |
virtual Bool | SetBodyInfluence (UInt32 index, Bool enabled)=0 |
Enable/disable the spring's influence on an attached body. More... | |
virtual Bool | GetBodyInfluence (UInt32 index) const =0 |
Check if the spring is influencing an attached body. More... | |
virtual Bool | SetSpringConstant (Real springConstant)=0 |
Set the spring constant. More... | |
virtual Real | GetSpringConstant () const =0 |
Get the spring constant. More... | |
virtual Bool | SetDampingConstant (Real dampingConstant)=0 |
Set the damping constant. More... | |
virtual Real | GetDampingConstant () const =0 |
Get the damping constant. More... | |
virtual Bool | SetMinimumLength (Real minLength)=0 |
Set the minimum length of the spring. More... | |
virtual Real | GetMinimumLength () const =0 |
Get the minimum length of the spring. More... | |
virtual Bool | SetMaximumLength (Real maxLength)=0 |
Set the maximum length of the spring. More... | |
virtual Real | GetMaximumLength () const =0 |
Get the maximum length of the spring. More... | |
virtual Bool | SetForceEffectEnabled (Bool enabled)=0 |
Enable/disable force effect. More... | |
virtual Bool | IsForceEffectEnabled () const =0 |
Check if force effect is enabled. More... | |
virtual Bool | SetTorqueEffectEnabled (Bool enabled)=0 |
Enable/disable torque effect. More... | |
virtual Bool | IsTorqueEffectEnabled () const =0 |
Check if torque effect is enabled. More... | |
Detailed Description
The ISpring graph node interface.
Spring nodes can be used to either connect a Graph::IBody instance to a given point in world space, or to connect two separate Graph::IBody instances.
If only one body is connected to the spring (at either end), the other end point is represented by the spring's actual position in world space, defined by its Graph::ITransform interface (and its parent transform hierarchy).
Member Function Documentation
◆ GetNodeInterface() [1/2]
|
pure virtual |
Get the mutable Graph::INode interface.
This method returns a mutable pointer to the node's Graph::INode interface, to be able to query or modify common node properties such as active state, visibility or ID.
- Returns
- The mutable Graph::INode interface, or null if not available
◆ GetNodeInterface() [2/2]
|
pure virtual |
Get the constant Graph::INode interface.
This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.
- Returns
- The constant Graph::INode interface, or null if not available
◆ GetTransformInterface() [1/2]
|
pure virtual |
Get the mutable Graph::ITransform interface.
This method returns a mutable pointer to the node's Graph::ITransform interface, to be able to query or modify the node's transformation matrix and depth order.
- Returns
- The mutable Graph::ITransform interface, or null if not available
◆ GetTransformInterface() [2/2]
|
pure virtual |
Get the constant Graph::ITransform interface.
This method returns a constant pointer to the node's Graph::ITransform interface, to be able to query the node's transformation matrix and depth order.
- Returns
- The constant Graph::ITransform interface, or null if not available
◆ GetBodyNodeTarget() [1/2]
|
pure virtual |
Get the mutable Graph::IBodyNodeTarget container.
This method returns a mutable pointer to the node's Graph::IBodyNodeTarget container, which allows to set or query the (up to) two bodies this spring is connected to.
- Returns
- The mutable Graph::IBodyNodeTarget container, or null if not available.
◆ GetBodyNodeTarget() [2/2]
|
pure virtual |
Get the constant Graph::IBodyNodeTarget container.
This method returns a constant pointer to the node's Graph::IBodyNodeTarget container, which allows to query the (up to) two bodies this spring is connected to.
- Returns
- The mutable Graph::IBodyNodeTarget container, or null if not available.
◆ SetBodyPosition()
|
pure virtual |
Set the relative attachment point of a body.
If a body is connected to the spring at the given index, the given position vector represents the spring's anchor point at that body, relative to the body's center.
- Parameters
-
index The body index, either 0 or 1. position The anchor position relative to the body's center.
- Returns
- true if successful.
◆ GetBodyPosition()
Get the relative attachment point of a body.
- Parameters
-
index The body index, either 0 or 1.
- Returns
- The anchor position relative to the body's center.
◆ SetBodyInfluence()
Enable/disable the spring's influence on an attached body.
- Parameters
-
index The body index, either 0 or 1. enabled If true, the attached body gets influenced by the spring.
- Returns
- true if successful.
◆ GetBodyInfluence()
Check if the spring is influencing an attached body.
- Parameters
-
index The body index, either 0 or 1.
- Returns
- true if influence is enabled.
◆ SetSpringConstant()
Set the spring constant.
- Parameters
-
springConstant The spring constant.
- Returns
- true if successful.
◆ GetSpringConstant()
|
pure virtual |
Get the spring constant.
- Returns
- The spring constant.
◆ SetDampingConstant()
Set the damping constant.
- Parameters
-
dampingConstant The damping constant.
- Returns
- true if successful.
◆ GetDampingConstant()
|
pure virtual |
Get the damping constant.
- Returns
- The damping constant.
◆ SetMinimumLength()
Set the minimum length of the spring.
As long as the simulated length of the spring is between its defined minimum and maximum length, no force is applied to its attached bodies. When the spring gets compressed below its minimum length or expanded above its maximum length, a directional force is applied to restore the spring to a safe "resting length". See also SetMaximumLength().
- Parameters
-
minLength The spring's minimum length.
- Returns
- true if successful.
◆ GetMinimumLength()
|
pure virtual |
Get the minimum length of the spring.
- Returns
- The spring's minimum length.
◆ SetMaximumLength()
Set the maximum length of the spring.
See SetMinimumLength().
- Parameters
-
maxLength The spring's maximum length.
- Returns
- true if successful.
◆ GetMaximumLength()
|
pure virtual |
Get the maximum length of the spring.
- Returns
- The spring's maximum length.
◆ SetForceEffectEnabled()
Enable/disable force effect.
- Parameters
-
enabled If false, the spring does not apply any directional force on its attached bodies.
- Returns
- true if successful.
◆ IsForceEffectEnabled()
|
pure virtual |
Check if force effect is enabled.
- Returns
- true if enabled.
◆ SetTorqueEffectEnabled()
Enable/disable torque effect.
- Parameters
-
enabled If false, the spring does not apply any torque on its attached bodies.
- Returns
- true if successful.
◆ IsTorqueEffectEnabled()
|
pure virtual |
Check if torque effect is enabled.
- Returns
- true if enabled.
The documentation for this interface was generated from the following file:
- murl_graph_i_spring.h