The ISpring graph node interface. More...

#include "murl_graph_i_spring.h"

Inheritance diagram for Murl::Graph::ISpring:

Public Member Functions

virtual INodeGetNodeInterface ()=0
 Get the mutable Graph::INode interface. More...
 
virtual const INodeGetNodeInterface () const =0
 Get the constant Graph::INode interface. More...
 
virtual ITransformGetTransformInterface ()=0
 Get the mutable Graph::ITransform interface. More...
 
virtual const ITransformGetTransformInterface () const =0
 Get the constant Graph::ITransform interface. More...
 
virtual IBodyNodeTargetGetBodyNodeTarget ()=0
 Get the mutable Graph::IBodyNodeTarget container. More...
 
virtual const IBodyNodeTargetGetBodyNodeTarget () 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 VectorGetBodyPosition (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]

virtual INode* Murl::Graph::ISpring::GetNodeInterface ( )
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]

virtual const INode* Murl::Graph::ISpring::GetNodeInterface ( ) const
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]

virtual ITransform* Murl::Graph::ISpring::GetTransformInterface ( )
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]

virtual const ITransform* Murl::Graph::ISpring::GetTransformInterface ( ) const
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]

virtual IBodyNodeTarget* Murl::Graph::ISpring::GetBodyNodeTarget ( )
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]

virtual const IBodyNodeTarget* Murl::Graph::ISpring::GetBodyNodeTarget ( ) const
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()

virtual Bool Murl::Graph::ISpring::SetBodyPosition ( UInt32  index,
const Vector position 
)
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
indexThe body index, either 0 or 1.
positionThe anchor position relative to the body's center.
Returns
true if successful.

◆ GetBodyPosition()

virtual const Vector& Murl::Graph::ISpring::GetBodyPosition ( UInt32  index) const
pure virtual

Get the relative attachment point of a body.

Parameters
indexThe body index, either 0 or 1.
Returns
The anchor position relative to the body's center.

◆ SetBodyInfluence()

virtual Bool Murl::Graph::ISpring::SetBodyInfluence ( UInt32  index,
Bool  enabled 
)
pure virtual

Enable/disable the spring's influence on an attached body.

Parameters
indexThe body index, either 0 or 1.
enabledIf true, the attached body gets influenced by the spring.
Returns
true if successful.

◆ GetBodyInfluence()

virtual Bool Murl::Graph::ISpring::GetBodyInfluence ( UInt32  index) const
pure virtual

Check if the spring is influencing an attached body.

Parameters
indexThe body index, either 0 or 1.
Returns
true if influence is enabled.

◆ SetSpringConstant()

virtual Bool Murl::Graph::ISpring::SetSpringConstant ( Real  springConstant)
pure virtual

Set the spring constant.

Parameters
springConstantThe spring constant.
Returns
true if successful.

◆ GetSpringConstant()

virtual Real Murl::Graph::ISpring::GetSpringConstant ( ) const
pure virtual

Get the spring constant.

Returns
The spring constant.

◆ SetDampingConstant()

virtual Bool Murl::Graph::ISpring::SetDampingConstant ( Real  dampingConstant)
pure virtual

Set the damping constant.

Parameters
dampingConstantThe damping constant.
Returns
true if successful.

◆ GetDampingConstant()

virtual Real Murl::Graph::ISpring::GetDampingConstant ( ) const
pure virtual

Get the damping constant.

Returns
The damping constant.

◆ SetMinimumLength()

virtual Bool Murl::Graph::ISpring::SetMinimumLength ( Real  minLength)
pure virtual

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
minLengthThe spring's minimum length.
Returns
true if successful.

◆ GetMinimumLength()

virtual Real Murl::Graph::ISpring::GetMinimumLength ( ) const
pure virtual

Get the minimum length of the spring.

Returns
The spring's minimum length.

◆ SetMaximumLength()

virtual Bool Murl::Graph::ISpring::SetMaximumLength ( Real  maxLength)
pure virtual

Set the maximum length of the spring.

See SetMinimumLength().

Parameters
maxLengthThe spring's maximum length.
Returns
true if successful.

◆ GetMaximumLength()

virtual Real Murl::Graph::ISpring::GetMaximumLength ( ) const
pure virtual

Get the maximum length of the spring.

Returns
The spring's maximum length.

◆ SetForceEffectEnabled()

virtual Bool Murl::Graph::ISpring::SetForceEffectEnabled ( Bool  enabled)
pure virtual

Enable/disable force effect.

Parameters
enabledIf false, the spring does not apply any directional force on its attached bodies.
Returns
true if successful.

◆ IsForceEffectEnabled()

virtual Bool Murl::Graph::ISpring::IsForceEffectEnabled ( ) const
pure virtual

Check if force effect is enabled.

Returns
true if enabled.

◆ SetTorqueEffectEnabled()

virtual Bool Murl::Graph::ISpring::SetTorqueEffectEnabled ( Bool  enabled)
pure virtual

Enable/disable torque effect.

Parameters
enabledIf false, the spring does not apply any torque on its attached bodies.
Returns
true if successful.

◆ IsTorqueEffectEnabled()

virtual Bool Murl::Graph::ISpring::IsTorqueEffectEnabled ( ) const
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


Copyright © 2011-2024 Spraylight GmbH.