LuaDocs/MovableObject

From Data Realms Wiki

(Difference between revisions)
Jump to: navigation, search
m (MediaWiki collapses multiple trailing new lines / carriage returns down to one between the section edited and any following. This will preserve spacing when sub-sections of "Functions" are edited.)
(MovableObject - Automatically generated by LuaBot)
 
(4 intermediate revisions not shown)
Line 10: Line 10:
==Properties==
==Properties==
===ClassName===
===ClassName===
-
The class name of this Entity.
+
The class name of this Entity.A string with the friendly-formatted type name of this object.
-
A string with the friendly-formatted type name of this object.
+
===Mass===
===Mass===
-
The mass value of this MovableObject.
+
The mass value of this MovableObject.A float describing the mass value in Kilograms (kg).
-
A float describing the mass value in Kilograms (kg).
+
===Vel===
===Vel===
-
The velocity vector of this MovableObject.
+
The velocity vector of this MovableObject.A Vector describing the current velocity vector.
-
A Vector describing the current velocity vector.
+
===AngularVel===
===AngularVel===
-
The current angular velocity of this MovableObject. Positive is a counter-clockwise rotation.
+
The current angular velocity of this MovableObject. Positive is a counter-clockwise rotation.The angular velocity in radians per second.
-
The angular velocity in radians per second.
+
===Radius===
===Radius===
-
Read-only property. The largest radius of this in pixels.
+
Read-only property. The largest radius of this in pixels.The radius from its center to the edge of its graphical representation.
-
The radius from its center to the edge of its graphical representation.
+
===Diameter===
===Diameter===
-
Read-only property. The largest diameter of this in pixels.
+
Read-only property. The largest diameter of this in pixels.The largest diameter across its graphical representation.
-
The largest diameter across its graphical representation.
+
===Scale===
===Scale===
-
The current scale of this MOSRotating. This is mostly for fun.
+
The current scale of this MOSRotating. This is mostly for fun.The normalized scale.
-
The normalized scale.
+
 
 +
===GlobalAccScalar===
 +
Read-only property. Gets How this is affected by global effects, from +1.0 to -1.0. Something with a negative value will 'float' upward.The global acceleration scalar.
 +
 
 +
===AirResistance===
 +
Read-only property. How much this is affected by air resistance when traveling over a second, 0 to 1.0, with 0 as defaultThe air resistance coefficient.
 +
 
 +
===AirThreshold===
 +
Read-only property. At which threshold of velocity, in m/s, the effect of AirResistance kicks in.The air threshold speed.
===Age===
===Age===
-
Gets real time age of this MovableObject.
+
Gets real time age of this MovableObject.A unsigned long describing the current age in ms.
-
A unsigned long describing the current age in ms.
+
===Lifetime===
===Lifetime===
-
The amount of time this MovableObject will exist from creation.
+
The amount of time this MovableObject will exist from creation.A unsigned long describing the current lifetime in ms. 0 means unlimited.
-
A unsigned long describing the current lifetime in ms. 0 means unlimited.
+
===ID===
===ID===
-
Read-only property. The MOID of this MovableObject for this frame.
+
Read-only property. The MOID of this MovableObject for this frame.An int specifying the MOID that this MovableObject is assigned for the current frame only.
-
An unsigned char specifying the MOID that this MovableObject is assigned for the current frame only.
+
 
 +
===UniqueID===
 +
