Murl Engine Lua Addon API  Version 1.0 beta
Murl.Graph.IField

The IField graph node interface.

This interface represents a generic field object in the framework's physics simulator, that permanently acts on any Graph::IBody nodes that are present in the field's defined influence groups.

Fields come in different shapes (planar, spherical, ...) and can be controlled to apply either a force or an acceleration to the bodies within its range. There is also a nuber of factors (constant, linear and quadratic) that can be set to control the actual field strength acting on a body depending on its distance to the field.

See Graph::IBody to define a body to act on.


Table members

Methods


GetNodeInterface()

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.

Murl.Graph.INode GetNodeInterface()

Returns
Murl.Graph.INode The constant Graph::INode interface, or null if not available

GetTransformInterface()

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.

Murl.Graph.ITransform GetTransformInterface()

Returns
Murl.Graph.ITransform The constant Graph::ITransform interface, or null if not available

SetInfluenceGroupMask(mask)

Set the individual body groups this field is influencing. This method sets the field's influence on a number of individual body groups. Each bit in the given mask represents one of 32 possible groups; see Graph::IBody::SetResponseGroupMask() for assigning a body to any of these groups.

Boolean SetInfluenceGroupMask(Integer mask)

Parameters
maskThe group influence bit mask.
Returns
Boolean true if successful.

GetInfluenceGroupMask()

Get the individual body groups this field is influencing.

Integer GetInfluenceGroupMask()

Returns
Integer The bit mask specifying the group influence.

SetConstantFactor(factor)

Set the field's constant influence factor. The given value represents the constant field influence factor, i.e. the amount of influence on any body independent of its distance.

Boolean SetConstantFactor(Number factor)

Parameters
factorThe field's constant influence factor.
Returns
Boolean true if successful.

GetConstantFactor()

Get the field's constant influence factor.

Number GetConstantFactor()

Returns
Number The field's constant influence factor.

SetLinearFactor(factor)

Set the field's linear influence factor. The given value represents the linear field influence factor, i.e. the amount of influence on any body degrading linearly in proportion to that body's distance to the field.

Boolean SetLinearFactor(Number factor)

Parameters
factorThe field's linear influence factor.
Returns
Boolean true if successful.

GetLinearFactor()

Get the field's linear influence factor.

Number GetLinearFactor()

Returns
Number The field's linear influence factor.

SetQuadraticFactor(factor)

Set the field's quadratic influence factor. The given value represents the quadratic field influence factor, i.e. the amount of influence on any body degrading in a quadratic curve in a proportion to that body's distance to the field.

Boolean SetQuadraticFactor(Number factor)

Parameters
factorThe field's quadratic influence factor.
Returns
Boolean true if successful.

GetQuadraticFactor()

Get the field's quadratic influence factor.

Number GetQuadraticFactor()

Returns
Number The field's quadratic influence factor.

SetType(type)

Set the field type.

Boolean SetType(Murl.IEnums.FieldType type)

Parameters
typeThe field type.
Returns
Boolean true if successful.

GetType()

Get the field type.

Murl.IEnums.FieldType GetType()

Returns
Murl.IEnums.FieldType The field type.

SetShape(shape)

Set the field shape.

Boolean SetShape(Murl.IEnums.FieldShape shape)

Parameters
shapeThe field shape.
Returns
Boolean true if successful.

GetShape()

Get the field shape.

Murl.IEnums.FieldShape GetShape()

Returns
Murl.IEnums.FieldShape The field shape.