LuaDocs/Attachable

From Data Realms Wiki

(Difference between revisions)
Jump to: navigation, search
(Parent: MOSRotating)
(Attachable - Automatically generated by LuaBot)
 
(3 intermediate revisions not shown)
Line 1: Line 1:
-
===Parent:  [[LuaDocs/MOSRotating|MOSRotating]]===
+
===Parent:  [[MOSRotating|MOSRotating]]===
'''Concrete Class.'''  
'''Concrete Class.'''  
Line 6: Line 6:
[[LuaDocs/Index|'''Go back to Class Index''']]
[[LuaDocs/Index|'''Go back to Class Index''']]
 +
==Properties==
==Properties==
Line 19: Line 20:
===JointStiffness===
===JointStiffness===
Sets the normalized stiffness scalar of the join of this Attachable.A float between 0 and 1.0. 1.0 means 100% of all forces imposed on this attachable will be transferred through the joint to the parent. 0.5 means 50%, and so on.
Sets the normalized stiffness scalar of the join of this Attachable.A float between 0 and 1.0. 1.0 means 100% of all forces imposed on this attachable will be transferred through the joint to the parent. 0.5 means 50%, and so on.
 +
 +
===JointStrength===
 +
The amount of impulse force the joint of this Attachable can handle before breaking.A float with the max tolerated impulse force in kg * m/s.
===RotTarget===
===RotTarget===
Line 28: Line 32:
===OnlyLinearForces===
===OnlyLinearForces===
Indicates whether this AEmitter only cares about linear forces that it creates through emissions, ie no torquing due to the parent offset.Whether only using linear forces or not.
Indicates whether this AEmitter only cares about linear forces that it creates through emissions, ie no torquing due to the parent offset.Whether only using linear forces or not.
 +
 +
===DamageMultiplier===
 +
Returns damage multiplier of this attachable.Current multiplier value.
==Functions==
==Functions==
-
===GetRootParent===
 
-
Gets the MO which is the ultimate root parent of this Attachable and its parent.
 
-
 
-
'''Arguments:'''
 
-
 
-
* None.
 
-
 
-
'''Return value:'''
 
-
 
-
A pointer to the highest root parent of this Attachable.
 
-
 
-
 
===IsAttached===
===IsAttached===
Indicates whether this Attachable is attached to an MOSprite or not.
Indicates whether this Attachable is attached to an MOSprite or not.

Latest revision as of 20:17, 2 April 2015

Contents

Parent: MOSRotating

Concrete Class. An articulated, detachable part of an Actor's body.

Go back to Class Index


Properties

ClassName

The class name of this Entity.A string with the friendly-formatted type name of this object.

ParentOffset

The stored offset between this Attachable's parent's Pos and the joint position. This should be maintained by the parent.A const reference Vector describing the offset from the parent's pos to the joint point.

JointOffset

Read-only property. The offset to the joint (the point around which this Attachable and its parent hinge) from this Attachable's center of mass/origin.A const reference Vector describing the offset of the joint relative to the this Attachable's origin/center of mass position.

JointStiffness

Sets the normalized stiffness scalar of the join of this Attachable.A float between 0 and 1.0. 1.0 means 100% of all forces imposed on this attachable will be transferred through the joint to the parent. 0.5 means 50%, and so on.

JointStrength

The amount of impulse force the joint of this Attachable can handle before breaking.A float with the max tolerated impulse force in kg * m/s.

RotTarget

The target rotation that this Attachable should be striving to match its real rotation with, if it is attached. The joint stiffness will determine how strong the scalar spring is between the current rotation and the target set here.A float for the current target angle in radians.

AtomSubgroupID

The subgroup ID of this' Atoms.The the subgroup ID of this' Atoms.

OnlyLinearForces

Indicates whether this AEmitter only cares about linear forces that it creates through emissions, ie no torquing due to the parent offset.Whether only using linear forces or not.

DamageMultiplier

Returns damage multiplier of this attachable.Current multiplier value.


Functions

IsAttached

Indicates whether this Attachable is attached to an MOSprite or not.

Arguments:

  • None.

Return value:

Whether it's attached or not.


IsAttachedTo

Indicates whether this Attachable is attached to a specific actor or not.

Arguments:

  • A pointer to which MOSprite you want to check if this is attached to.

Return value:

Whether it's attached or not.


IsDrawnAfterParent

Indicates whether this Attachable is to be drawn after (in front of) or before (behind) the parent.

Arguments:

  • None.

Return value:

Whether it's to be drawn after parent or not.


Detach

Detaches this Attachable from its host MOSprite

Arguments:

  • None.

Return value:

None.


TransferJointForces

Bundles up all the accumulated forces of this Attachable and calcs how they transfer to the joint, and therefore to the parent.

Arguments:

  • A vector that will have with the forces affecting the joint ADDED to it.

Return value:

If the accumulated forces exceed the strength of the joint, the attachable will only fill out the forces up to the strength threshold and then detach itself and return false, and the parent should react accordingly in that case (null out pointers to the Attachable).


TransferJointImpulses

Bundles up all the accumulated impulses of this Attachable and calcs how they transfer to the joint, and therefore to the parent.

Arguments:

  • A vector that will have with the imps affecting the joint ADDED to it.

Return value:

If the accumulated impulses exceed the strength of the joint, the attachable will only fill out the impulses up to the strength threshold and then detach itself and return false, and the parent should react accordingly in that case (null out pointers to the Attachable).


CollectDamage

Gets the amount of damage points this Attachable has sustained and should cause its parent. Calling this will reset the damage count. This should normally be called AFTER Update() to get the correct damage for a given frame.

Arguments:

  • None.

Return value:

A float with the damage points accumulated since the last time this method was called.


Go back to Class Index

Personal tools