Read-only property. Returns this MO's unique persistent IDReturns this MO's unique persistent ID
===RootID===
===RootID===
-
Read-only property. The MOID of the MovableObject which is the root MO of this MO for this frame. If same as what GetID returns, then this is owned by MovableMan.
+
Read-only property. The MOID of the MovableObject which is the root MO of this MO for this frame. If same as what GetID returns, then this is owned by MovableMan.An int specifying the MOID of the MO that this MovableObject is owned by for the current frame only.
-
An unsigned char specifying the MOID of the MO that this MovableObject is owned by for the current frame only.
+
===MOIDFootprint===
===MOIDFootprint===
-
Read-only property. Gets how many total (subsequent) MOID's this MO and all its children are taking up this frame. ie if this MO has no children, this will likely be 1. Note this is only valid for this frame!
+
Read-only property. Gets how many total (subsequent) MOID's this MO and all its children are taking up this frame. ie if this MO has no children, this will likely be 1. Note this is only valid for this frame!The number of MOID indices this MO and all its children are taking up.
-
The number of MOID indices this MO and all its children are taking up.
+
===Sharpness===
===Sharpness===
-
The sharpness factor of this MO.
+
The sharpness factor of this MO.The sharpness factor of this MO. 1.0 means normal sharpness, no alter- ation to any of the impulses.
-
The sharpness factor of this MO. 1.0 means normal sharpness, no alter- ation to any of the impulses.
+
===AboveHUDPos===
===AboveHUDPos===
-
Read-only property. The absolute position of the top of this MO's HUD stack.
+
Read-only property. The absoltue position of the top of this' HUD stack.A Vector with the absolute position of this' HUD stack top point.
-
A Vector with the absolute position of this MO's HUD stack top point.
+
===HitsMOs===
===HitsMOs===
-
Gets whether this MovableObject is set to collide with other MovableObject:s during its travel.
+
Gets whether this MovableObject is set to collide with other MovableObject:s during its travel.Whether this hits other MO's during its travel, or not.
-
Whether this hits other MOs during its travel, or not.
+
===GetsHitByMOs===
===GetsHitByMOs===
-
Gets whether this MovableObject is set to be able to get hit by other MovableObject:s during their travel.
+
Gets whether this MovableObject is set to be able to get hit by other MovableObject:s during their travel.Whether this can get hit by MO's, or not.
-
Whether this can get hit by MOs, or not.
+
===IgnoresTeamHits===
===IgnoresTeamHits===
-
Tells whether this will collide with any other MO of the same team.
+
Tells whether this will collide with any other MO of the same team.Whether this can hit or get hit by other MOs of the same team.
-
Whether this can hit or get hit by other MOs of the same team.
+
===IgnoresWhichTeam===
===IgnoresWhichTeam===
-
Read-only property. Tells which team this would be ignoring hits with, if we're ignoring hits at all.
+
Read-only property. Tells which team this would be ignoring hits with, if we're ignoring hits at all.Which team this ignores hits with, if any.
-
Which team this ignores hits with, if any.
+
===ToSettle===
===ToSettle===
-
Indicates whether this MO is marked for settling at the end of the MovableMan update.
+
Indicates whether this MO is marked for settling at the end of the MovableMan update.Whether this MO is marked for settling ontot the terrain or not.
-
Whether this MO is marked for settling onto the terrain (i.e. become dirt) or not.
+
===ToDelete===
===ToDelete===
-
Indicates whether this MO is marked for deletion at the end of the MovableMan update.
+
Indicates whether this MO is marked for deletion at the end of the MovableMan update.Whether this MO is marked for deletion or not.
-
Whether this MO is marked for deletion or not.
+
===HUDVisible===
===HUDVisible===
-
Tells whether this Actor's HUD is drawn or not.
+
Tells whether this Actor's HUD is drawn or not.Whether this' HUD gets drawn or not.
===PinStrength===
===PinStrength===
-
The impulse force threshold which has to be exceeded to "shake loose" this MO from a "pinned" state. Pinned MOs don't get moved by travel algorithms. If 0, this isn't pinned.
+
The impulse force threshold which has to be exceeded to 'shake loose' this from a 'pinned' state. Pinned MOs don't get moved by travel algos. If 0, this isn't pinned.The impulse threshold in kg * (m/s). 0 means no pinning
-
The impulse threshold in kg * (m/s).
+
 
==Functions==
==Functions==
Line 108: Line 100:
An error return value signaling sucess or any particular failure. Anything below 0 is an error signal.
An error return value signaling sucess or any particular failure. Anything below 0 is an error signal.
-
<br>
 
===GetAltitude===
===GetAltitude===
Line 122: Line 113:
The rough altitude over the terrain, in pixels.
The rough altitude over the terrain, in pixels.
-
<br>
 
===SetWhichMOToNotHit===
===SetWhichMOToNotHit===
Line 137: Line 127:
None.
None.
-
<br>
 
===IsSetToDelete===
===IsSetToDelete===
Line 150: Line 139:
Whether this is marked for deletion or not.
Whether this is marked for deletion or not.
-
<br>
 
===IsMissionCritical===
===IsMissionCritical===
-
Shows whether this is mission critical and therefore should NEVER settle (become dirt) or otherwise be destroyed during the course of a mission.
+
Shows whether this is mission critical and should therefore NEVER be settled or otherwise destroyed during teh course of a mission.
'''Arguments:'''
'''Arguments:'''
-
* None
+
* None.
'''Return value:'''
'''Return value:'''
-
Whether this should be immune to settling and destruction.
+
Whetehr this should be immune to settling and destruction.
-
<br>
 
===IsGeneric===
===IsGeneric===
Line 176: Line 163:
Whether this MovableObject is of Type Generic or not.
Whether this MovableObject is of Type Generic or not.
-
<br>
 
===IsActor===
===IsActor===
Line 189: Line 175:
Whether this MovableObject is of Type Actor or not.
Whether this MovableObject is of Type Actor or not.
-
<br>
 
===IsDevice===
===IsDevice===
Line 202: Line 187:
Whether this MovableObject is of Type Device (Held or Thrown) or not.
Whether this MovableObject is of Type Device (Held or Thrown) or not.
-
<br>
 
===IsHeldDevice===
===IsHeldDevice===
Line 215: Line 199:
Whether this MovableObject is of Type HeldDevice or not.
Whether this MovableObject is of Type HeldDevice or not.
-
<br>
 
===IsThrownDevice===
===IsThrownDevice===
Line 228: Line 211:
Whether this MovableObject is of Type ThrownDevice or not.
Whether this MovableObject is of Type ThrownDevice or not.
-
<br>
 
===IsGold===
===IsGold===
Line 241: Line 223:
Whether this MovableObject is of Gold or not.
Whether this MovableObject is of Gold or not.
-
<br>
 
===IsThrownDevice===
===IsThrownDevice===
Line 254: Line 235:
Whether this MovableObject is of Type ThrownDevice or not.
Whether this MovableObject is of Type ThrownDevice or not.
-
<br>
 
===HasObject===
===HasObject===
Line 265: Line 245:
'''Return value:'''
'''Return value:'''
-
Whether the object was found carried by this.
+
Whetehr the object was found carried by this.
-
<br>
 
===HasObjectInGroup===
===HasObjectInGroup===
Line 278: Line 257:
'''Return value:'''
'''Return value:'''
-
Whether the object in the group was found carried by this.
+
Whetehr the object in the group was found carried by this.
-
<br>
 
===AddForce===
===AddForce===
Line 295: Line 273:
None.
None.
-
<br>
 
===AddAbsForce===
===AddAbsForce===
Line 310: Line 287:
None.
None.
-
<br>
 
===AddImpulseForce===
===AddImpulseForce===
Line 324: Line 300:
None.
None.
-
<br>
 
===AddAbsImpulseForce===
===AddAbsImpulseForce===
Line 338: Line 313:
None.
None.
-
<br>
 
===ClearForces===
===ClearForces===
Line 351: Line 325:
None.
None.
-
<br>
 
===ClearImpulseForces===
===ClearImpulseForces===
Line 364: Line 337:
None.
None.
-
<br>
 
===RestDetection===
===RestDetection===
Line 377: Line 349:
None.
None.
-
<br>
 
===NotResting===
===NotResting===
Line 390: Line 361:
None.
None.
-
<br>
 
===IsAtRest===
===IsAtRest===
Line 403: Line 373:
Wheter the MovableObject has been at rest for more than one full second.
Wheter the MovableObject has been at rest for more than one full second.
-
<br>
 
===MoveOutOfTerrain===
===MoveOutOfTerrain===
Line 416: Line 385:
Whether any intersection was successfully resolved. Will return true even if there wasn't any intersections to begin with.
Whether any intersection was successfully resolved. Will return true even if there wasn't any intersections to begin with.
-
<br>
 
===RotateOffset===
===RotateOffset===

Latest revision as of 20:17, 2 April 2015

Contents

Parent: SceneObject

Abstract Class. A movable object with mass.

Go back to Class Index


Properties

ClassName

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

Mass

The mass value of this MovableObject.A float describing the mass value in Kilograms (kg).

Vel

The velocity vector of this MovableObject.A Vector describing the current velocity vector.

AngularVel

The current angular velocity of this MovableObject. Positive is a counter-clockwise rotation.The angular velocity in radians per second.

Radius

Read-only property. The largest radius of this in pixels.The radius from its center to the edge of its graphical representation.

Diameter

Read-only property. The largest diameter of this in pixels.The largest diameter across its graphical representation.

Scale

The current scale of this MOSRotating. This is mostly for fun.The normalized scale.

GlobalAccScalar

Read-only property. Gets How this is affected by global effects, from +1.0 to -1.0. Something with a negative value will 'float' upward.The global acceleration scalar.

AirResistance

Read-only property. How much this is affected by air resistance when traveling over a second, 0 to 1.0, with 0 as defaultThe air resistance coefficient.

AirThreshold

Read-only property. At which threshold of velocity, in m/s, the effect of AirResistance kicks in.The air threshold speed.

Age

Gets real time age of this MovableObject.A unsigned long describing the current age in ms.

Lifetime

The amount of time this MovableObject will exist from creation.A unsigned long describing the current lifetime in ms. 0 means unlimited.

ID

Read-only property. The MOID of this MovableObject for this frame.An int specifying the MOID that this MovableObject is assigned for the current frame only.

UniqueID

Read-only property. Returns this MO's unique persistent IDReturns this MO's unique persistent ID

RootID

Read-only property. The MOID of the MovableObject which is the root MO of this MO for this frame. If same as what GetID returns, then this is owned by MovableMan.An int specifying the MOID of the MO that this MovableObject is owned by for the current frame only.

MOIDFootprint

Read-only property. Gets how many total (subsequent) MOID's this MO and all its children are taking up this frame. ie if this MO has no children, this will likely be 1. Note this is only valid for this frame!The number of MOID indices this MO and all its children are taking up.

Sharpness

The sharpness factor of this MO.The sharpness factor of this MO. 1.0 means normal sharpness, no alter- ation to any of the impulses.

AboveHUDPos

Read-only property. The absoltue position of the top of this' HUD stack.A Vector with the absolute position of this' HUD stack top point.

HitsMOs

Gets whether this MovableObject is set to collide with other MovableObject:s during its travel.Whether this hits other MO's during its travel, or not.

GetsHitByMOs

Gets whether this MovableObject is set to be able to get hit by other MovableObject:s during their travel.Whether this can get hit by MO's, or not.

IgnoresTeamHits

Tells whether this will collide with any other MO of the same team.Whether this can hit or get hit by other MOs of the same team.

IgnoresWhichTeam

Read-only property. Tells which team this would be ignoring hits with, if we're ignoring hits at all.Which team this ignores hits with, if any.

ToSettle

Indicates whether this MO is marked for settling at the end of the MovableMan update.Whether this MO is marked for settling ontot the terrain or not.

ToDelete

Indicates whether this MO is marked for deletion at the end of the MovableMan update.Whether this MO is marked for deletion or not.

HUDVisible

Tells whether this Actor's HUD is drawn or not.Whether this' HUD gets drawn or not.

PinStrength

The impulse force threshold which has to be exceeded to 'shake loose' this from a 'pinned' state. Pinned MOs don't get moved by travel algos. If 0, this isn't pinned.The impulse threshold in kg * (m/s). 0 means no pinning


Functions

ReloadScripts

Reloads the preset scripts of this object, from the same script file path as was originally defined. This will also update the original preset in the PresetMan with the updated scripts so future objects spawned will use the new scripts.

Arguments:

  • None.

Return value:

An error return value signaling sucess or any particular failure. Anything below 0 is an error signal.


GetAltitude

Gets the altitide of this' pos (or appropriate low point) over the terrain, in pixels.

Arguments:

  • The max altitude you care to check for. 0 Means check the whole scene's height.
  • The accuracy within which measurement is acceptable. Higher number here means less calculation.

Return value:

The rough altitude over the terrain, in pixels.


SetWhichMOToNotHit

Sets this MO to not hit a specific other MO and all its children even though MO hitting is enabled on this MovableObject

Arguments:

  • A pointer to the MO to not be hitting. 0 means don't ignore anyhting.
  • Ownership is not transferred!
  • For how long, in S, to ignore the above. Negative number means forever.

Return value:

None.


IsSetToDelete

Tells if this MovableObject is marked for deletion at the end of the update.

Arguments:

  • None.

Return value:

Whether this is marked for deletion or not.


IsMissionCritical

Shows whether this is mission critical and should therefore NEVER be settled or otherwise destroyed during teh course of a mission.

Arguments:

  • None.

Return value:

Whetehr this should be immune to settling and destruction.


IsGeneric

Indicates whether this MO is an Generic or not.

Arguments:

  • None.

Return value:

Whether this MovableObject is of Type Generic or not.


IsActor

Indicates whether this MO is an Actor or not.

Arguments:

  • None.

Return value:

Whether this MovableObject is of Type Actor or not.


IsDevice

Indicates whether this MO is a Device or not.

Arguments:

  • None.

Return value:

Whether this MovableObject is of Type Device (Held or Thrown) or not.


IsHeldDevice

Indicates whether this MO is a HeldDevice or not.

Arguments:

  • None.

Return value:

Whether this MovableObject is of Type HeldDevice or not.


IsThrownDevice

Indicates whether this MO is a ThrownDevice or not.

Arguments:

  • None.

Return value:

Whether this MovableObject is of Type ThrownDevice or not.


IsGold

Indicates whether this MO is made of Gold or not.

Arguments:

  • None.

Return value:

Whether this MovableObject is of Gold or not.


IsThrownDevice

Indicates whether this MO is a ThrownDevice or not.

Arguments:

  • None.

Return value:

Whether this MovableObject is of Type ThrownDevice or not.


HasObject

Shows whether this is or carries a specifically named object in its inventory. Also looks through the inventories of potential passengers, as applicable.

Arguments:

  • The Preset name of the object to look for.

Return value:

Whetehr the object was found carried by this.


HasObjectInGroup

Shows whether this is or carries a specifically grouped object in its inventory. Also looks through the inventories of potential passengers, as applicable.

Arguments:

  • The name of the group to look for.

Return value:

Whetehr the object in the group was found carried by this.


AddForce

Adds force to this MovableObject for the next time Update() is called.

Arguments:

  • An Vector with the external force vector that will be added to this
  • MovableObject and affect its path next Update(). In N or kg * m/s^2.
  • A Vector with the offset, in METERS, of where the force is being applied relative to the center of this MovableObject.

Return value:

None.


AddAbsForce

Adds force to this MovableObject for the next time Update() is called.

Arguments:

  • An Vector with the external force vector that will be added to this
  • MovableObject and affect its path next Update(). In N or kg * m/s^2.
  • A Vector with the absolute world coordinates, in PIXELS, of where the force is being applied to the center of this MovableObject.

Return value:

None.


AddImpulseForce

Adds impulse force (or instant momentum) to this MovableObject for the next time Update() is called.

Arguments:

  • An Vector with the impulse force vector that will directly be added to this MovableObject's momentum next Update(). In kg * m/s.
  • A Vector with the offset, in METERS, of where the impulse is being applied relative to the center of this MovableObject.

Return value:

None.


AddAbsImpulseForce

Adds impulse force (or instant momentum) to this MovableObject for the next time Update() is called.

Arguments:

  • An Vector with the impulse force vector that will directly be added to this MovableObject's momentum next Update(). In kg * m/s.
  • A Vector with the absolute world coordinates, in PIXELS, of where the force is being applied to the center of this MovableObject.

Return value:

None.


ClearForces

Clears out all the forces this MO has accumulated during this frame.

Arguments:

  • None.

Return value:

None.


ClearImpulseForces

Clears out all the impulses this MO has accumulated during this frame.

Arguments:

  • None.

Return value:

None.


RestDetection

Does the calculations necessary to detect whether this MO appears to have has settled in the world and is at rest or not. IsAtRest() retreves the answer.

Arguments:

  • None.

Return value:

None.


NotResting

Makes this MO reset its tiemr that keeps track of how long it's been at rest, effectively delaying it.

Arguments:

  • None.

Return value:

None.


IsAtRest

Indicates wheter the MovableObject has been at rest (no velocity) for more than one (1) second.

Arguments:

  • None.

Return value:

Wheter the MovableObject has been at rest for more than one full second.


MoveOutOfTerrain

Checks whether any of the Atom:s in this MovableObject are on top of terrain pixels, and if so, attempt to move this out so none of this' Atoms are on top of the terrain any more.

Arguments:

  • Only consider materials stronger than this in the terrain for intersections.

Return value:

Whether any intersection was successfully resolved. Will return true even if there wasn't any intersections to begin with.


RotateOffset

Rotates a vector offset from this MORotating's position according to the rotate angle and flipping.

Arguments:

  • A const reference the offset Vector to rotate.

Return value:

A new vector that is the result of the rotation.


Go back to Class Index

Personal tools